1. Go to this page and download the library: Download tourze/aws-lightsail-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use AwsLightsailBundle\Service\InstanceSyncService;
use AwsLightsailBundle\Repository\InstanceRepository;
use Symfony\Component\DependencyInjection\ContainerInterface;
// Get the instance sync service
$instanceSyncService = $container->get(InstanceSyncService::class);
// Get the instance repository
$instanceRepository = $container->get(InstanceRepository::class);
// List all local instances
$instances = $instanceRepository->findAll();
// Sync instances from AWS to local database
$credential = $credentialRepository->findDefault();
$result = $instanceSyncService->batchSyncInstances($credential, $awsInstanceData);
// Instance Sync Service
$instanceSyncService = $container->get(AwsLightsailBundle\Service\InstanceSyncService::class);
// Key Pair Sync Service
$keyPairSyncService = $container->get(AwsLightsailBundle\Service\KeyPairSyncService::class);
// Instance Data Updater
$instanceDataUpdater = $container->get(AwsLightsailBundle\Service\InstanceDataUpdater::class);
// Admin Menu Service
$adminMenuService = $container->get(AwsLightsailBundle\Service\AdminMenu::class);
// Sync instances from AWS
$credential = $credentialRepository->findDefault();
$result = $instanceSyncService->batchSyncInstances($credential, $awsInstanceData);
// Sync key pairs from AWS
$result = $keyPairSyncService->batchSyncKeyPairs($credential, $awsKeyPairData);
// Update instance data
$instanceDataUpdater->updateInstanceData($instance, $awsInstanceData);
// List all available credentials
$credentialRepository = $container->get(AwsLightsailBundle\Repository\AwsCredentialRepository::class);
$credentials = $credentialRepository->findAll();