SDK for PHP 3.x

Client: Aws\Lightsail\LightsailClient
Service ID: lightsail
Version: 2016-11-28

This page describes the parameters and results for the operations of the Amazon Lightsail (2016-11-28), and shows how to use the Aws\Lightsail\LightsailClient object to call the described operations. This documentation is specific to the 2016-11-28 API version of the service.

Operation Summary

Each of the following operations can be created from a client using $client->getCommand('CommandName'), where "CommandName" is the name of one of the following operations. Note: a command is a value that encapsulates an operation and the parameters used to create an HTTP request.

You can also create and send a command immediately using the magic methods available on a client object: $client->commandName(/* parameters */). You can send the command asynchronously (returning a promise) by appending the word "Async" to the operation name: $client->commandNameAsync(/* parameters */).

AllocateStaticIp ( array $params = [] )
Allocates a static IP address.
AttachCertificateToDistribution ( array $params = [] )
Attaches an SSL/TLS certificate to your Amazon Lightsail content delivery network (CDN) distribution.
AttachDisk ( array $params = [] )
Attaches a block storage disk to a running or stopped Lightsail instance and exposes it to the instance with the specified disk name.
AttachInstancesToLoadBalancer ( array $params = [] )
Attaches one or more Lightsail instances to a load balancer.
AttachLoadBalancerTlsCertificate ( array $params = [] )
Attaches a Transport Layer Security (TLS) certificate to your load balancer.
AttachStaticIp ( array $params = [] )
Attaches a static IP address to a specific Amazon Lightsail instance.
CloseInstancePublicPorts ( array $params = [] )
Closes ports for a specific Amazon Lightsail instance.
CopySnapshot ( array $params = [] )
Copies a manual snapshot of an instance or disk as another manual snapshot, or copies an automatic snapshot of an instance or disk as a manual snapshot.
CreateBucket ( array $params = [] )
Creates an Amazon Lightsail bucket.
CreateBucketAccessKey ( array $params = [] )
Creates a new access key for the specified Amazon Lightsail bucket.
CreateCertificate ( array $params = [] )
Creates an SSL/TLS certificate for an Amazon Lightsail content delivery network (CDN) distribution and a container service.
CreateCloudFormationStack ( array $params = [] )
Creates an AWS CloudFormation stack, which creates a new Amazon EC2 instance from an exported Amazon Lightsail snapshot.
CreateContactMethod ( array $params = [] )
Creates an email or SMS text message contact method.
CreateContainerService ( array $params = [] )
Creates an Amazon Lightsail container service.
CreateContainerServiceDeployment ( array $params = [] )
Creates a deployment for your Amazon Lightsail container service.
CreateContainerServiceRegistryLogin ( array $params = [] )
Creates a temporary set of log in credentials that you can use to log in to the Docker process on your local machine.
CreateDisk ( array $params = [] )
Creates a block storage disk that can be attached to an Amazon Lightsail instance in the same Availability Zone (us-east-2a).
CreateDiskFromSnapshot ( array $params = [] )
Creates a block storage disk from a manual or automatic snapshot of a disk.
CreateDiskSnapshot ( array $params = [] )
Creates a snapshot of a block storage disk.
CreateDistribution ( array $params = [] )
Creates an Amazon Lightsail content delivery network (CDN) distribution.
CreateDomain ( array $params = [] )
Creates a domain resource for the specified domain (example.
CreateDomainEntry ( array $params = [] )
Creates one of the following domain name system (DNS) records in a domain DNS zone: Address (A), canonical name (CNAME), mail exchanger (MX), name server (NS), start of authority (SOA), service locator (SRV), or text (TXT).
CreateGUISessionAccessDetails ( array $params = [] )
Creates two URLs that are used to access a virtual computer’s graphical user interface (GUI) session.
CreateInstanceSnapshot ( array $params = [] )
Creates a snapshot of a specific virtual private server, or instance.
CreateInstances ( array $params = [] )
Creates one or more Amazon Lightsail instances.
CreateInstancesFromSnapshot ( array $params = [] )
Creates one or more new instances from a manual or automatic snapshot of an instance.
CreateKeyPair ( array $params = [] )
Creates a custom SSH key pair that you can use with an Amazon Lightsail instance.
CreateLoadBalancer ( array $params = [] )
Creates a Lightsail load balancer.
CreateLoadBalancerTlsCertificate ( array $params = [] )
Creates an SSL/TLS certificate for an Amazon Lightsail load balancer.
CreateRelationalDatabase ( array $params = [] )
Creates a new database in Amazon Lightsail.
CreateRelationalDatabaseFromSnapshot ( array $params = [] )
Creates a new database from an existing database snapshot in Amazon Lightsail.
CreateRelationalDatabaseSnapshot ( array $params = [] )
Creates a snapshot of your database in Amazon Lightsail.
DeleteAlarm ( array $params = [] )
Deletes an alarm.
DeleteAutoSnapshot ( array $params = [] )
Deletes an automatic snapshot of an instance or disk.
DeleteBucket ( array $params = [] )
Deletes a Amazon Lightsail bucket.
DeleteBucketAccessKey ( array $params = [] )
Deletes an access key for the specified Amazon Lightsail bucket.
DeleteCertificate ( array $params = [] )
Deletes an SSL/TLS certificate for your Amazon Lightsail content delivery network (CDN) distribution.
DeleteContactMethod ( array $params = [] )
Deletes a contact method.
DeleteContainerImage ( array $params = [] )
Deletes a container image that is registered to your Amazon Lightsail container service.
DeleteContainerService ( array $params = [] )
Deletes your Amazon Lightsail container service.
DeleteDisk ( array $params = [] )
Deletes the specified block storage disk.
DeleteDiskSnapshot ( array $params = [] )
Deletes the specified disk snapshot.
DeleteDistribution ( array $params = [] )
Deletes your Amazon Lightsail content delivery network (CDN) distribution.
DeleteDomain ( array $params = [] )
Deletes the specified domain recordset and all of its domain records.
DeleteDomainEntry ( array $params = [] )
Deletes a specific domain entry.
DeleteInstance ( array $params = [] )
Deletes an Amazon Lightsail instance.
DeleteInstanceSnapshot ( array $params = [] )
Deletes a specific snapshot of a virtual private server (or instance).
DeleteKeyPair ( array $params = [] )
Deletes the specified key pair by removing the public key from Amazon Lightsail.
DeleteKnownHostKeys ( array $params = [] )
Deletes the known host key or certificate used by the Amazon Lightsail browser-based SSH or RDP clients to authenticate an instance.
DeleteLoadBalancer ( array $params = [] )
Deletes a Lightsail load balancer and all its associated SSL/TLS certificates.
DeleteLoadBalancerTlsCertificate ( array $params = [] )
Deletes an SSL/TLS certificate associated with a Lightsail load balancer.
DeleteRelationalDatabase ( array $params = [] )
Deletes a database in Amazon Lightsail.
DeleteRelationalDatabaseSnapshot ( array $params = [] )
Deletes a database snapshot in Amazon Lightsail.
DetachCertificateFromDistribution ( array $params = [] )
Detaches an SSL/TLS certificate from your Amazon Lightsail content delivery network (CDN) distribution.
DetachDisk ( array $params = [] )
Detaches a stopped block storage disk from a Lightsail instance.
DetachInstancesFromLoadBalancer ( array $params = [] )
Detaches the specified instances from a Lightsail load balancer.
DetachStaticIp ( array $params = [] )
Detaches a static IP from the Amazon Lightsail instance to which it is attached.
DisableAddOn ( array $params = [] )
Disables an add-on for an Amazon Lightsail resource.
DownloadDefaultKeyPair ( array $params = [] )
Downloads the regional Amazon Lightsail default key pair.
EnableAddOn ( array $params = [] )
Enables or modifies an add-on for an Amazon Lightsail resource.
ExportSnapshot ( array $params = [] )
Exports an Amazon Lightsail instance or block storage disk snapshot to Amazon Elastic Compute Cloud (Amazon EC2).
GetActiveNames ( array $params = [] )
Returns the names of all active (not deleted) resources.
GetAlarms ( array $params = [] )
Returns information about the configured alarms.
GetAutoSnapshots ( array $params = [] )
Returns the available automatic snapshots for an instance or disk.
GetBlueprints ( array $params = [] )
Returns the list of available instance images, or blueprints.
GetBucketAccessKeys ( array $params = [] )
Returns the existing access key IDs for the specified Amazon Lightsail bucket.
GetBucketBundles ( array $params = [] )
Returns the bundles that you can apply to a Amazon Lightsail bucket.
GetBucketMetricData ( array $params = [] )
Returns the data points of a specific metric for an Amazon Lightsail bucket.
GetBuckets ( array $params = [] )
Returns information about one or more Amazon Lightsail buckets.
GetBundles ( array $params = [] )
Returns the bundles that you can apply to an Amazon Lightsail instance when you create it.
GetCertificates ( array $params = [] )
Returns information about one or more Amazon Lightsail SSL/TLS certificates.
GetCloudFormationStackRecords ( array $params = [] )
Returns the CloudFormation stack record created as a result of the create cloud formation stack operation.
GetContactMethods ( array $params = [] )
Returns information about the configured contact methods.
GetContainerAPIMetadata ( array $params = [] )
Returns information about Amazon Lightsail containers, such as the current version of the Lightsail Control (lightsailctl) plugin.
GetContainerImages ( array $params = [] )
Returns the container images that are registered to your Amazon Lightsail container service.
GetContainerLog ( array $params = [] )
Returns the log events of a container of your Amazon Lightsail container service.
GetContainerServiceDeployments ( array $params = [] )
Returns the deployments for your Amazon Lightsail container service A deployment specifies the settings, such as the ports and launch command, of containers that are deployed to your container service.
GetContainerServiceMetricData ( array $params = [] )
Returns the data points of a specific metric of your Amazon Lightsail container service.
GetContainerServicePowers ( array $params = [] )
Returns the list of powers that can be specified for your Amazon Lightsail container services.
GetContainerServices ( array $params = [] )
Returns information about one or more of your Amazon Lightsail container services.
GetCostEstimate ( array $params = [] )
Retrieves information about the cost estimate for a specified resource.
GetDisk ( array $params = [] )
Returns information about a specific block storage disk.
GetDiskSnapshot ( array $params = [] )
Returns information about a specific block storage disk snapshot.
GetDiskSnapshots ( array $params = [] )
Returns information about all block storage disk snapshots in your AWS account and region.
GetDisks ( array $params = [] )
Returns information about all block storage disks in your AWS account and region.
GetDistributionBundles ( array $params = [] )
Returns the bundles that can be applied to your Amazon Lightsail content delivery network (CDN) distributions.
GetDistributionLatestCacheReset ( array $params = [] )
Returns the timestamp and status of the last cache reset of a specific Amazon Lightsail content delivery network (CDN) distribution.
GetDistributionMetricData ( array $params = [] )
Returns the data points of a specific metric for an Amazon Lightsail content delivery network (CDN) distribution.
GetDistributions ( array $params = [] )
Returns information about one or more of your Amazon Lightsail content delivery network (CDN) distributions.
GetDomain ( array $params = [] )
Returns information about a specific domain recordset.
GetDomains ( array $params = [] )
Returns a list of all domains in the user's account.
GetExportSnapshotRecords ( array $params = [] )
Returns all export snapshot records created as a result of the export snapshot operation.
GetInstance ( array $params = [] )
Returns information about a specific Amazon Lightsail instance, which is a virtual private server.
GetInstanceAccessDetails ( array $params = [] )
Returns temporary SSH keys you can use to connect to a specific virtual private server, or instance.
GetInstanceMetricData ( array $params = [] )
Returns the data points for the specified Amazon Lightsail instance metric, given an instance name.
GetInstancePortStates ( array $params = [] )
Returns the firewall port states for a specific Amazon Lightsail instance, the IP addresses allowed to connect to the instance through the ports, and the protocol.
GetInstanceSnapshot ( array $params = [] )
Returns information about a specific instance snapshot.
GetInstanceSnapshots ( array $params = [] )
Returns all instance snapshots for the user's account.
GetInstanceState ( array $params = [] )
Returns the state of a specific instance.
GetInstances ( array $params = [] )
Returns information about all Amazon Lightsail virtual private servers, or instances.
GetKeyPair ( array $params = [] )
Returns information about a specific key pair.
GetKeyPairs ( array $params = [] )
Returns information about all key pairs in the user's account.
GetLoadBalancer ( array $params = [] )
Returns information about the specified Lightsail load balancer.
GetLoadBalancerMetricData ( array $params = [] )
Returns information about health metrics for your Lightsail load balancer.
GetLoadBalancerTlsCertificates ( array $params = [] )
Returns information about the TLS certificates that are associated with the specified Lightsail load balancer.
GetLoadBalancerTlsPolicies ( array $params = [] )
Returns a list of TLS security policies that you can apply to Lightsail load balancers.
GetLoadBalancers ( array $params = [] )
Returns information about all load balancers in an account.
GetOperation ( array $params = [] )
Returns information about a specific operation.
GetOperations ( array $params = [] )
Returns information about all operations.
GetOperationsForResource ( array $params = [] )
Gets operations for a specific resource (an instance or a static IP).
GetRegions ( array $params = [] )
Returns a list of all valid regions for Amazon Lightsail.
GetRelationalDatabase ( array $params = [] )
Returns information about a specific database in Amazon Lightsail.
GetRelationalDatabaseBlueprints ( array $params = [] )
Returns a list of available database blueprints in Amazon Lightsail.
GetRelationalDatabaseBundles ( array $params = [] )
Returns the list of bundles that are available in Amazon Lightsail.
GetRelationalDatabaseEvents ( array $params = [] )
Returns a list of events for a specific database in Amazon Lightsail.
GetRelationalDatabaseLogEvents ( array $params = [] )
Returns a list of log events for a database in Amazon Lightsail.
GetRelationalDatabaseLogStreams ( array $params = [] )
Returns a list of available log streams for a specific database in Amazon Lightsail.
GetRelationalDatabaseMasterUserPassword ( array $params = [] )
Returns the current, previous, or pending versions of the master user password for a Lightsail database.
GetRelationalDatabaseMetricData ( array $params = [] )
Returns the data points of the specified metric for a database in Amazon Lightsail.
GetRelationalDatabaseParameters ( array $params = [] )
Returns all of the runtime parameters offered by the underlying database software, or engine, for a specific database in Amazon Lightsail.
GetRelationalDatabaseSnapshot ( array $params = [] )
Returns information about a specific database snapshot in Amazon Lightsail.
GetRelationalDatabaseSnapshots ( array $params = [] )
Returns information about all of your database snapshots in Amazon Lightsail.
GetRelationalDatabases ( array $params = [] )
Returns information about all of your databases in Amazon Lightsail.
GetSetupHistory ( array $params = [] )
Returns detailed information for five of the most recent SetupInstanceHttps requests that were ran on the target instance.
GetStaticIp ( array $params = [] )
Returns information about an Amazon Lightsail static IP.
GetStaticIps ( array $params = [] )
Returns information about all static IPs in the user's account.
ImportKeyPair ( array $params = [] )
Imports a public SSH key from a specific key pair.
IsVpcPeered ( array $params = [] )
Returns a Boolean value indicating whether your Lightsail VPC is peered.
OpenInstancePublicPorts ( array $params = [] )
Opens ports for a specific Amazon Lightsail instance, and specifies the IP addresses allowed to connect to the instance through the ports, and the protocol.
PeerVpc ( array $params = [] )
Peers the Lightsail VPC with the user's default VPC.
PutAlarm ( array $params = [] )
Creates or updates an alarm, and associates it with the specified metric.
PutInstancePublicPorts ( array $params = [] )
Opens ports for a specific Amazon Lightsail instance, and specifies the IP addresses allowed to connect to the instance through the ports, and the protocol.
RebootInstance ( array $params = [] )
Restarts a specific instance.
RebootRelationalDatabase ( array $params = [] )
Restarts a specific database in Amazon Lightsail.
RegisterContainerImage ( array $params = [] )
Registers a container image to your Amazon Lightsail container service.
ReleaseStaticIp ( array $params = [] )
Deletes a specific static IP from your account.
ResetDistributionCache ( array $params = [] )
Deletes currently cached content from your Amazon Lightsail content delivery network (CDN) distribution.
SendContactMethodVerification ( array $params = [] )
Sends a verification request to an email contact method to ensure it's owned by the requester.
SetIpAddressType ( array $params = [] )
Sets the IP address type for an Amazon Lightsail resource.
SetResourceAccessForBucket ( array $params = [] )
Sets the Amazon Lightsail resources that can access the specified Lightsail bucket.
SetupInstanceHttps ( array $params = [] )
Creates an SSL/TLS certificate that secures traffic for your website.
StartGUISession ( array $params = [] )
Initiates a graphical user interface (GUI) session that’s used to access a virtual computer’s operating system and application.
StartInstance ( array $params = [] )
Starts a specific Amazon Lightsail instance from a stopped state.
StartRelationalDatabase ( array $params = [] )
Starts a specific database from a stopped state in Amazon Lightsail.
StopGUISession ( array $params = [] )
Terminates a web-based NICE DCV session that’s used to access a virtual computer’s operating system or application.
StopInstance ( array $params = [] )
Stops a specific Amazon Lightsail instance that is currently running.
StopRelationalDatabase ( array $params = [] )
Stops a specific database that is currently running in Amazon Lightsail.
TagResource ( array $params = [] )
Adds one or more tags to the specified Amazon Lightsail resource.
TestAlarm ( array $params = [] )
Tests an alarm by displaying a banner on the Amazon Lightsail console.
UnpeerVpc ( array $params = [] )
Unpeers the Lightsail VPC from the user's default VPC.
UntagResource ( array $params = [] )
Deletes the specified set of tag keys and their values from the specified Amazon Lightsail resource.
UpdateBucket ( array $params = [] )
Updates an existing Amazon Lightsail bucket.
UpdateBucketBundle ( array $params = [] )
Updates the bundle, or storage plan, of an existing Amazon Lightsail bucket.
UpdateContainerService ( array $params = [] )
Updates the configuration of your Amazon Lightsail container service, such as its power, scale, and public domain names.
UpdateDistribution ( array $params = [] )
Updates an existing Amazon Lightsail content delivery network (CDN) distribution.
UpdateDistributionBundle ( array $params = [] )
Updates the bundle of your Amazon Lightsail content delivery network (CDN) distribution.
UpdateDomainEntry ( array $params = [] )
Updates a domain recordset after it is created.
UpdateInstanceMetadataOptions ( array $params = [] )
Modifies the Amazon Lightsail instance metadata parameters on a running or stopped instance.
UpdateLoadBalancerAttribute ( array $params = [] )
Updates the specified attribute for a load balancer.
UpdateRelationalDatabase ( array $params = [] )
Allows the update of one or more attributes of a database in Amazon Lightsail.
UpdateRelationalDatabaseParameters ( array $params = [] )
Allows the update of one or more parameters of a database in Amazon Lightsail.

Operations

AllocateStaticIp

$result = $client->allocateStaticIp([/* ... */]);
$promise = $client->allocateStaticIpAsync([/* ... */]);

Allocates a static IP address.

Parameter Syntax

$result = $client->allocateStaticIp([
    'staticIpName' => '<string>', // REQUIRED
]);

Parameter Details

Members
staticIpName
Required: Yes
Type: string

The name of the static IP address.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

AttachCertificateToDistribution

$result = $client->attachCertificateToDistribution([/* ... */]);
$promise = $client->attachCertificateToDistributionAsync([/* ... */]);

Attaches an SSL/TLS certificate to your Amazon Lightsail content delivery network (CDN) distribution.

After the certificate is attached, your distribution accepts HTTPS traffic for all of the domains that are associated with the certificate.

Use the CreateCertificate action to create a certificate that you can attach to your distribution.

Only certificates created in the us-east-1 Amazon Web Services Region can be attached to Lightsail distributions. Lightsail distributions are global resources that can reference an origin in any Amazon Web Services Region, and distribute its content globally. However, all distributions are located in the us-east-1 Region.

Parameter Syntax

$result = $client->attachCertificateToDistribution([
    'certificateName' => '<string>', // REQUIRED
    'distributionName' => '<string>', // REQUIRED
]);

Parameter Details

Members
certificateName
Required: Yes
Type: string

The name of the certificate to attach to a distribution.

Only certificates with a status of ISSUED can be attached to a distribution.

Use the GetCertificates action to get a list of certificate names that you can specify.

This is the name of the certificate resource type and is used only to reference the certificate in other API actions. It can be different than the domain name of the certificate. For example, your certificate name might be WordPress-Blog-Certificate and the domain name of the certificate might be example.com.

distributionName
Required: Yes
Type: string

The name of the distribution that the certificate will be attached to.

Use the GetDistributions action to get a list of distribution names that you can specify.

Result Syntax

[
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
]

Result Details

Members
operation
Type: Operation structure

An object that describes the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

AttachDisk

$result = $client->attachDisk([/* ... */]);
$promise = $client->attachDiskAsync([/* ... */]);

Attaches a block storage disk to a running or stopped Lightsail instance and exposes it to the instance with the specified disk name.

The attach disk operation supports tag-based access control via resource tags applied to the resource identified by disk name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->attachDisk([
    'autoMounting' => true || false,
    'diskName' => '<string>', // REQUIRED
    'diskPath' => '<string>', // REQUIRED
    'instanceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
autoMounting
Type: boolean

A Boolean value used to determine the automatic mounting of a storage volume to a virtual computer. The default value is False.

This value only applies to Lightsail for Research resources.

diskName
Required: Yes
Type: string

The unique Lightsail disk name (my-disk).

diskPath
Required: Yes
Type: string

The disk path to expose to the instance (/dev/xvdf).

instanceName
Required: Yes
Type: string

The name of the Lightsail instance where you want to utilize the storage disk.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

AttachInstancesToLoadBalancer

$result = $client->attachInstancesToLoadBalancer([/* ... */]);
$promise = $client->attachInstancesToLoadBalancerAsync([/* ... */]);

Attaches one or more Lightsail instances to a load balancer.

After some time, the instances are attached to the load balancer and the health check status is available.

The attach instances to load balancer operation supports tag-based access control via resource tags applied to the resource identified by load balancer name. For more information, see the Lightsail Developer Guide.

Parameter Syntax

$result = $client->attachInstancesToLoadBalancer([
    'instanceNames' => ['<string>', ...], // REQUIRED
    'loadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
instanceNames
Required: Yes
Type: Array of strings

An array of strings representing the instance name(s) you want to attach to your load balancer.

An instance must be running before you can attach it to your load balancer.

There are no additional limits on the number of instances you can attach to your load balancer, aside from the limit of Lightsail instances you can create in your account (20).

loadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

AttachLoadBalancerTlsCertificate

$result = $client->attachLoadBalancerTlsCertificate([/* ... */]);
$promise = $client->attachLoadBalancerTlsCertificateAsync([/* ... */]);

Attaches a Transport Layer Security (TLS) certificate to your load balancer. TLS is just an updated, more secure version of Secure Socket Layer (SSL).

Once you create and validate your certificate, you can attach it to your load balancer. You can also use this API to rotate the certificates on your account. Use the AttachLoadBalancerTlsCertificate action with the non-attached certificate, and it will replace the existing one and become the attached certificate.

The AttachLoadBalancerTlsCertificate operation supports tag-based access control via resource tags applied to the resource identified by load balancer name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->attachLoadBalancerTlsCertificate([
    'certificateName' => '<string>', // REQUIRED
    'loadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
certificateName
Required: Yes
Type: string

The name of your SSL/TLS certificate.

loadBalancerName
Required: Yes
Type: string

The name of the load balancer to which you want to associate the SSL/TLS certificate.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

These SSL/TLS certificates are only usable by Lightsail load balancers. You can't get the certificate and use it for another purpose.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

AttachStaticIp

$result = $client->attachStaticIp([/* ... */]);
$promise = $client->attachStaticIpAsync([/* ... */]);

Attaches a static IP address to a specific Amazon Lightsail instance.

Parameter Syntax

$result = $client->attachStaticIp([
    'instanceName' => '<string>', // REQUIRED
    'staticIpName' => '<string>', // REQUIRED
]);

Parameter Details

Members
instanceName
Required: Yes
Type: string

The instance name to which you want to attach the static IP address.

staticIpName
Required: Yes
Type: string

The name of the static IP.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CloseInstancePublicPorts

$result = $client->closeInstancePublicPorts([/* ... */]);
$promise = $client->closeInstancePublicPortsAsync([/* ... */]);

Closes ports for a specific Amazon Lightsail instance.

The CloseInstancePublicPorts action supports tag-based access control via resource tags applied to the resource identified by instanceName. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->closeInstancePublicPorts([
    'instanceName' => '<string>', // REQUIRED
    'portInfo' => [ // REQUIRED
        'cidrListAliases' => ['<string>', ...],
        'cidrs' => ['<string>', ...],
        'fromPort' => <integer>,
        'ipv6Cidrs' => ['<string>', ...],
        'protocol' => 'tcp|all|udp|icmp|icmpv6',
        'toPort' => <integer>,
    ],
]);

Parameter Details

Members
instanceName
Required: Yes
Type: string

The name of the instance for which to close ports.

portInfo
Required: Yes
Type: PortInfo structure

An object to describe the ports to close for the specified instance.

Result Syntax

[
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
]

Result Details

Members
operation
Type: Operation structure

An object that describes the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CopySnapshot

$result = $client->copySnapshot([/* ... */]);
$promise = $client->copySnapshotAsync([/* ... */]);

Copies a manual snapshot of an instance or disk as another manual snapshot, or copies an automatic snapshot of an instance or disk as a manual snapshot. This operation can also be used to copy a manual or automatic snapshot of an instance or a disk from one Amazon Web Services Region to another in Amazon Lightsail.

When copying a manual snapshot, be sure to define the source region, source snapshot name, and target snapshot name parameters.

When copying an automatic snapshot, be sure to define the source region, source resource name, target snapshot name, and either the restore date or the use latest restorable auto snapshot parameters.

Parameter Syntax

$result = $client->copySnapshot([
    'restoreDate' => '<string>',
    'sourceRegion' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1', // REQUIRED
    'sourceResourceName' => '<string>',
    'sourceSnapshotName' => '<string>',
    'targetSnapshotName' => '<string>', // REQUIRED
    'useLatestRestorableAutoSnapshot' => true || false,
]);

Parameter Details

Members
restoreDate
Type: string

The date of the source automatic snapshot to copy. Use the get auto snapshots operation to identify the dates of the available automatic snapshots.

Constraints:

  • Must be specified in YYYY-MM-DD format.

  • This parameter cannot be defined together with the use latest restorable auto snapshot parameter. The restore date and use latest restorable auto snapshot parameters are mutually exclusive.

  • Define this parameter only when copying an automatic snapshot as a manual snapshot. For more information, see the Amazon Lightsail Developer Guide.

sourceRegion
Required: Yes
Type: string

The Amazon Web Services Region where the source manual or automatic snapshot is located.

sourceResourceName
Type: string

The name of the source instance or disk from which the source automatic snapshot was created.

Constraint:

sourceSnapshotName
Type: string

The name of the source manual snapshot to copy.

Constraint:

  • Define this parameter only when copying a manual snapshot as another manual snapshot.

targetSnapshotName
Required: Yes
Type: string

The name of the new manual snapshot to be created as a copy.

useLatestRestorableAutoSnapshot
Type: boolean

A Boolean value to indicate whether to use the latest available automatic snapshot of the specified source instance or disk.

Constraints:

  • This parameter cannot be defined together with the restore date parameter. The use latest restorable auto snapshot and restore date parameters are mutually exclusive.

  • Define this parameter only when copying an automatic snapshot as a manual snapshot. For more information, see the Amazon Lightsail Developer Guide.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateBucket

$result = $client->createBucket([/* ... */]);
$promise = $client->createBucketAsync([/* ... */]);

Creates an Amazon Lightsail bucket.

A bucket is a cloud storage resource available in the Lightsail object storage service. Use buckets to store objects such as data and its descriptive metadata. For more information about buckets, see Buckets in Amazon Lightsail in the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createBucket([
    'bucketName' => '<string>', // REQUIRED
    'bundleId' => '<string>', // REQUIRED
    'enableObjectVersioning' => true || false,
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
bucketName
Required: Yes
Type: string

The name for the bucket.

For more information about bucket names, see Bucket naming rules in Amazon Lightsail in the Amazon Lightsail Developer Guide.

bundleId
Required: Yes
Type: string

The ID of the bundle to use for the bucket.

A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket.

Use the GetBucketBundles action to get a list of bundle IDs that you can specify.

Use the UpdateBucketBundle action to change the bundle after the bucket is created.

enableObjectVersioning
Type: boolean

A Boolean value that indicates whether to enable versioning of objects in the bucket.

For more information about versioning, see Enabling and suspending object versioning in a bucket in Amazon Lightsail in the Amazon Lightsail Developer Guide.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the bucket during creation.

Use the TagResource action to tag the bucket after it's created.

Result Syntax

[
    'bucket' => [
        'ableToUpdateBundle' => true || false,
        'accessLogConfig' => [
            'destination' => '<string>',
            'enabled' => true || false,
            'prefix' => '<string>',
        ],
        'accessRules' => [
            'allowPublicOverrides' => true || false,
            'getObject' => 'public|private',
        ],
        'arn' => '<string>',
        'bundleId' => '<string>',
        'createdAt' => <DateTime>,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'name' => '<string>',
        'objectVersioning' => '<string>',
        'readonlyAccessAccounts' => ['<string>', ...],
        'resourceType' => '<string>',
        'resourcesReceivingAccess' => [
            [
                'name' => '<string>',
                'resourceType' => '<string>',
            ],
            // ...
        ],
        'state' => [
            'code' => '<string>',
            'message' => '<string>',
        ],
        'supportCode' => '<string>',
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
        'url' => '<string>',
    ],
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
bucket
Type: Bucket structure

An object that describes the bucket that is created.

operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

ServiceException:

A general service exception.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateBucketAccessKey

$result = $client->createBucketAccessKey([/* ... */]);
$promise = $client->createBucketAccessKeyAsync([/* ... */]);

Creates a new access key for the specified Amazon Lightsail bucket. Access keys consist of an access key ID and corresponding secret access key.

Access keys grant full programmatic access to the specified bucket and its objects. You can have a maximum of two access keys per bucket. Use the GetBucketAccessKeys action to get a list of current access keys for a specific bucket. For more information about access keys, see Creating access keys for a bucket in Amazon Lightsail in the Amazon Lightsail Developer Guide.

The secretAccessKey value is returned only in response to the CreateBucketAccessKey action. You can get a secret access key only when you first create an access key; you cannot get the secret access key later. If you lose the secret access key, you must create a new access key.

Parameter Syntax

$result = $client->createBucketAccessKey([
    'bucketName' => '<string>', // REQUIRED
]);

Parameter Details

Members
bucketName
Required: Yes
Type: string

The name of the bucket that the new access key will belong to, and grant access to.

Result Syntax

[
    'accessKey' => [
        'accessKeyId' => '<string>',
        'createdAt' => <DateTime>,
        'lastUsed' => [
            'lastUsedDate' => <DateTime>,
            'region' => '<string>',
            'serviceName' => '<string>',
        ],
        'secretAccessKey' => '<string>',
        'status' => 'Active|Inactive',
    ],
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
accessKey
Type: AccessKey structure

An object that describes the access key that is created.

operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

ServiceException:

A general service exception.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateCertificate

$result = $client->createCertificate([/* ... */]);
$promise = $client->createCertificateAsync([/* ... */]);

Creates an SSL/TLS certificate for an Amazon Lightsail content delivery network (CDN) distribution and a container service.

After the certificate is valid, use the AttachCertificateToDistribution action to use the certificate and its domains with your distribution. Or use the UpdateContainerService action to use the certificate and its domains with your container service.

Only certificates created in the us-east-1 Amazon Web Services Region can be attached to Lightsail distributions. Lightsail distributions are global resources that can reference an origin in any Amazon Web Services Region, and distribute its content globally. However, all distributions are located in the us-east-1 Region.

Parameter Syntax

$result = $client->createCertificate([
    'certificateName' => '<string>', // REQUIRED
    'domainName' => '<string>', // REQUIRED
    'subjectAlternativeNames' => ['<string>', ...],
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
certificateName
Required: Yes
Type: string

The name for the certificate.

domainName
Required: Yes
Type: string

The domain name (example.com) for the certificate.

subjectAlternativeNames
Type: Array of strings

An array of strings that specify the alternate domains (example2.com) and subdomains (blog.example.com) for the certificate.

You can specify a maximum of nine alternate domains (in addition to the primary domain name).

Wildcard domain entries (*.example.com) are not supported.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the certificate during create.

Use the TagResource action to tag a resource after it's created.

Result Syntax

[
    'certificate' => [
        'certificateArn' => '<string>',
        'certificateDetail' => [
            'arn' => '<string>',
            'createdAt' => <DateTime>,
            'domainName' => '<string>',
            'domainValidationRecords' => [
                [
                    'dnsRecordCreationState' => [
                        'code' => 'SUCCEEDED|STARTED|FAILED',
                        'message' => '<string>',
                    ],
                    'domainName' => '<string>',
                    'resourceRecord' => [
                        'name' => '<string>',
                        'type' => '<string>',
                        'value' => '<string>',
                    ],
                    'validationStatus' => 'PENDING_VALIDATION|FAILED|SUCCESS',
                ],
                // ...
            ],
            'eligibleToRenew' => '<string>',
            'inUseResourceCount' => <integer>,
            'issuedAt' => <DateTime>,
            'issuerCA' => '<string>',
            'keyAlgorithm' => '<string>',
            'name' => '<string>',
            'notAfter' => <DateTime>,
            'notBefore' => <DateTime>,
            'renewalSummary' => [
                'domainValidationRecords' => [
                    [
                        'dnsRecordCreationState' => [
                            'code' => 'SUCCEEDED|STARTED|FAILED',
                            'message' => '<string>',
                        ],
                        'domainName' => '<string>',
                        'resourceRecord' => [
                            'name' => '<string>',
                            'type' => '<string>',
                            'value' => '<string>',
                        ],
                        'validationStatus' => 'PENDING_VALIDATION|FAILED|SUCCESS',
                    ],
                    // ...
                ],
                'renewalStatus' => 'PendingAutoRenewal|PendingValidation|Success|Failed',
                'renewalStatusReason' => '<string>',
                'updatedAt' => <DateTime>,
            ],
            'requestFailureReason' => '<string>',
            'revocationReason' => '<string>',
            'revokedAt' => <DateTime>,
            'serialNumber' => '<string>',
            'status' => 'PENDING_VALIDATION|ISSUED|INACTIVE|EXPIRED|VALIDATION_TIMED_OUT|REVOKED|FAILED',
            'subjectAlternativeNames' => ['<string>', ...],
            'supportCode' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
        ],
        'certificateName' => '<string>',
        'domainName' => '<string>',
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
    ],
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
certificate
Type: CertificateSummary structure

An object that describes the certificate created.

operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateCloudFormationStack

$result = $client->createCloudFormationStack([/* ... */]);
$promise = $client->createCloudFormationStackAsync([/* ... */]);

Creates an AWS CloudFormation stack, which creates a new Amazon EC2 instance from an exported Amazon Lightsail snapshot. This operation results in a CloudFormation stack record that can be used to track the AWS CloudFormation stack created. Use the get cloud formation stack records operation to get a list of the CloudFormation stacks created.

Wait until after your new Amazon EC2 instance is created before running the create cloud formation stack operation again with the same export snapshot record.

Parameter Syntax

$result = $client->createCloudFormationStack([
    'instances' => [ // REQUIRED
        [
            'availabilityZone' => '<string>', // REQUIRED
            'instanceType' => '<string>', // REQUIRED
            'portInfoSource' => 'DEFAULT|INSTANCE|NONE|CLOSED', // REQUIRED
            'sourceName' => '<string>', // REQUIRED
            'userData' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
instances
Required: Yes
Type: Array of InstanceEntry structures

An array of parameters that will be used to create the new Amazon EC2 instance. You can only pass one instance entry at a time in this array. You will get an invalid parameter error if you pass more than one instance entry in this array.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateContactMethod

$result = $client->createContactMethod([/* ... */]);
$promise = $client->createContactMethodAsync([/* ... */]);

Creates an email or SMS text message contact method.

A contact method is used to send you notifications about your Amazon Lightsail resources. You can add one email address and one mobile phone number contact method in each Amazon Web Services Region. However, SMS text messaging is not supported in some Amazon Web Services Regions, and SMS text messages cannot be sent to some countries/regions. For more information, see Notifications in Amazon Lightsail.

Parameter Syntax

$result = $client->createContactMethod([
    'contactEndpoint' => '<string>', // REQUIRED
    'protocol' => 'Email|SMS', // REQUIRED
]);

Parameter Details

Members
contactEndpoint
Required: Yes
Type: string

The destination of the contact method, such as an email address or a mobile phone number.

Use the E.164 format when specifying a mobile phone number. E.164 is a standard for the phone number structure used for international telecommunication. Phone numbers that follow this format can have a maximum of 15 digits, and they are prefixed with the plus character (+) and the country code. For example, a U.S. phone number in E.164 format would be specified as +1XXX5550100. For more information, see E.164 on Wikipedia.

protocol
Required: Yes
Type: string

The protocol of the contact method, such as Email or SMS (text messaging).

The SMS protocol is supported only in the following Amazon Web Services Regions.

  • US East (N. Virginia) (us-east-1)

  • US West (Oregon) (us-west-2)

  • Europe (Ireland) (eu-west-1)

  • Asia Pacific (Tokyo) (ap-northeast-1)

  • Asia Pacific (Singapore) (ap-southeast-1)

  • Asia Pacific (Sydney) (ap-southeast-2)

For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services Regions where SMS text messaging is supported, see Supported Regions and Countries in the Amazon SNS Developer Guide.

For more information about notifications in Amazon Lightsail, see Notifications in Amazon Lightsail.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateContainerService

$result = $client->createContainerService([/* ... */]);
$promise = $client->createContainerServiceAsync([/* ... */]);

Creates an Amazon Lightsail container service.

A Lightsail container service is a compute resource to which you can deploy containers. For more information, see Container services in Amazon Lightsail in the Lightsail Dev Guide.

Parameter Syntax

$result = $client->createContainerService([
    'deployment' => [
        'containers' => [
            '<ContainerName>' => [
                'command' => ['<string>', ...],
                'environment' => ['<string>', ...],
                'image' => '<string>',
                'ports' => ['<string>', ...],
            ],
            // ...
        ],
        'publicEndpoint' => [
            'containerName' => '<string>', // REQUIRED
            'containerPort' => <integer>, // REQUIRED
            'healthCheck' => [
                'healthyThreshold' => <integer>,
                'intervalSeconds' => <integer>,
                'path' => '<string>',
                'successCodes' => '<string>',
                'timeoutSeconds' => <integer>,
                'unhealthyThreshold' => <integer>,
            ],
        ],
    ],
    'power' => 'nano|micro|small|medium|large|xlarge', // REQUIRED
    'privateRegistryAccess' => [
        'ecrImagePullerRole' => [
            'isActive' => true || false,
        ],
    ],
    'publicDomainNames' => [
        '<string>' => ['<string>', ...],
        // ...
    ],
    'scale' => <integer>, // REQUIRED
    'serviceName' => '<string>', // REQUIRED
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
deployment

An object that describes a deployment for the container service.

A deployment specifies the containers that will be launched on the container service and their settings, such as the ports to open, the environment variables to apply, and the launch command to run. It also specifies the container that will serve as the public endpoint of the deployment and its settings, such as the HTTP or HTTPS port to use, and the health check configuration.

power
Required: Yes
Type: string

The power specification for the container service.

The power specifies the amount of memory, vCPUs, and base monthly cost of each node of the container service. The power and scale of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the power with the scale (the number of nodes) of the service.

Use the GetContainerServicePowers action to get a list of power options that you can specify using this parameter, and their base monthly cost.

privateRegistryAccess

An object to describe the configuration for the container service to access private container image repositories, such as Amazon Elastic Container Registry (Amazon ECR) private repositories.

For more information, see Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service in the Amazon Lightsail Developer Guide.

publicDomainNames
Type: Associative array of custom strings keys (string) to stringss

The public domain names to use with the container service, such as example.com and www.example.com.

You can specify up to four public domain names for a container service. The domain names that you specify are used when you create a deployment with a container configured as the public endpoint of your container service.

If you don't specify public domain names, then you can use the default domain of the container service.

You must create and validate an SSL/TLS certificate before you can use public domain names with your container service. Use the CreateCertificate action to create a certificate for the public domain names you want to use with your container service.

You can specify public domain names using a string to array map as shown in the example later on this page.

scale
Required: Yes
Type: int

The scale specification for the container service.

The scale specifies the allocated compute nodes of the container service. The power and scale of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the power with the scale (the number of nodes) of the service.

serviceName
Required: Yes
Type: string

The name for the container service.

The name that you specify for your container service will make up part of its default domain. The default domain of a container service is typically https://<ServiceName>.<RandomGUID>.<AWSRegion>.cs.amazonlightsail.com. If the name of your container service is container-service-1, and it's located in the US East (Ohio) Amazon Web Services Region (us-east-2), then the domain for your container service will be like the following example: https://container-service-1.ur4EXAMPLE2uq.us-east-2.cs.amazonlightsail.com

The following are the requirements for container service names:

  • Must be unique within each Amazon Web Services Region in your Lightsail account.

  • Must contain 1 to 63 characters.

  • Must contain only alphanumeric characters and hyphens.

  • A hyphen (-) can separate words but cannot be at the start or end of the name.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the container service during create.

Use the TagResource action to tag a resource after it's created.

For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.

Result Syntax

[
    'containerService' => [
        'arn' => '<string>',
        'containerServiceName' => '<string>',
        'createdAt' => <DateTime>,
        'currentDeployment' => [
            'containers' => [
                '<ContainerName>' => [
                    'command' => ['<string>', ...],
                    'environment' => ['<string>', ...],
                    'image' => '<string>',
                    'ports' => ['<string>', ...],
                ],
                // ...
            ],
            'createdAt' => <DateTime>,
            'publicEndpoint' => [
                'containerName' => '<string>',
                'containerPort' => <integer>,
                'healthCheck' => [
                    'healthyThreshold' => <integer>,
                    'intervalSeconds' => <integer>,
                    'path' => '<string>',
                    'successCodes' => '<string>',
                    'timeoutSeconds' => <integer>,
                    'unhealthyThreshold' => <integer>,
                ],
            ],
            'state' => 'ACTIVATING|ACTIVE|INACTIVE|FAILED',
            'version' => <integer>,
        ],
        'isDisabled' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'nextDeployment' => [
            'containers' => [
                '<ContainerName>' => [
                    'command' => ['<string>', ...],
                    'environment' => ['<string>', ...],
                    'image' => '<string>',
                    'ports' => ['<string>', ...],
                ],
                // ...
            ],
            'createdAt' => <DateTime>,
            'publicEndpoint' => [
                'containerName' => '<string>',
                'containerPort' => <integer>,
                'healthCheck' => [
                    'healthyThreshold' => <integer>,
                    'intervalSeconds' => <integer>,
                    'path' => '<string>',
                    'successCodes' => '<string>',
                    'timeoutSeconds' => <integer>,
                    'unhealthyThreshold' => <integer>,
                ],
            ],
            'state' => 'ACTIVATING|ACTIVE|INACTIVE|FAILED',
            'version' => <integer>,
        ],
        'power' => 'nano|micro|small|medium|large|xlarge',
        'powerId' => '<string>',
        'principalArn' => '<string>',
        'privateDomainName' => '<string>',
        'privateRegistryAccess' => [
            'ecrImagePullerRole' => [
                'isActive' => true || false,
                'principalArn' => '<string>',
            ],
        ],
        'publicDomainNames' => [
            '<string>' => ['<string>', ...],
            // ...
        ],
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'scale' => <integer>,
        'state' => 'PENDING|READY|RUNNING|UPDATING|DELETING|DISABLED|DEPLOYING',
        'stateDetail' => [
            'code' => 'CREATING_SYSTEM_RESOURCES|CREATING_NETWORK_INFRASTRUCTURE|PROVISIONING_CERTIFICATE|PROVISIONING_SERVICE|CREATING_DEPLOYMENT|EVALUATING_HEALTH_CHECK|ACTIVATING_DEPLOYMENT|CERTIFICATE_LIMIT_EXCEEDED|UNKNOWN_ERROR',
            'message' => '<string>',
        ],
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
        'url' => '<string>',
    ],
]

Result Details

Members
containerService
Type: ContainerService structure

An object that describes a container service.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateContainerServiceDeployment

$result = $client->createContainerServiceDeployment([/* ... */]);
$promise = $client->createContainerServiceDeploymentAsync([/* ... */]);

Creates a deployment for your Amazon Lightsail container service.

A deployment specifies the containers that will be launched on the container service and their settings, such as the ports to open, the environment variables to apply, and the launch command to run. It also specifies the container that will serve as the public endpoint of the deployment and its settings, such as the HTTP or HTTPS port to use, and the health check configuration.

You can deploy containers to your container service using container images from a public registry such as Amazon ECR Public, or from your local machine. For more information, see Creating container images for your Amazon Lightsail container services in the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createContainerServiceDeployment([
    'containers' => [
        '<ContainerName>' => [
            'command' => ['<string>', ...],
            'environment' => ['<string>', ...],
            'image' => '<string>',
            'ports' => ['<string>', ...],
        ],
        // ...
    ],
    'publicEndpoint' => [
        'containerName' => '<string>', // REQUIRED
        'containerPort' => <integer>, // REQUIRED
        'healthCheck' => [
            'healthyThreshold' => <integer>,
            'intervalSeconds' => <integer>,
            'path' => '<string>',
            'successCodes' => '<string>',
            'timeoutSeconds' => <integer>,
            'unhealthyThreshold' => <integer>,
        ],
    ],
    'serviceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
containers
Type: Associative array of custom strings keys (ContainerName) to Container structures

An object that describes the settings of the containers that will be launched on the container service.

publicEndpoint
Type: EndpointRequest structure

An object that describes the settings of the public endpoint for the container service.

serviceName
Required: Yes
Type: string

The name of the container service for which to create the deployment.

Result Syntax

[
    'containerService' => [
        'arn' => '<string>',
        'containerServiceName' => '<string>',
        'createdAt' => <DateTime>,
        'currentDeployment' => [
            'containers' => [
                '<ContainerName>' => [
                    'command' => ['<string>', ...],
                    'environment' => ['<string>', ...],
                    'image' => '<string>',
                    'ports' => ['<string>', ...],
                ],
                // ...
            ],
            'createdAt' => <DateTime>,
            'publicEndpoint' => [
                'containerName' => '<string>',
                'containerPort' => <integer>,
                'healthCheck' => [
                    'healthyThreshold' => <integer>,
                    'intervalSeconds' => <integer>,
                    'path' => '<string>',
                    'successCodes' => '<string>',
                    'timeoutSeconds' => <integer>,
                    'unhealthyThreshold' => <integer>,
                ],
            ],
            'state' => 'ACTIVATING|ACTIVE|INACTIVE|FAILED',
            'version' => <integer>,
        ],
        'isDisabled' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'nextDeployment' => [
            'containers' => [
                '<ContainerName>' => [
                    'command' => ['<string>', ...],
                    'environment' => ['<string>', ...],
                    'image' => '<string>',
                    'ports' => ['<string>', ...],
                ],
                // ...
            ],
            'createdAt' => <DateTime>,
            'publicEndpoint' => [
                'containerName' => '<string>',
                'containerPort' => <integer>,
                'healthCheck' => [
                    'healthyThreshold' => <integer>,
                    'intervalSeconds' => <integer>,
                    'path' => '<string>',
                    'successCodes' => '<string>',
                    'timeoutSeconds' => <integer>,
                    'unhealthyThreshold' => <integer>,
                ],
            ],
            'state' => 'ACTIVATING|ACTIVE|INACTIVE|FAILED',
            'version' => <integer>,
        ],
        'power' => 'nano|micro|small|medium|large|xlarge',
        'powerId' => '<string>',
        'principalArn' => '<string>',
        'privateDomainName' => '<string>',
        'privateRegistryAccess' => [
            'ecrImagePullerRole' => [
                'isActive' => true || false,
                'principalArn' => '<string>',
            ],
        ],
        'publicDomainNames' => [
            '<string>' => ['<string>', ...],
            // ...
        ],
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'scale' => <integer>,
        'state' => 'PENDING|READY|RUNNING|UPDATING|DELETING|DISABLED|DEPLOYING',
        'stateDetail' => [
            'code' => 'CREATING_SYSTEM_RESOURCES|CREATING_NETWORK_INFRASTRUCTURE|PROVISIONING_CERTIFICATE|PROVISIONING_SERVICE|CREATING_DEPLOYMENT|EVALUATING_HEALTH_CHECK|ACTIVATING_DEPLOYMENT|CERTIFICATE_LIMIT_EXCEEDED|UNKNOWN_ERROR',
            'message' => '<string>',
        ],
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
        'url' => '<string>',
    ],
]

Result Details

Members
containerService
Type: ContainerService structure

An object that describes a container service.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateContainerServiceRegistryLogin

$result = $client->createContainerServiceRegistryLogin([/* ... */]);
$promise = $client->createContainerServiceRegistryLoginAsync([/* ... */]);

Creates a temporary set of log in credentials that you can use to log in to the Docker process on your local machine. After you're logged in, you can use the native Docker commands to push your local container images to the container image registry of your Amazon Lightsail account so that you can use them with your Lightsail container service. The log in credentials expire 12 hours after they are created, at which point you will need to create a new set of log in credentials.

You can only push container images to the container service registry of your Lightsail account. You cannot pull container images or perform any other container image management actions on the container service registry.

After you push your container images to the container image registry of your Lightsail account, use the RegisterContainerImage action to register the pushed images to a specific Lightsail container service.

This action is not required if you install and use the Lightsail Control (lightsailctl) plugin to push container images to your Lightsail container service. For more information, see Pushing and managing container images on your Amazon Lightsail container services in the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createContainerServiceRegistryLogin([
]);

Parameter Details

Members

Result Syntax

[
    'registryLogin' => [
        'expiresAt' => <DateTime>,
        'password' => '<string>',
        'registry' => '<string>',
        'username' => '<string>',
    ],
]

Result Details

Members
registryLogin

An object that describes the log in information for the container service registry of your Lightsail account.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateDisk

$result = $client->createDisk([/* ... */]);
$promise = $client->createDiskAsync([/* ... */]);

Creates a block storage disk that can be attached to an Amazon Lightsail instance in the same Availability Zone (us-east-2a).

The create disk operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createDisk([
    'addOns' => [
        [
            'addOnType' => 'AutoSnapshot|StopInstanceOnIdle', // REQUIRED
            'autoSnapshotAddOnRequest' => [
                'snapshotTimeOfDay' => '<string>',
            ],
            'stopInstanceOnIdleRequest' => [
                'duration' => '<string>',
                'threshold' => '<string>',
            ],
        ],
        // ...
    ],
    'availabilityZone' => '<string>', // REQUIRED
    'diskName' => '<string>', // REQUIRED
    'sizeInGb' => <integer>, // REQUIRED
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
addOns
Type: Array of AddOnRequest structures

An array of objects that represent the add-ons to enable for the new disk.

availabilityZone
Required: Yes
Type: string

The Availability Zone where you want to create the disk (us-east-2a). Use the same Availability Zone as the Lightsail instance to which you want to attach the disk.

Use the get regions operation to list the Availability Zones where Lightsail is currently available.

diskName
Required: Yes
Type: string

The unique Lightsail disk name (my-disk).

sizeInGb
Required: Yes
Type: int

The size of the disk in GB (32).

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateDiskFromSnapshot

$result = $client->createDiskFromSnapshot([/* ... */]);
$promise = $client->createDiskFromSnapshotAsync([/* ... */]);

Creates a block storage disk from a manual or automatic snapshot of a disk. The resulting disk can be attached to an Amazon Lightsail instance in the same Availability Zone (us-east-2a).

The create disk from snapshot operation supports tag-based access control via request tags and resource tags applied to the resource identified by disk snapshot name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createDiskFromSnapshot([
    'addOns' => [
        [
            'addOnType' => 'AutoSnapshot|StopInstanceOnIdle', // REQUIRED
            'autoSnapshotAddOnRequest' => [
                'snapshotTimeOfDay' => '<string>',
            ],
            'stopInstanceOnIdleRequest' => [
                'duration' => '<string>',
                'threshold' => '<string>',
            ],
        ],
        // ...
    ],
    'availabilityZone' => '<string>', // REQUIRED
    'diskName' => '<string>', // REQUIRED
    'diskSnapshotName' => '<string>',
    'restoreDate' => '<string>',
    'sizeInGb' => <integer>, // REQUIRED
    'sourceDiskName' => '<string>',
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
    'useLatestRestorableAutoSnapshot' => true || false,
]);

Parameter Details

Members
addOns
Type: Array of AddOnRequest structures

An array of objects that represent the add-ons to enable for the new disk.

availabilityZone
Required: Yes
Type: string

The Availability Zone where you want to create the disk (us-east-2a). Choose the same Availability Zone as the Lightsail instance where you want to create the disk.

Use the GetRegions operation to list the Availability Zones where Lightsail is currently available.

diskName
Required: Yes
Type: string

The unique Lightsail disk name (my-disk).

diskSnapshotName
Type: string

The name of the disk snapshot (my-snapshot) from which to create the new storage disk.

Constraint:

  • This parameter cannot be defined together with the source disk name parameter. The disk snapshot name and source disk name parameters are mutually exclusive.

restoreDate
Type: string

The date of the automatic snapshot to use for the new disk. Use the get auto snapshots operation to identify the dates of the available automatic snapshots.

Constraints:

  • Must be specified in YYYY-MM-DD format.

  • This parameter cannot be defined together with the use latest restorable auto snapshot parameter. The restore date and use latest restorable auto snapshot parameters are mutually exclusive.

  • Define this parameter only when creating a new disk from an automatic snapshot. For more information, see the Amazon Lightsail Developer Guide.

sizeInGb
Required: Yes
Type: int

The size of the disk in GB (32).

sourceDiskName
Type: string

The name of the source disk from which the source automatic snapshot was created.

Constraints:

  • This parameter cannot be defined together with the disk snapshot name parameter. The source disk name and disk snapshot name parameters are mutually exclusive.

  • Define this parameter only when creating a new disk from an automatic snapshot. For more information, see the Amazon Lightsail Developer Guide.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

useLatestRestorableAutoSnapshot
Type: boolean

A Boolean value to indicate whether to use the latest available automatic snapshot.

Constraints:

  • This parameter cannot be defined together with the restore date parameter. The use latest restorable auto snapshot and restore date parameters are mutually exclusive.

  • Define this parameter only when creating a new disk from an automatic snapshot. For more information, see the Amazon Lightsail Developer Guide.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateDiskSnapshot

$result = $client->createDiskSnapshot([/* ... */]);
$promise = $client->createDiskSnapshotAsync([/* ... */]);

Creates a snapshot of a block storage disk. You can use snapshots for backups, to make copies of disks, and to save data before shutting down a Lightsail instance.

You can take a snapshot of an attached disk that is in use; however, snapshots only capture data that has been written to your disk at the time the snapshot command is issued. This may exclude any data that has been cached by any applications or the operating system. If you can pause any file systems on the disk long enough to take a snapshot, your snapshot should be complete. Nevertheless, if you cannot pause all file writes to the disk, you should unmount the disk from within the Lightsail instance, issue the create disk snapshot command, and then remount the disk to ensure a consistent and complete snapshot. You may remount and use your disk while the snapshot status is pending.

You can also use this operation to create a snapshot of an instance's system volume. You might want to do this, for example, to recover data from the system volume of a botched instance or to create a backup of the system volume like you would for a block storage disk. To create a snapshot of a system volume, just define the instance name parameter when issuing the snapshot command, and a snapshot of the defined instance's system volume will be created. After the snapshot is available, you can create a block storage disk from the snapshot and attach it to a running instance to access the data on the disk.

The create disk snapshot operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createDiskSnapshot([
    'diskName' => '<string>',
    'diskSnapshotName' => '<string>', // REQUIRED
    'instanceName' => '<string>',
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
diskName
Type: string

The unique name of the source disk (Disk-Virginia-1).

This parameter cannot be defined together with the instance name parameter. The disk name and instance name parameters are mutually exclusive.

diskSnapshotName
Required: Yes
Type: string

The name of the destination disk snapshot (my-disk-snapshot) based on the source disk.

instanceName
Type: string

The unique name of the source instance (Amazon_Linux-512MB-Virginia-1). When this is defined, a snapshot of the instance's system volume is created.

This parameter cannot be defined together with the disk name parameter. The instance name and disk name parameters are mutually exclusive.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateDistribution

$result = $client->createDistribution([/* ... */]);
$promise = $client->createDistributionAsync([/* ... */]);

Creates an Amazon Lightsail content delivery network (CDN) distribution.

A distribution is a globally distributed network of caching servers that improve the performance of your website or web application hosted on a Lightsail instance. For more information, see Content delivery networks in Amazon Lightsail.

Parameter Syntax

$result = $client->createDistribution([
    'bundleId' => '<string>', // REQUIRED
    'cacheBehaviorSettings' => [
        'allowedHTTPMethods' => '<string>',
        'cachedHTTPMethods' => '<string>',
        'defaultTTL' => <integer>,
        'forwardedCookies' => [
            'cookiesAllowList' => ['<string>', ...],
            'option' => 'none|allow-list|all',
        ],
        'forwardedHeaders' => [
            'headersAllowList' => ['<string>', ...],
            'option' => 'none|allow-list|all',
        ],
        'forwardedQueryStrings' => [
            'option' => true || false,
            'queryStringsAllowList' => ['<string>', ...],
        ],
        'maximumTTL' => <integer>,
        'minimumTTL' => <integer>,
    ],
    'cacheBehaviors' => [
        [
            'behavior' => 'dont-cache|cache',
            'path' => '<string>',
        ],
        // ...
    ],
    'certificateName' => '<string>',
    'defaultCacheBehavior' => [ // REQUIRED
        'behavior' => 'dont-cache|cache',
    ],
    'distributionName' => '<string>', // REQUIRED
    'ipAddressType' => 'dualstack|ipv4|ipv6',
    'origin' => [ // REQUIRED
        'name' => '<string>',
        'protocolPolicy' => 'http-only|https-only',
        'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        'responseTimeout' => <integer>,
    ],
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
    'viewerMinimumTlsProtocolVersion' => 'TLSv1.1_2016|TLSv1.2_2018|TLSv1.2_2019|TLSv1.2_2021',
]);

Parameter Details

Members
bundleId
Required: Yes
Type: string

The bundle ID to use for the distribution.

A distribution bundle describes the specifications of your distribution, such as the monthly cost and monthly network transfer quota.

Use the GetDistributionBundles action to get a list of distribution bundle IDs that you can specify.

cacheBehaviorSettings
Type: CacheSettings structure

An object that describes the cache behavior settings for the distribution.

cacheBehaviors
Type: Array of CacheBehaviorPerPath structures

An array of objects that describe the per-path cache behavior for the distribution.

certificateName
Type: string

The name of the SSL/TLS certificate that you want to attach to the distribution.

Use the GetCertificates action to get a list of certificate names that you can specify.

defaultCacheBehavior
Required: Yes
Type: CacheBehavior structure

An object that describes the default cache behavior for the distribution.

distributionName
Required: Yes
Type: string

The name for the distribution.

ipAddressType
Type: string

The IP address type for the distribution.

The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6.

The default value is dualstack.

origin
Required: Yes
Type: InputOrigin structure

An object that describes the origin resource for the distribution, such as a Lightsail instance, bucket, or load balancer.

The distribution pulls, caches, and serves content from the origin.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the distribution during create.

Use the TagResource action to tag a resource after it's created.

viewerMinimumTlsProtocolVersion
Type: string

The minimum TLS protocol version for the SSL/TLS certificate.

Result Syntax

[
    'distribution' => [
        'ableToUpdateBundle' => true || false,
        'alternativeDomainNames' => ['<string>', ...],
        'arn' => '<string>',
        'bundleId' => '<string>',
        'cacheBehaviorSettings' => [
            'allowedHTTPMethods' => '<string>',
            'cachedHTTPMethods' => '<string>',
            'defaultTTL' => <integer>,
            'forwardedCookies' => [
                'cookiesAllowList' => ['<string>', ...],
                'option' => 'none|allow-list|all',
            ],
            'forwardedHeaders' => [
                'headersAllowList' => ['<string>', ...],
                'option' => 'none|allow-list|all',
            ],
            'forwardedQueryStrings' => [
                'option' => true || false,
                'queryStringsAllowList' => ['<string>', ...],
            ],
            'maximumTTL' => <integer>,
            'minimumTTL' => <integer>,
        ],
        'cacheBehaviors' => [
            [
                'behavior' => 'dont-cache|cache',
                'path' => '<string>',
            ],
            // ...
        ],
        'certificateName' => '<string>',
        'createdAt' => <DateTime>,
        'defaultCacheBehavior' => [
            'behavior' => 'dont-cache|cache',
        ],
        'domainName' => '<string>',
        'ipAddressType' => 'dualstack|ipv4|ipv6',
        'isEnabled' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'name' => '<string>',
        'origin' => [
            'name' => '<string>',
            'protocolPolicy' => 'http-only|https-only',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'responseTimeout' => <integer>,
        ],
        'originPublicDNS' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => '<string>',
        'supportCode' => '<string>',
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
        'viewerMinimumTlsProtocolVersion' => '<string>',
    ],
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
]

Result Details

Members
distribution
Type: LightsailDistribution structure

An object that describes the distribution created.

operation
Type: Operation structure

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateDomain

$result = $client->createDomain([/* ... */]);
$promise = $client->createDomainAsync([/* ... */]);

Creates a domain resource for the specified domain (example.com).

The create domain operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createDomain([
    'domainName' => '<string>', // REQUIRED
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
domainName
Required: Yes
Type: string

The domain name to manage (example.com).

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

Result Syntax

[
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
]

Result Details

Members
operation
Type: Operation structure

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateDomainEntry

$result = $client->createDomainEntry([/* ... */]);
$promise = $client->createDomainEntryAsync([/* ... */]);

Creates one of the following domain name system (DNS) records in a domain DNS zone: Address (A), canonical name (CNAME), mail exchanger (MX), name server (NS), start of authority (SOA), service locator (SRV), or text (TXT).

The create domain entry operation supports tag-based access control via resource tags applied to the resource identified by domain name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createDomainEntry([
    'domainEntry' => [ // REQUIRED
        'id' => '<string>',
        'isAlias' => true || false,
        'name' => '<string>',
        'options' => ['<string>', ...],
        'target' => '<string>',
        'type' => '<string>',
    ],
    'domainName' => '<string>', // REQUIRED
]);

Parameter Details

Members
domainEntry
Required: Yes
Type: DomainEntry structure

An array of key-value pairs containing information about the domain entry request.

domainName
Required: Yes
Type: string

The domain name (example.com) for which you want to create the domain entry.

Result Syntax

[
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
]

Result Details

Members
operation
Type: Operation structure

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateGUISessionAccessDetails

$result = $client->createGUISessionAccessDetails([/* ... */]);
$promise = $client->createGUISessionAccessDetailsAsync([/* ... */]);

Creates two URLs that are used to access a virtual computer’s graphical user interface (GUI) session. The primary URL initiates a web-based NICE DCV session to the virtual computer's application. The secondary URL initiates a web-based NICE DCV session to the virtual computer's operating session.

Use StartGUISession to open the session.

Parameter Syntax

$result = $client->createGUISessionAccessDetails([
    'resourceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
resourceName
Required: Yes
Type: string

The resource name.

Result Syntax

[
    'failureReason' => '<string>',
    'percentageComplete' => <integer>,
    'resourceName' => '<string>',
    'sessions' => [
        [
            'isPrimary' => true || false,
            'name' => '<string>',
            'url' => '<string>',
        ],
        // ...
    ],
    'status' => 'startExpired|notStarted|started|starting|stopped|stopping|settingUpInstance|failedInstanceCreation|failedStartingGUISession|failedStoppingGUISession',
]

Result Details

Members
failureReason
Type: string

The reason the operation failed.

percentageComplete
Type: int

The percentage of completion for the operation.

resourceName
Type: string

The resource name.

sessions
Type: Array of Session structures

Returns information about the specified NICE DCV GUI session.

status
Type: string

The status of the operation.

Errors

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

ServiceException:

A general service exception.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateInstanceSnapshot

$result = $client->createInstanceSnapshot([/* ... */]);
$promise = $client->createInstanceSnapshotAsync([/* ... */]);

Creates a snapshot of a specific virtual private server, or instance. You can use a snapshot to create a new instance that is based on that snapshot.

The create instance snapshot operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createInstanceSnapshot([
    'instanceName' => '<string>', // REQUIRED
    'instanceSnapshotName' => '<string>', // REQUIRED
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
instanceName
Required: Yes
Type: string

The Lightsail instance on which to base your snapshot.

instanceSnapshotName
Required: Yes
Type: string

The name for your new snapshot.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateInstances

$result = $client->createInstances([/* ... */]);
$promise = $client->createInstancesAsync([/* ... */]);

Creates one or more Amazon Lightsail instances.

The create instances operation supports tag-based access control via request tags. For more information, see the Lightsail Developer Guide.

Parameter Syntax

$result = $client->createInstances([
    'addOns' => [
        [
            'addOnType' => 'AutoSnapshot|StopInstanceOnIdle', // REQUIRED
            'autoSnapshotAddOnRequest' => [
                'snapshotTimeOfDay' => '<string>',
            ],
            'stopInstanceOnIdleRequest' => [
                'duration' => '<string>',
                'threshold' => '<string>',
            ],
        ],
        // ...
    ],
    'availabilityZone' => '<string>', // REQUIRED
    'blueprintId' => '<string>', // REQUIRED
    'bundleId' => '<string>', // REQUIRED
    'customImageName' => '<string>',
    'instanceNames' => ['<string>', ...], // REQUIRED
    'ipAddressType' => 'dualstack|ipv4|ipv6',
    'keyPairName' => '<string>',
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
    'userData' => '<string>',
]);

Parameter Details

Members
addOns
Type: Array of AddOnRequest structures

An array of objects representing the add-ons to enable for the new instance.

availabilityZone
Required: Yes
Type: string

The Availability Zone in which to create your instance. Use the following format: us-east-2a (case sensitive). You can get a list of Availability Zones by using the get regions operation. Be sure to add the include Availability Zones parameter to your request.

blueprintId
Required: Yes
Type: string

The ID for a virtual private server image (app_wordpress_x_x or app_lamp_x_x). Use the get blueprints operation to return a list of available images (or blueprints).

Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when they become outdated due to operating system updates or new application releases.

bundleId
Required: Yes
Type: string

The bundle of specification information for your virtual private server (or instance), including the pricing plan (medium_x_x).

customImageName
Type: string

(Discontinued) The name for your custom image.

In releases prior to June 12, 2017, this parameter was ignored by the API. It is now discontinued.

instanceNames
Required: Yes
Type: Array of strings

The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for example: ["MyFirstInstance","MySecondInstance"]

ipAddressType
Type: string

The IP address type for the instance.

The possible values are ipv4 for IPv4 only, ipv6 for IPv6 only, and dualstack for IPv4 and IPv6.

The default value is dualstack.

keyPairName
Type: string

The name of your key pair.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

userData
Type: string

A launch script you can create that configures a server with additional user data. For example, you might want to run apt-get -y update.

Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and CentOS use yum, Debian and Ubuntu use apt-get, and FreeBSD uses pkg. For a complete list, see the Amazon Lightsail Developer Guide.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateInstancesFromSnapshot

$result = $client->createInstancesFromSnapshot([/* ... */]);
$promise = $client->createInstancesFromSnapshotAsync([/* ... */]);

Creates one or more new instances from a manual or automatic snapshot of an instance.

The create instances from snapshot operation supports tag-based access control via request tags and resource tags applied to the resource identified by instance snapshot name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createInstancesFromSnapshot([
    'addOns' => [
        [
            'addOnType' => 'AutoSnapshot|StopInstanceOnIdle', // REQUIRED
            'autoSnapshotAddOnRequest' => [
                'snapshotTimeOfDay' => '<string>',
            ],
            'stopInstanceOnIdleRequest' => [
                'duration' => '<string>',
                'threshold' => '<string>',
            ],
        ],
        // ...
    ],
    'attachedDiskMapping' => [
        '<ResourceName>' => [
            [
                'newDiskName' => '<string>',
                'originalDiskPath' => '<string>',
            ],
            // ...
        ],
        // ...
    ],
    'availabilityZone' => '<string>', // REQUIRED
    'bundleId' => '<string>', // REQUIRED
    'instanceNames' => ['<string>', ...], // REQUIRED
    'instanceSnapshotName' => '<string>',
    'ipAddressType' => 'dualstack|ipv4|ipv6',
    'keyPairName' => '<string>',
    'restoreDate' => '<string>',
    'sourceInstanceName' => '<string>',
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
    'useLatestRestorableAutoSnapshot' => true || false,
    'userData' => '<string>',
]);

Parameter Details

Members
addOns
Type: Array of AddOnRequest structures

An array of objects representing the add-ons to enable for the new instance.

attachedDiskMapping
Type: Associative array of custom strings keys (ResourceName) to DiskMap structuress

An object containing information about one or more disk mappings.

availabilityZone
Required: Yes
Type: string

The Availability Zone where you want to create your instances. Use the following formatting: us-east-2a (case sensitive). You can get a list of Availability Zones by using the get regions operation. Be sure to add the include Availability Zones parameter to your request.

bundleId
Required: Yes
Type: string

The bundle of specification information for your virtual private server (or instance), including the pricing plan (micro_x_x).

instanceNames
Required: Yes
Type: Array of strings

The names for your new instances.

instanceSnapshotName
Type: string

The name of the instance snapshot on which you are basing your new instances. Use the get instance snapshots operation to return information about your existing snapshots.

Constraint:

  • This parameter cannot be defined together with the source instance name parameter. The instance snapshot name and source instance name parameters are mutually exclusive.

ipAddressType
Type: string

The IP address type for the instance.

The possible values are ipv4 for IPv4 only, ipv6 for IPv6 only, and dualstack for IPv4 and IPv6.

The default value is dualstack.

keyPairName
Type: string

The name for your key pair.

restoreDate
Type: string

The date of the automatic snapshot to use for the new instance. Use the get auto snapshots operation to identify the dates of the available automatic snapshots.

Constraints:

  • Must be specified in YYYY-MM-DD format.

  • This parameter cannot be defined together with the use latest restorable auto snapshot parameter. The restore date and use latest restorable auto snapshot parameters are mutually exclusive.

  • Define this parameter only when creating a new instance from an automatic snapshot. For more information, see the Amazon Lightsail Developer Guide.

sourceInstanceName
Type: string

The name of the source instance from which the source automatic snapshot was created.

Constraints:

  • This parameter cannot be defined together with the instance snapshot name parameter. The source instance name and instance snapshot name parameters are mutually exclusive.

  • Define this parameter only when creating a new instance from an automatic snapshot. For more information, see the Amazon Lightsail Developer Guide.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

useLatestRestorableAutoSnapshot
Type: boolean

A Boolean value to indicate whether to use the latest available automatic snapshot.

Constraints:

  • This parameter cannot be defined together with the restore date parameter. The use latest restorable auto snapshot and restore date parameters are mutually exclusive.

  • Define this parameter only when creating a new instance from an automatic snapshot. For more information, see the Amazon Lightsail Developer Guide.

userData
Type: string

You can create a launch script that configures a server with additional user data. For example, apt-get -y update.

Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and CentOS use yum, Debian and Ubuntu use apt-get, and FreeBSD uses pkg. For a complete list, see the Amazon Lightsail Developer Guide.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateKeyPair

$result = $client->createKeyPair([/* ... */]);
$promise = $client->createKeyPairAsync([/* ... */]);

Creates a custom SSH key pair that you can use with an Amazon Lightsail instance.

Use the DownloadDefaultKeyPair action to create a Lightsail default key pair in an Amazon Web Services Region where a default key pair does not currently exist.

The create key pair operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createKeyPair([
    'keyPairName' => '<string>', // REQUIRED
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
keyPairName
Required: Yes
Type: string

The name for your new key pair.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

Result Syntax

[
    'keyPair' => [
        'arn' => '<string>',
        'createdAt' => <DateTime>,
        'fingerprint' => '<string>',
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'name' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'supportCode' => '<string>',
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
    ],
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
    'privateKeyBase64' => '<string>',
    'publicKeyBase64' => '<string>',
]

Result Details

Members
keyPair
Type: KeyPair structure

An array of key-value pairs containing information about the new key pair you just created.

operation
Type: Operation structure

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

privateKeyBase64
Type: string

A base64-encoded RSA private key.

publicKeyBase64
Type: string

A base64-encoded public key of the ssh-rsa type.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateLoadBalancer

$result = $client->createLoadBalancer([/* ... */]);
$promise = $client->createLoadBalancerAsync([/* ... */]);

Creates a Lightsail load balancer. To learn more about deciding whether to load balance your application, see Configure your Lightsail instances for load balancing. You can create up to 5 load balancers per AWS Region in your account.

When you create a load balancer, you can specify a unique name and port settings. To change additional load balancer settings, use the UpdateLoadBalancerAttribute operation.

The create load balancer operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createLoadBalancer([
    'certificateAlternativeNames' => ['<string>', ...],
    'certificateDomainName' => '<string>',
    'certificateName' => '<string>',
    'healthCheckPath' => '<string>',
    'instancePort' => <integer>, // REQUIRED
    'ipAddressType' => 'dualstack|ipv4|ipv6',
    'loadBalancerName' => '<string>', // REQUIRED
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
    'tlsPolicyName' => '<string>',
]);

Parameter Details

Members
certificateAlternativeNames
Type: Array of strings

The optional alternative domains and subdomains to use with your SSL/TLS certificate (www.example.com, example.com, m.example.com, blog.example.com).

certificateDomainName
Type: string

The domain name with which your certificate is associated (example.com).

If you specify certificateDomainName, then certificateName is required (and vice-versa).

certificateName
Type: string

The name of the SSL/TLS certificate.

If you specify certificateName, then certificateDomainName is required (and vice-versa).

healthCheckPath
Type: string

The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website ("/").

You may want to specify a custom health check path other than the root of your application if your home page loads slowly or has a lot of media or scripting on it.

instancePort
Required: Yes
Type: int

The instance port where you're creating your load balancer.

ipAddressType
Type: string

The IP address type for the load balancer.

The possible values are ipv4 for IPv4 only, ipv6 for IPv6 only, and dualstack for IPv4 and IPv6.

The default value is dualstack.

loadBalancerName
Required: Yes
Type: string

The name of your load balancer.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

tlsPolicyName
Type: string

The name of the TLS policy to apply to the load balancer.

Use the GetLoadBalancerTlsPolicies action to get a list of TLS policy names that you can specify.

For more information about load balancer TLS policies, see Configuring TLS security policies on your Amazon Lightsail load balancers in the Amazon Lightsail Developer Guide.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateLoadBalancerTlsCertificate

$result = $client->createLoadBalancerTlsCertificate([/* ... */]);
$promise = $client->createLoadBalancerTlsCertificateAsync([/* ... */]);

Creates an SSL/TLS certificate for an Amazon Lightsail load balancer.

TLS is just an updated, more secure version of Secure Socket Layer (SSL).

The CreateLoadBalancerTlsCertificate operation supports tag-based access control via resource tags applied to the resource identified by load balancer name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createLoadBalancerTlsCertificate([
    'certificateAlternativeNames' => ['<string>', ...],
    'certificateDomainName' => '<string>', // REQUIRED
    'certificateName' => '<string>', // REQUIRED
    'loadBalancerName' => '<string>', // REQUIRED
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
certificateAlternativeNames
Type: Array of strings

An array of strings listing alternative domains and subdomains for your SSL/TLS certificate. Lightsail will de-dupe the names for you. You can have a maximum of 9 alternative names (in addition to the 1 primary domain). We do not support wildcards (*.example.com).

certificateDomainName
Required: Yes
Type: string

The domain name (example.com) for your SSL/TLS certificate.

certificateName
Required: Yes
Type: string

The SSL/TLS certificate name.

You can have up to 10 certificates in your account at one time. Each Lightsail load balancer can have up to 2 certificates associated with it at one time. There is also an overall limit to the number of certificates that can be issue in a 365-day period. For more information, see Limits.

loadBalancerName
Required: Yes
Type: string

The load balancer name where you want to create the SSL/TLS certificate.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateRelationalDatabase

$result = $client->createRelationalDatabase([/* ... */]);
$promise = $client->createRelationalDatabaseAsync([/* ... */]);

Creates a new database in Amazon Lightsail.

The create relational database operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createRelationalDatabase([
    'availabilityZone' => '<string>',
    'masterDatabaseName' => '<string>', // REQUIRED
    'masterUserPassword' => '<string>',
    'masterUsername' => '<string>', // REQUIRED
    'preferredBackupWindow' => '<string>',
    'preferredMaintenanceWindow' => '<string>',
    'publiclyAccessible' => true || false,
    'relationalDatabaseBlueprintId' => '<string>', // REQUIRED
    'relationalDatabaseBundleId' => '<string>', // REQUIRED
    'relationalDatabaseName' => '<string>', // REQUIRED
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
availabilityZone
Type: string

The Availability Zone in which to create your new database. Use the us-east-2a case-sensitive format.

You can get a list of Availability Zones by using the get regions operation. Be sure to add the include relational database Availability Zones parameter to your request.

masterDatabaseName
Required: Yes
Type: string

The meaning of this parameter differs according to the database engine you use.

MySQL

The name of the database to create when the Lightsail database resource is created. If this parameter isn't specified, no database is created in the database resource.

Constraints:

  • Must contain 1 to 64 letters or numbers.

  • Must begin with a letter. Subsequent characters can be letters, underscores, or digits (0- 9).

  • Can't be a word reserved by the specified database engine.

    For more information about reserved words in MySQL, see the Keywords and Reserved Words articles for MySQL 5.6, MySQL 5.7, and MySQL 8.0.

PostgreSQL

The name of the database to create when the Lightsail database resource is created. If this parameter isn't specified, a database named postgres is created in the database resource.

Constraints:

  • Must contain 1 to 63 letters or numbers.

  • Must begin with a letter. Subsequent characters can be letters, underscores, or digits (0- 9).

  • Can't be a word reserved by the specified database engine.

    For more information about reserved words in PostgreSQL, see the SQL Key Words articles for PostgreSQL 9.6, PostgreSQL 10, PostgreSQL 11, and PostgreSQL 12.

masterUserPassword
Type: string

The password for the master user. The password can include any printable ASCII character except "/", """, or "@". It cannot contain spaces.

MySQL

Constraints: Must contain from 8 to 41 characters.

PostgreSQL

Constraints: Must contain from 8 to 128 characters.

masterUsername
Required: Yes
Type: string

The name for the master user.

MySQL

Constraints:

  • Required for MySQL.

  • Must be 1 to 16 letters or numbers. Can contain underscores.

  • First character must be a letter.

  • Can't be a reserved word for the chosen database engine.

    For more information about reserved words in MySQL 5.6 or 5.7, see the Keywords and Reserved Words articles for MySQL 5.6, MySQL 5.7, or MySQL 8.0.

PostgreSQL

Constraints:

  • Required for PostgreSQL.

  • Must be 1 to 63 letters or numbers. Can contain underscores.

  • First character must be a letter.

  • Can't be a reserved word for the chosen database engine.

    For more information about reserved words in MySQL 5.6 or 5.7, see the Keywords and Reserved Words articles for PostgreSQL 9.6, PostgreSQL 10, PostgreSQL 11, and PostgreSQL 12.

preferredBackupWindow
Type: string

The daily time range during which automated backups are created for your new database if automated backups are enabled.

The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region. For more information about the preferred backup window time blocks for each region, see the Working With Backups guide in the Amazon Relational Database Service documentation.

Constraints:

  • Must be in the hh24:mi-hh24:mi format.

    Example: 16:00-16:30

  • Specified in Coordinated Universal Time (UTC).

  • Must not conflict with the preferred maintenance window.

  • Must be at least 30 minutes.

preferredMaintenanceWindow
Type: string

The weekly time range during which system maintenance can occur on your new database.

The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week.

Constraints:

  • Must be in the ddd:hh24:mi-ddd:hh24:mi format.

  • Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.

  • Must be at least 30 minutes.

  • Specified in Coordinated Universal Time (UTC).

  • Example: Tue:17:00-Tue:17:30

publiclyAccessible
Type: boolean

Specifies the accessibility options for your new database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database.

relationalDatabaseBlueprintId
Required: Yes
Type: string

The blueprint ID for your new database. A blueprint describes the major engine version of a database.

You can get a list of database blueprints IDs by using the get relational database blueprints operation.

relationalDatabaseBundleId
Required: Yes
Type: string

The bundle ID for your new database. A bundle describes the performance specifications for your database.

You can get a list of database bundle IDs by using the get relational database bundles operation.

relationalDatabaseName
Required: Yes
Type: string

The name to use for your new Lightsail database resource.

Constraints:

  • Must contain from 2 to 255 alphanumeric characters, or hyphens.

  • The first and last character must be a letter or number.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateRelationalDatabaseFromSnapshot

$result = $client->createRelationalDatabaseFromSnapshot([/* ... */]);
$promise = $client->createRelationalDatabaseFromSnapshotAsync([/* ... */]);

Creates a new database from an existing database snapshot in Amazon Lightsail.

You can create a new database from a snapshot in if something goes wrong with your original database, or to change it to a different plan, such as a high availability or standard plan.

The create relational database from snapshot operation supports tag-based access control via request tags and resource tags applied to the resource identified by relationalDatabaseSnapshotName. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createRelationalDatabaseFromSnapshot([
    'availabilityZone' => '<string>',
    'publiclyAccessible' => true || false,
    'relationalDatabaseBundleId' => '<string>',
    'relationalDatabaseName' => '<string>', // REQUIRED
    'relationalDatabaseSnapshotName' => '<string>',
    'restoreTime' => <integer || string || DateTime>,
    'sourceRelationalDatabaseName' => '<string>',
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
    'useLatestRestorableTime' => true || false,
]);

Parameter Details

Members
availabilityZone
Type: string

The Availability Zone in which to create your new database. Use the us-east-2a case-sensitive format.

You can get a list of Availability Zones by using the get regions operation. Be sure to add the include relational database Availability Zones parameter to your request.

publiclyAccessible
Type: boolean

Specifies the accessibility options for your new database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database.

relationalDatabaseBundleId
Type: string

The bundle ID for your new database. A bundle describes the performance specifications for your database.

You can get a list of database bundle IDs by using the get relational database bundles operation.

When creating a new database from a snapshot, you cannot choose a bundle that is smaller than the bundle of the source database.

relationalDatabaseName
Required: Yes
Type: string

The name to use for your new Lightsail database resource.

Constraints:

  • Must contain from 2 to 255 alphanumeric characters, or hyphens.

  • The first and last character must be a letter or number.

relationalDatabaseSnapshotName
Type: string

The name of the database snapshot from which to create your new database.

restoreTime
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time to restore your database from.

Constraints:

  • Must be before the latest restorable time for the database.

  • Cannot be specified if the use latest restorable time parameter is true.

  • Specified in Coordinated Universal Time (UTC).

  • Specified in the Unix time format.

    For example, if you wish to use a restore time of October 1, 2018, at 8 PM UTC, then you input 1538424000 as the restore time.

sourceRelationalDatabaseName
Type: string

The name of the source database.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

useLatestRestorableTime
Type: boolean

Specifies whether your database is restored from the latest backup time. A value of true restores from the latest backup time.

Default: false

Constraints: Cannot be specified if the restore time parameter is provided.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

CreateRelationalDatabaseSnapshot

$result = $client->createRelationalDatabaseSnapshot([/* ... */]);
$promise = $client->createRelationalDatabaseSnapshotAsync([/* ... */]);

Creates a snapshot of your database in Amazon Lightsail. You can use snapshots for backups, to make copies of a database, and to save data before deleting a database.

The create relational database snapshot operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->createRelationalDatabaseSnapshot([
    'relationalDatabaseName' => '<string>', // REQUIRED
    'relationalDatabaseSnapshotName' => '<string>', // REQUIRED
    'tags' => [
        [
            'key' => '<string>',
            'value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
relationalDatabaseName
Required: Yes
Type: string

The name of the database on which to base your new snapshot.

relationalDatabaseSnapshotName
Required: Yes
Type: string

The name for your new database snapshot.

Constraints:

  • Must contain from 2 to 255 alphanumeric characters, or hyphens.

  • The first and last character must be a letter or number.

tags
Type: Array of Tag structures

The tag keys and optional values to add to the resource during create.

Use the TagResource action to tag a resource after it's created.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteAlarm

$result = $client->deleteAlarm([/* ... */]);
$promise = $client->deleteAlarmAsync([/* ... */]);

Deletes an alarm.

An alarm is used to monitor a single metric for one of your resources. When a metric condition is met, the alarm can notify you by email, SMS text message, and a banner displayed on the Amazon Lightsail console. For more information, see Alarms in Amazon Lightsail.

Parameter Syntax

$result = $client->deleteAlarm([
    'alarmName' => '<string>', // REQUIRED
]);

Parameter Details

Members
alarmName
Required: Yes
Type: string

The name of the alarm to delete.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

DeleteAutoSnapshot

$result = $client->deleteAutoSnapshot([/* ... */]);
$promise = $client->deleteAutoSnapshotAsync([/* ... */]);

Deletes an automatic snapshot of an instance or disk. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteAutoSnapshot([
    'date' => '<string>', // REQUIRED
    'resourceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
date
Required: Yes
Type: string

The date of the automatic snapshot to delete in YYYY-MM-DD format. Use the get auto snapshots operation to get the available automatic snapshots for a resource.

resourceName
Required: Yes
Type: string

The name of the source instance or disk from which to delete the automatic snapshot.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteBucket

$result = $client->deleteBucket([/* ... */]);
$promise = $client->deleteBucketAsync([/* ... */]);

Deletes a Amazon Lightsail bucket.

When you delete your bucket, the bucket name is released and can be reused for a new bucket in your account or another Amazon Web Services account.

Parameter Syntax

$result = $client->deleteBucket([
    'bucketName' => '<string>', // REQUIRED
    'forceDelete' => true || false,
]);

Parameter Details

Members
bucketName
Required: Yes
Type: string

The name of the bucket to delete.

Use the GetBuckets action to get a list of bucket names that you can specify.

forceDelete
Type: boolean

A Boolean value that indicates whether to force delete the bucket.

You must force delete the bucket if it has one of the following conditions:

  • The bucket is the origin of a distribution.

  • The bucket has instances that were granted access to it using the SetResourceAccessForBucket action.

  • The bucket has objects.

  • The bucket has access keys.

Force deleting a bucket might impact other resources that rely on the bucket, such as instances, distributions, or software that use the issued access keys.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

ServiceException:

A general service exception.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteBucketAccessKey

$result = $client->deleteBucketAccessKey([/* ... */]);
$promise = $client->deleteBucketAccessKeyAsync([/* ... */]);

Deletes an access key for the specified Amazon Lightsail bucket.

We recommend that you delete an access key if the secret access key is compromised.

For more information about access keys, see Creating access keys for a bucket in Amazon Lightsail in the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteBucketAccessKey([
    'accessKeyId' => '<string>', // REQUIRED
    'bucketName' => '<string>', // REQUIRED
]);

Parameter Details

Members
accessKeyId
Required: Yes
Type: string

The ID of the access key to delete.

Use the GetBucketAccessKeys action to get a list of access key IDs that you can specify.

bucketName
Required: Yes
Type: string

The name of the bucket that the access key belongs to.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

ServiceException:

A general service exception.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteCertificate

$result = $client->deleteCertificate([/* ... */]);
$promise = $client->deleteCertificateAsync([/* ... */]);

Deletes an SSL/TLS certificate for your Amazon Lightsail content delivery network (CDN) distribution.

Certificates that are currently attached to a distribution cannot be deleted. Use the DetachCertificateFromDistribution action to detach a certificate from a distribution.

Parameter Syntax

$result = $client->deleteCertificate([
    'certificateName' => '<string>', // REQUIRED
]);

Parameter Details

Members
certificateName
Required: Yes
Type: string

The name of the certificate to delete.

Use the GetCertificates action to get a list of certificate names that you can specify.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteContactMethod

$result = $client->deleteContactMethod([/* ... */]);
$promise = $client->deleteContactMethodAsync([/* ... */]);

Deletes a contact method.

A contact method is used to send you notifications about your Amazon Lightsail resources. You can add one email address and one mobile phone number contact method in each Amazon Web Services Region. However, SMS text messaging is not supported in some Amazon Web Services Regions, and SMS text messages cannot be sent to some countries/regions. For more information, see Notifications in Amazon Lightsail.

Parameter Syntax

$result = $client->deleteContactMethod([
    'protocol' => 'Email|SMS', // REQUIRED
]);

Parameter Details

Members
protocol
Required: Yes
Type: string

The protocol that will be deleted, such as Email or SMS (text messaging).

To delete an Email and an SMS contact method if you added both, you must run separate DeleteContactMethod actions to delete each protocol.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

DeleteContainerImage

$result = $client->deleteContainerImage([/* ... */]);
$promise = $client->deleteContainerImageAsync([/* ... */]);

Deletes a container image that is registered to your Amazon Lightsail container service.

Parameter Syntax

$result = $client->deleteContainerImage([
    'image' => '<string>', // REQUIRED
    'serviceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
image
Required: Yes
Type: string

The name of the container image to delete from the container service.

Use the GetContainerImages action to get the name of the container images that are registered to a container service.

Container images sourced from your Lightsail container service, that are registered and stored on your service, start with a colon (:). For example, :container-service-1.mystaticwebsite.1. Container images sourced from a public registry like Docker Hub don't start with a colon. For example, nginx:latest or nginx.

serviceName
Required: Yes
Type: string

The name of the container service for which to delete a registered container image.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteContainerService

$result = $client->deleteContainerService([/* ... */]);
$promise = $client->deleteContainerServiceAsync([/* ... */]);

Deletes your Amazon Lightsail container service.

Parameter Syntax

$result = $client->deleteContainerService([
    'serviceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
serviceName
Required: Yes
Type: string

The name of the container service to delete.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteDisk

$result = $client->deleteDisk([/* ... */]);
$promise = $client->deleteDiskAsync([/* ... */]);

Deletes the specified block storage disk. The disk must be in the available state (not attached to a Lightsail instance).

The disk may remain in the deleting state for several minutes.

The delete disk operation supports tag-based access control via resource tags applied to the resource identified by disk name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteDisk([
    'diskName' => '<string>', // REQUIRED
    'forceDeleteAddOns' => true || false,
]);

Parameter Details

Members
diskName
Required: Yes
Type: string

The unique name of the disk you want to delete (my-disk).

forceDeleteAddOns
Type: boolean

A Boolean value to indicate whether to delete all add-ons for the disk.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteDiskSnapshot

$result = $client->deleteDiskSnapshot([/* ... */]);
$promise = $client->deleteDiskSnapshotAsync([/* ... */]);

Deletes the specified disk snapshot.

When you make periodic snapshots of a disk, the snapshots are incremental, and only the blocks on the device that have changed since your last snapshot are saved in the new snapshot. When you delete a snapshot, only the data not needed for any other snapshot is removed. So regardless of which prior snapshots have been deleted, all active snapshots will have access to all the information needed to restore the disk.

The delete disk snapshot operation supports tag-based access control via resource tags applied to the resource identified by disk snapshot name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteDiskSnapshot([
    'diskSnapshotName' => '<string>', // REQUIRED
]);

Parameter Details

Members
diskSnapshotName
Required: Yes
Type: string

The name of the disk snapshot you want to delete (my-disk-snapshot).

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteDistribution

$result = $client->deleteDistribution([/* ... */]);
$promise = $client->deleteDistributionAsync([/* ... */]);

Deletes your Amazon Lightsail content delivery network (CDN) distribution.

Parameter Syntax

$result = $client->deleteDistribution([
    'distributionName' => '<string>',
]);

Parameter Details

Members
distributionName
Type: string

The name of the distribution to delete.

Use the GetDistributions action to get a list of distribution names that you can specify.

Result Syntax

[
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
]

Result Details

Members
operation
Type: Operation structure

An object that describes the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteDomain

$result = $client->deleteDomain([/* ... */]);
$promise = $client->deleteDomainAsync([/* ... */]);

Deletes the specified domain recordset and all of its domain records.

The delete domain operation supports tag-based access control via resource tags applied to the resource identified by domain name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteDomain([
    'domainName' => '<string>', // REQUIRED
]);

Parameter Details

Members
domainName
Required: Yes
Type: string

The specific domain name to delete.

Result Syntax

[
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
]

Result Details

Members
operation
Type: Operation structure

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteDomainEntry

$result = $client->deleteDomainEntry([/* ... */]);
$promise = $client->deleteDomainEntryAsync([/* ... */]);

Deletes a specific domain entry.

The delete domain entry operation supports tag-based access control via resource tags applied to the resource identified by domain name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteDomainEntry([
    'domainEntry' => [ // REQUIRED
        'id' => '<string>',
        'isAlias' => true || false,
        'name' => '<string>',
        'options' => ['<string>', ...],
        'target' => '<string>',
        'type' => '<string>',
    ],
    'domainName' => '<string>', // REQUIRED
]);

Parameter Details

Members
domainEntry
Required: Yes
Type: DomainEntry structure

An array of key-value pairs containing information about your domain entries.

domainName
Required: Yes
Type: string

The name of the domain entry to delete.

Result Syntax

[
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
]

Result Details

Members
operation
Type: Operation structure

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteInstance

$result = $client->deleteInstance([/* ... */]);
$promise = $client->deleteInstanceAsync([/* ... */]);

Deletes an Amazon Lightsail instance.

The delete instance operation supports tag-based access control via resource tags applied to the resource identified by instance name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteInstance([
    'forceDeleteAddOns' => true || false,
    'instanceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
forceDeleteAddOns
Type: boolean

A Boolean value to indicate whether to delete all add-ons for the instance.

instanceName
Required: Yes
Type: string

The name of the instance to delete.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteInstanceSnapshot

$result = $client->deleteInstanceSnapshot([/* ... */]);
$promise = $client->deleteInstanceSnapshotAsync([/* ... */]);

Deletes a specific snapshot of a virtual private server (or instance).

The delete instance snapshot operation supports tag-based access control via resource tags applied to the resource identified by instance snapshot name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteInstanceSnapshot([
    'instanceSnapshotName' => '<string>', // REQUIRED
]);

Parameter Details

Members
instanceSnapshotName
Required: Yes
Type: string

The name of the snapshot to delete.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteKeyPair

$result = $client->deleteKeyPair([/* ... */]);
$promise = $client->deleteKeyPairAsync([/* ... */]);

Deletes the specified key pair by removing the public key from Amazon Lightsail.

You can delete key pairs that were created using the ImportKeyPair and CreateKeyPair actions, as well as the Lightsail default key pair. A new default key pair will not be created unless you launch an instance without specifying a custom key pair, or you call the DownloadDefaultKeyPair API.

The delete key pair operation supports tag-based access control via resource tags applied to the resource identified by key pair name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteKeyPair([
    'expectedFingerprint' => '<string>',
    'keyPairName' => '<string>', // REQUIRED
]);

Parameter Details

Members
expectedFingerprint
Type: string

The RSA fingerprint of the Lightsail default key pair to delete.

The expectedFingerprint parameter is required only when specifying to delete a Lightsail default key pair.

keyPairName
Required: Yes
Type: string

The name of the key pair to delete.

Result Syntax

[
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
]

Result Details

Members
operation
Type: Operation structure

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteKnownHostKeys

$result = $client->deleteKnownHostKeys([/* ... */]);
$promise = $client->deleteKnownHostKeysAsync([/* ... */]);

Deletes the known host key or certificate used by the Amazon Lightsail browser-based SSH or RDP clients to authenticate an instance. This operation enables the Lightsail browser-based SSH or RDP clients to connect to the instance after a host key mismatch.

Perform this operation only if you were expecting the host key or certificate mismatch or if you are familiar with the new host key or certificate on the instance. For more information, see Troubleshooting connection issues when using the Amazon Lightsail browser-based SSH or RDP client.

Parameter Syntax

$result = $client->deleteKnownHostKeys([
    'instanceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
instanceName
Required: Yes
Type: string

The name of the instance for which you want to reset the host key or certificate.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteLoadBalancer

$result = $client->deleteLoadBalancer([/* ... */]);
$promise = $client->deleteLoadBalancerAsync([/* ... */]);

Deletes a Lightsail load balancer and all its associated SSL/TLS certificates. Once the load balancer is deleted, you will need to create a new load balancer, create a new certificate, and verify domain ownership again.

The delete load balancer operation supports tag-based access control via resource tags applied to the resource identified by load balancer name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteLoadBalancer([
    'loadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
loadBalancerName
Required: Yes
Type: string

The name of the load balancer you want to delete.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteLoadBalancerTlsCertificate

$result = $client->deleteLoadBalancerTlsCertificate([/* ... */]);
$promise = $client->deleteLoadBalancerTlsCertificateAsync([/* ... */]);

Deletes an SSL/TLS certificate associated with a Lightsail load balancer.

The DeleteLoadBalancerTlsCertificate operation supports tag-based access control via resource tags applied to the resource identified by load balancer name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteLoadBalancerTlsCertificate([
    'certificateName' => '<string>', // REQUIRED
    'force' => true || false,
    'loadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
certificateName
Required: Yes
Type: string

The SSL/TLS certificate name.

force
Type: boolean

When true, forces the deletion of an SSL/TLS certificate.

There can be two certificates associated with a Lightsail load balancer: the primary and the backup. The force parameter is required when the primary SSL/TLS certificate is in use by an instance attached to the load balancer.

loadBalancerName
Required: Yes
Type: string

The load balancer name.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteRelationalDatabase

$result = $client->deleteRelationalDatabase([/* ... */]);
$promise = $client->deleteRelationalDatabaseAsync([/* ... */]);

Deletes a database in Amazon Lightsail.

The delete relational database operation supports tag-based access control via resource tags applied to the resource identified by relationalDatabaseName. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteRelationalDatabase([
    'finalRelationalDatabaseSnapshotName' => '<string>',
    'relationalDatabaseName' => '<string>', // REQUIRED
    'skipFinalSnapshot' => true || false,
]);

Parameter Details

Members
finalRelationalDatabaseSnapshotName
Type: string

The name of the database snapshot created if skip final snapshot is false, which is the default value for that parameter.

Specifying this parameter and also specifying the skip final snapshot parameter to true results in an error.

Constraints:

  • Must contain from 2 to 255 alphanumeric characters, or hyphens.

  • The first and last character must be a letter or number.

relationalDatabaseName
Required: Yes
Type: string

The name of the database that you are deleting.

skipFinalSnapshot
Type: boolean

Determines whether a final database snapshot is created before your database is deleted. If true is specified, no database snapshot is created. If false is specified, a database snapshot is created before your database is deleted.

You must specify the final relational database snapshot name parameter if the skip final snapshot parameter is false.

Default: false

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DeleteRelationalDatabaseSnapshot

$result = $client->deleteRelationalDatabaseSnapshot([/* ... */]);
$promise = $client->deleteRelationalDatabaseSnapshotAsync([/* ... */]);

Deletes a database snapshot in Amazon Lightsail.

The delete relational database snapshot operation supports tag-based access control via resource tags applied to the resource identified by relationalDatabaseName. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->deleteRelationalDatabaseSnapshot([
    'relationalDatabaseSnapshotName' => '<string>', // REQUIRED
]);

Parameter Details

Members
relationalDatabaseSnapshotName
Required: Yes
Type: string

The name of the database snapshot that you are deleting.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DetachCertificateFromDistribution

$result = $client->detachCertificateFromDistribution([/* ... */]);
$promise = $client->detachCertificateFromDistributionAsync([/* ... */]);

Detaches an SSL/TLS certificate from your Amazon Lightsail content delivery network (CDN) distribution.

After the certificate is detached, your distribution stops accepting traffic for all of the domains that are associated with the certificate.

Parameter Syntax

$result = $client->detachCertificateFromDistribution([
    'distributionName' => '<string>', // REQUIRED
]);

Parameter Details

Members
distributionName
Required: Yes
Type: string

The name of the distribution from which to detach the certificate.

Use the GetDistributions action to get a list of distribution names that you can specify.

Result Syntax

[
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
]

Result Details

Members
operation
Type: Operation structure

An object that describes the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DetachDisk

$result = $client->detachDisk([/* ... */]);
$promise = $client->detachDiskAsync([/* ... */]);

Detaches a stopped block storage disk from a Lightsail instance. Make sure to unmount any file systems on the device within your operating system before stopping the instance and detaching the disk.

The detach disk operation supports tag-based access control via resource tags applied to the resource identified by disk name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->detachDisk([
    'diskName' => '<string>', // REQUIRED
]);

Parameter Details

Members
diskName
Required: Yes
Type: string

The unique name of the disk you want to detach from your instance (my-disk).

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DetachInstancesFromLoadBalancer

$result = $client->detachInstancesFromLoadBalancer([/* ... */]);
$promise = $client->detachInstancesFromLoadBalancerAsync([/* ... */]);

Detaches the specified instances from a Lightsail load balancer.

This operation waits until the instances are no longer needed before they are detached from the load balancer.

The detach instances from load balancer operation supports tag-based access control via resource tags applied to the resource identified by load balancer name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->detachInstancesFromLoadBalancer([
    'instanceNames' => ['<string>', ...], // REQUIRED
    'loadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
instanceNames
Required: Yes
Type: Array of strings

An array of strings containing the names of the instances you want to detach from the load balancer.

loadBalancerName
Required: Yes
Type: string

The name of the Lightsail load balancer.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DetachStaticIp

$result = $client->detachStaticIp([/* ... */]);
$promise = $client->detachStaticIpAsync([/* ... */]);

Detaches a static IP from the Amazon Lightsail instance to which it is attached.

Parameter Syntax

$result = $client->detachStaticIp([
    'staticIpName' => '<string>', // REQUIRED
]);

Parameter Details

Members
staticIpName
Required: Yes
Type: string

The name of the static IP to detach from the instance.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DisableAddOn

$result = $client->disableAddOn([/* ... */]);
$promise = $client->disableAddOnAsync([/* ... */]);

Disables an add-on for an Amazon Lightsail resource. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->disableAddOn([
    'addOnType' => 'AutoSnapshot|StopInstanceOnIdle', // REQUIRED
    'resourceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
addOnType
Required: Yes
Type: string

The add-on type to disable.

resourceName
Required: Yes
Type: string

The name of the source resource for which to disable the add-on.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

DownloadDefaultKeyPair

$result = $client->downloadDefaultKeyPair([/* ... */]);
$promise = $client->downloadDefaultKeyPairAsync([/* ... */]);

Downloads the regional Amazon Lightsail default key pair.

This action also creates a Lightsail default key pair if a default key pair does not currently exist in the Amazon Web Services Region.

Parameter Syntax

$result = $client->downloadDefaultKeyPair([
]);

Parameter Details

Members

Result Syntax

[
    'createdAt' => <DateTime>,
    'privateKeyBase64' => '<string>',
    'publicKeyBase64' => '<string>',
]

Result Details

Members
createdAt
Type: timestamp (string|DateTime or anything parsable by strtotime)

The timestamp when the default key pair was created.

privateKeyBase64
Type: string

A base64-encoded RSA private key.

publicKeyBase64
Type: string

A base64-encoded public key of the ssh-rsa type.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

EnableAddOn

$result = $client->enableAddOn([/* ... */]);
$promise = $client->enableAddOnAsync([/* ... */]);

Enables or modifies an add-on for an Amazon Lightsail resource. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->enableAddOn([
    'addOnRequest' => [ // REQUIRED
        'addOnType' => 'AutoSnapshot|StopInstanceOnIdle', // REQUIRED
        'autoSnapshotAddOnRequest' => [
            'snapshotTimeOfDay' => '<string>',
        ],
        'stopInstanceOnIdleRequest' => [
            'duration' => '<string>',
            'threshold' => '<string>',
        ],
    ],
    'resourceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
addOnRequest
Required: Yes
Type: AddOnRequest structure

An array of strings representing the add-on to enable or modify.

resourceName
Required: Yes
Type: string

The name of the source resource for which to enable or modify the add-on.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

ExportSnapshot

$result = $client->exportSnapshot([/* ... */]);
$promise = $client->exportSnapshotAsync([/* ... */]);

Exports an Amazon Lightsail instance or block storage disk snapshot to Amazon Elastic Compute Cloud (Amazon EC2). This operation results in an export snapshot record that can be used with the create cloud formation stack operation to create new Amazon EC2 instances.

Exported instance snapshots appear in Amazon EC2 as Amazon Machine Images (AMIs), and the instance system disk appears as an Amazon Elastic Block Store (Amazon EBS) volume. Exported disk snapshots appear in Amazon EC2 as Amazon EBS volumes. Snapshots are exported to the same Amazon Web Services Region in Amazon EC2 as the source Lightsail snapshot.

The export snapshot operation supports tag-based access control via resource tags applied to the resource identified by source snapshot name. For more information, see the Amazon Lightsail Developer Guide.

Use the get instance snapshots or get disk snapshots operations to get a list of snapshots that you can export to Amazon EC2.

Parameter Syntax

$result = $client->exportSnapshot([
    'sourceSnapshotName' => '<string>', // REQUIRED
]);

Parameter Details

Members
sourceSnapshotName
Required: Yes
Type: string

The name of the instance or disk snapshot to be exported to Amazon EC2.

Result Syntax

[
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
operations
Type: Array of Operation structures

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetActiveNames

$result = $client->getActiveNames([/* ... */]);
$promise = $client->getActiveNamesAsync([/* ... */]);

Returns the names of all active (not deleted) resources.

Parameter Syntax

$result = $client->getActiveNames([
    'pageToken' => '<string>',
]);

Parameter Details

Members
pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetActiveNames request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'activeNames' => ['<string>', ...],
    'nextPageToken' => '<string>',
]

Result Details

Members
activeNames
Type: Array of strings

The list of active names returned by the get active names request.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetActiveNames request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetAlarms

$result = $client->getAlarms([/* ... */]);
$promise = $client->getAlarmsAsync([/* ... */]);

Returns information about the configured alarms. Specify an alarm name in your request to return information about a specific alarm, or specify a monitored resource name to return information about all alarms for a specific resource.

An alarm is used to monitor a single metric for one of your resources. When a metric condition is met, the alarm can notify you by email, SMS text message, and a banner displayed on the Amazon Lightsail console. For more information, see Alarms in Amazon Lightsail.

Parameter Syntax

$result = $client->getAlarms([
    'alarmName' => '<string>',
    'monitoredResourceName' => '<string>',
    'pageToken' => '<string>',
]);

Parameter Details

Members
alarmName
Type: string

The name of the alarm.

Specify an alarm name to return information about a specific alarm.

monitoredResourceName
Type: string

The name of the Lightsail resource being monitored by the alarm.

Specify a monitored resource name to return information about all alarms for a specific resource.

pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetAlarms request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'alarms' => [
        [
            'arn' => '<string>',
            'comparisonOperator' => 'GreaterThanOrEqualToThreshold|GreaterThanThreshold|LessThanThreshold|LessThanOrEqualToThreshold',
            'contactProtocols' => ['<string>', ...],
            'createdAt' => <DateTime>,
            'datapointsToAlarm' => <integer>,
            'evaluationPeriods' => <integer>,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'metricName' => 'CPUUtilization|NetworkIn|NetworkOut|StatusCheckFailed|StatusCheckFailed_Instance|StatusCheckFailed_System|ClientTLSNegotiationErrorCount|HealthyHostCount|UnhealthyHostCount|HTTPCode_LB_4XX_Count|HTTPCode_LB_5XX_Count|HTTPCode_Instance_2XX_Count|HTTPCode_Instance_3XX_Count|HTTPCode_Instance_4XX_Count|HTTPCode_Instance_5XX_Count|InstanceResponseTime|RejectedConnectionCount|RequestCount|DatabaseConnections|DiskQueueDepth|FreeStorageSpace|NetworkReceiveThroughput|NetworkTransmitThroughput|BurstCapacityTime|BurstCapacityPercentage',
            'monitoredResourceInfo' => [
                'arn' => '<string>',
                'name' => '<string>',
                'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            ],
            'name' => '<string>',
            'notificationEnabled' => true || false,
            'notificationTriggers' => ['<string>', ...],
            'period' => <integer>,
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'state' => 'OK|ALARM|INSUFFICIENT_DATA',
            'statistic' => 'Minimum|Maximum|Sum|Average|SampleCount',
            'supportCode' => '<string>',
            'threshold' => <float>,
            'treatMissingData' => 'breaching|notBreaching|ignore|missing',
            'unit' => 'Seconds|Microseconds|Milliseconds|Bytes|Kilobytes|Megabytes|Gigabytes|Terabytes|Bits|Kilobits|Megabits|Gigabits|Terabits|Percent|Count|Bytes/Second|Kilobytes/Second|Megabytes/Second|Gigabytes/Second|Terabytes/Second|Bits/Second|Kilobits/Second|Megabits/Second|Gigabits/Second|Terabits/Second|Count/Second|None',
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
alarms
Type: Array of Alarm structures

An array of objects that describe the alarms.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetAlarms request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

GetAutoSnapshots

$result = $client->getAutoSnapshots([/* ... */]);
$promise = $client->getAutoSnapshotsAsync([/* ... */]);

Returns the available automatic snapshots for an instance or disk. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->getAutoSnapshots([
    'resourceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
resourceName
Required: Yes
Type: string

The name of the source instance or disk from which to get automatic snapshot information.

Result Syntax

[
    'autoSnapshots' => [
        [
            'createdAt' => <DateTime>,
            'date' => '<string>',
            'fromAttachedDisks' => [
                [
                    'path' => '<string>',
                    'sizeInGb' => <integer>,
                ],
                // ...
            ],
            'status' => 'Success|Failed|InProgress|NotFound',
        ],
        // ...
    ],
    'resourceName' => '<string>',
    'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
]

Result Details

Members
autoSnapshots
Type: Array of AutoSnapshotDetails structures

An array of objects that describe the automatic snapshots that are available for the specified source instance or disk.

resourceName
Type: string

The name of the source instance or disk for the automatic snapshots.

resourceType
Type: string

The resource type of the automatic snapshot. The possible values are Instance, and Disk.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetBlueprints

$result = $client->getBlueprints([/* ... */]);
$promise = $client->getBlueprintsAsync([/* ... */]);

Returns the list of available instance images, or blueprints. You can use a blueprint to create a new instance already running a specific operating system, as well as a preinstalled app or development stack. The software each instance is running depends on the blueprint image you choose.

Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when they become outdated due to operating system updates or new application releases.

Parameter Syntax

$result = $client->getBlueprints([
    'appCategory' => 'LfR',
    'includeInactive' => true || false,
    'pageToken' => '<string>',
]);

Parameter Details

Members
appCategory
Type: string

Returns a list of blueprints that are specific to Lightsail for Research.

You must use this parameter to view Lightsail for Research blueprints.

includeInactive
Type: boolean

A Boolean value that indicates whether to include inactive (unavailable) blueprints in the response of your request.

pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetBlueprints request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'blueprints' => [
        [
            'appCategory' => 'LfR',
            'blueprintId' => '<string>',
            'description' => '<string>',
            'group' => '<string>',
            'isActive' => true || false,
            'licenseUrl' => '<string>',
            'minPower' => <integer>,
            'name' => '<string>',
            'platform' => 'LINUX_UNIX|WINDOWS',
            'productUrl' => '<string>',
            'type' => 'os|app',
            'version' => '<string>',
            'versionCode' => '<string>',
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
blueprints
Type: Array of Blueprint structures

An array of key-value pairs that contains information about the available blueprints.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetBlueprints request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetBucketAccessKeys

$result = $client->getBucketAccessKeys([/* ... */]);
$promise = $client->getBucketAccessKeysAsync([/* ... */]);

Returns the existing access key IDs for the specified Amazon Lightsail bucket.

This action does not return the secret access key value of an access key. You can get a secret access key only when you create it from the response of the CreateBucketAccessKey action. If you lose the secret access key, you must create a new access key.

Parameter Syntax

$result = $client->getBucketAccessKeys([
    'bucketName' => '<string>', // REQUIRED
]);

Parameter Details

Members
bucketName
Required: Yes
Type: string

The name of the bucket for which to return access keys.

Result Syntax

[
    'accessKeys' => [
        [
            'accessKeyId' => '<string>',
            'createdAt' => <DateTime>,
            'lastUsed' => [
                'lastUsedDate' => <DateTime>,
                'region' => '<string>',
                'serviceName' => '<string>',
            ],
            'secretAccessKey' => '<string>',
            'status' => 'Active|Inactive',
        ],
        // ...
    ],
]

Result Details

Members
accessKeys
Type: Array of AccessKey structures

An object that describes the access keys for the specified bucket.

Errors

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

ServiceException:

A general service exception.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetBucketBundles

$result = $client->getBucketBundles([/* ... */]);
$promise = $client->getBucketBundlesAsync([/* ... */]);

Returns the bundles that you can apply to a Amazon Lightsail bucket.

The bucket bundle specifies the monthly cost, storage quota, and data transfer quota for a bucket.

Use the UpdateBucketBundle action to update the bundle for a bucket.

Parameter Syntax

$result = $client->getBucketBundles([
    'includeInactive' => true || false,
]);

Parameter Details

Members
includeInactive
Type: boolean

A Boolean value that indicates whether to include inactive (unavailable) bundles in the response of your request.

Result Syntax

[
    'bundles' => [
        [
            'bundleId' => '<string>',
            'isActive' => true || false,
            'name' => '<string>',
            'price' => <float>,
            'storagePerMonthInGb' => <integer>,
            'transferPerMonthInGb' => <integer>,
        ],
        // ...
    ],
]

Result Details

Members
bundles
Type: Array of BucketBundle structures

An object that describes bucket bundles.

Errors

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

ServiceException:

A general service exception.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetBucketMetricData

$result = $client->getBucketMetricData([/* ... */]);
$promise = $client->getBucketMetricDataAsync([/* ... */]);

Returns the data points of a specific metric for an Amazon Lightsail bucket.

Metrics report the utilization of a bucket. View and collect metric data regularly to monitor the number of objects stored in a bucket (including object versions) and the storage space used by those objects.

Parameter Syntax

$result = $client->getBucketMetricData([
    'bucketName' => '<string>', // REQUIRED
    'endTime' => <integer || string || DateTime>, // REQUIRED
    'metricName' => 'BucketSizeBytes|NumberOfObjects', // REQUIRED
    'period' => <integer>, // REQUIRED
    'startTime' => <integer || string || DateTime>, // REQUIRED
    'statistics' => ['<string>', ...], // REQUIRED
    'unit' => 'Seconds|Microseconds|Milliseconds|Bytes|Kilobytes|Megabytes|Gigabytes|Terabytes|Bits|Kilobits|Megabits|Gigabits|Terabits|Percent|Count|Bytes/Second|Kilobytes/Second|Megabytes/Second|Gigabytes/Second|Terabytes/Second|Bits/Second|Kilobits/Second|Megabits/Second|Gigabits/Second|Terabits/Second|Count/Second|None', // REQUIRED
]);

Parameter Details

Members
bucketName
Required: Yes
Type: string

The name of the bucket for which to get metric data.

endTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The timestamp indicating the latest data to be returned.

metricName
Required: Yes
Type: string

The metric for which you want to return information.

Valid bucket metric names are listed below, along with the most useful statistics to include in your request, and the published unit value.

These bucket metrics are reported once per day.

  • BucketSizeBytes - The amount of data in bytes stored in a bucket. This value is calculated by summing the size of all objects in the bucket (including object versions), including the size of all parts for all incomplete multipart uploads to the bucket.

    Statistics: The most useful statistic is Maximum.

    Unit: The published unit is Bytes.

  • NumberOfObjects - The total number of objects stored in a bucket. This value is calculated by counting all objects in the bucket (including object versions) and the total number of parts for all incomplete multipart uploads to the bucket.

    Statistics: The most useful statistic is Average.

    Unit: The published unit is Count.

period
Required: Yes
Type: int

The granularity, in seconds, of the returned data points.

Bucket storage metrics are reported once per day. Therefore, you should specify a period of 86400 seconds, which is the number of seconds in a day.

startTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The timestamp indicating the earliest data to be returned.

statistics
Required: Yes
Type: Array of strings

The statistic for the metric.

The following statistics are available:

  • Minimum - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.

  • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

  • Sum - The sum of all values submitted for the matching metric. You can use this statistic to determine the total volume of a metric.

  • Average - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.

  • SampleCount - The count, or number, of data points used for the statistical calculation.

unit
Required: Yes
Type: string

The unit for the metric data request.

Valid units depend on the metric data being requested. For the valid units with each available metric, see the metricName parameter.

Result Syntax

[
    'metricData' => [
        [
            'average' => <float>,
            'maximum' => <float>,
            'minimum' => <float>,
            'sampleCount' => <float>,
            'sum' => <float>,
            'timestamp' => <DateTime>,
            'unit' => 'Seconds|Microseconds|Milliseconds|Bytes|Kilobytes|Megabytes|Gigabytes|Terabytes|Bits|Kilobits|Megabits|Gigabits|Terabits|Percent|Count|Bytes/Second|Kilobytes/Second|Megabytes/Second|Gigabytes/Second|Terabytes/Second|Bits/Second|Kilobits/Second|Megabits/Second|Gigabits/Second|Terabits/Second|Count/Second|None',
        ],
        // ...
    ],
    'metricName' => 'BucketSizeBytes|NumberOfObjects',
]

Result Details

Members
metricData
Type: Array of MetricDatapoint structures

An array of objects that describe the metric data returned.

metricName
Type: string

The name of the metric returned.

Errors

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

ServiceException:

A general service exception.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetBuckets

$result = $client->getBuckets([/* ... */]);
$promise = $client->getBucketsAsync([/* ... */]);

Returns information about one or more Amazon Lightsail buckets. The information returned includes the synchronization status of the Amazon Simple Storage Service (Amazon S3) account-level block public access feature for your Lightsail buckets.

For more information about buckets, see Buckets in Amazon Lightsail in the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->getBuckets([
    'bucketName' => '<string>',
    'includeConnectedResources' => true || false,
    'pageToken' => '<string>',
]);

Parameter Details

Members
bucketName
Type: string

The name of the bucket for which to return information.

When omitted, the response includes all of your buckets in the Amazon Web Services Region where the request is made.

includeConnectedResources
Type: boolean

A Boolean value that indicates whether to include Lightsail instances that were given access to the bucket using the SetResourceAccessForBucket action.

pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetBuckets request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'accountLevelBpaSync' => [
        'bpaImpactsLightsail' => true || false,
        'lastSyncedAt' => <DateTime>,
        'message' => 'DEFAULTED_FOR_SLR_MISSING|SYNC_ON_HOLD|DEFAULTED_FOR_SLR_MISSING_ON_HOLD|Unknown',
        'status' => 'InSync|Failed|NeverSynced|Defaulted',
    ],
    'buckets' => [
        [
            'ableToUpdateBundle' => true || false,
            'accessLogConfig' => [
                'destination' => '<string>',
                'enabled' => true || false,
                'prefix' => '<string>',
            ],
            'accessRules' => [
                'allowPublicOverrides' => true || false,
                'getObject' => 'public|private',
            ],
            'arn' => '<string>',
            'bundleId' => '<string>',
            'createdAt' => <DateTime>,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'objectVersioning' => '<string>',
            'readonlyAccessAccounts' => ['<string>', ...],
            'resourceType' => '<string>',
            'resourcesReceivingAccess' => [
                [
                    'name' => '<string>',
                    'resourceType' => '<string>',
                ],
                // ...
            ],
            'state' => [
                'code' => '<string>',
                'message' => '<string>',
            ],
            'supportCode' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
            'url' => '<string>',
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
accountLevelBpaSync
Type: AccountLevelBpaSync structure

An object that describes the synchronization status of the Amazon S3 account-level block public access feature for your Lightsail buckets.

For more information about this feature and how it affects Lightsail buckets, see Block public access for buckets in Amazon Lightsail.

buckets
Type: Array of Bucket structures

An array of objects that describe buckets.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetBuckets request and specify the next page token using the pageToken parameter.

Errors

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

ServiceException:

A general service exception.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetBundles

$result = $client->getBundles([/* ... */]);
$promise = $client->getBundlesAsync([/* ... */]);

Returns the bundles that you can apply to an Amazon Lightsail instance when you create it.

A bundle describes the specifications of an instance, such as the monthly cost, amount of memory, the number of vCPUs, amount of storage space, and monthly network data transfer quota.

Bundles are referred to as instance plans in the Lightsail console.

Parameter Syntax

$result = $client->getBundles([
    'appCategory' => 'LfR',
    'includeInactive' => true || false,
    'pageToken' => '<string>',
]);

Parameter Details

Members
appCategory
Type: string

Returns a list of bundles that are specific to Lightsail for Research.

You must use this parameter to view Lightsail for Research bundles.

includeInactive
Type: boolean

A Boolean value that indicates whether to include inactive (unavailable) bundles in the response of your request.

pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetBundles request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'bundles' => [
        [
            'bundleId' => '<string>',
            'cpuCount' => <integer>,
            'diskSizeInGb' => <integer>,
            'instanceType' => '<string>',
            'isActive' => true || false,
            'name' => '<string>',
            'power' => <integer>,
            'price' => <float>,
            'publicIpv4AddressCount' => <integer>,
            'ramSizeInGb' => <float>,
            'supportedAppCategories' => ['<string>', ...],
            'supportedPlatforms' => ['<string>', ...],
            'transferPerMonthInGb' => <integer>,
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
bundles
Type: Array of Bundle structures

An array of key-value pairs that contains information about the available bundles.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetBundles request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetCertificates

$result = $client->getCertificates([/* ... */]);
$promise = $client->getCertificatesAsync([/* ... */]);

Returns information about one or more Amazon Lightsail SSL/TLS certificates.

To get a summary of a certificate, omit includeCertificateDetails from your request. The response will include only the certificate Amazon Resource Name (ARN), certificate name, domain name, and tags.

Parameter Syntax

$result = $client->getCertificates([
    'certificateName' => '<string>',
    'certificateStatuses' => ['<string>', ...],
    'includeCertificateDetails' => true || false,
    'pageToken' => '<string>',
]);

Parameter Details

Members
certificateName
Type: string

The name for the certificate for which to return information.

When omitted, the response includes all of your certificates in the Amazon Web Services Region where the request is made.

certificateStatuses
Type: Array of strings

The status of the certificates for which to return information.

For example, specify ISSUED to return only certificates with an ISSUED status.

When omitted, the response includes all of your certificates in the Amazon Web Services Region where the request is made, regardless of their current status.

includeCertificateDetails
Type: boolean

Indicates whether to include detailed information about the certificates in the response.

When omitted, the response includes only the certificate names, Amazon Resource Names (ARNs), domain names, and tags.

pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetCertificates request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'certificates' => [
        [
            'certificateArn' => '<string>',
            'certificateDetail' => [
                'arn' => '<string>',
                'createdAt' => <DateTime>,
                'domainName' => '<string>',
                'domainValidationRecords' => [
                    [
                        'dnsRecordCreationState' => [
                            'code' => 'SUCCEEDED|STARTED|FAILED',
                            'message' => '<string>',
                        ],
                        'domainName' => '<string>',
                        'resourceRecord' => [
                            'name' => '<string>',
                            'type' => '<string>',
                            'value' => '<string>',
                        ],
                        'validationStatus' => 'PENDING_VALIDATION|FAILED|SUCCESS',
                    ],
                    // ...
                ],
                'eligibleToRenew' => '<string>',
                'inUseResourceCount' => <integer>,
                'issuedAt' => <DateTime>,
                'issuerCA' => '<string>',
                'keyAlgorithm' => '<string>',
                'name' => '<string>',
                'notAfter' => <DateTime>,
                'notBefore' => <DateTime>,
                'renewalSummary' => [
                    'domainValidationRecords' => [
                        [
                            'dnsRecordCreationState' => [
                                'code' => 'SUCCEEDED|STARTED|FAILED',
                                'message' => '<string>',
                            ],
                            'domainName' => '<string>',
                            'resourceRecord' => [
                                'name' => '<string>',
                                'type' => '<string>',
                                'value' => '<string>',
                            ],
                            'validationStatus' => 'PENDING_VALIDATION|FAILED|SUCCESS',
                        ],
                        // ...
                    ],
                    'renewalStatus' => 'PendingAutoRenewal|PendingValidation|Success|Failed',
                    'renewalStatusReason' => '<string>',
                    'updatedAt' => <DateTime>,
                ],
                'requestFailureReason' => '<string>',
                'revocationReason' => '<string>',
                'revokedAt' => <DateTime>,
                'serialNumber' => '<string>',
                'status' => 'PENDING_VALIDATION|ISSUED|INACTIVE|EXPIRED|VALIDATION_TIMED_OUT|REVOKED|FAILED',
                'subjectAlternativeNames' => ['<string>', ...],
                'supportCode' => '<string>',
                'tags' => [
                    [
                        'key' => '<string>',
                        'value' => '<string>',
                    ],
                    // ...
                ],
            ],
            'certificateName' => '<string>',
            'domainName' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
certificates
Type: Array of CertificateSummary structures

An object that describes certificates.

nextPageToken
Type: string

If NextPageToken is returned there are more results available. The value of NextPageToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetCloudFormationStackRecords

$result = $client->getCloudFormationStackRecords([/* ... */]);
$promise = $client->getCloudFormationStackRecordsAsync([/* ... */]);

Returns the CloudFormation stack record created as a result of the create cloud formation stack operation.

An AWS CloudFormation stack is used to create a new Amazon EC2 instance from an exported Lightsail snapshot.

Parameter Syntax

$result = $client->getCloudFormationStackRecords([
    'pageToken' => '<string>',
]);

Parameter Details

Members
pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetClouFormationStackRecords request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'cloudFormationStackRecords' => [
        [
            'arn' => '<string>',
            'createdAt' => <DateTime>,
            'destinationInfo' => [
                'id' => '<string>',
                'service' => '<string>',
            ],
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'sourceInfo' => [
                [
                    'arn' => '<string>',
                    'name' => '<string>',
                    'resourceType' => 'ExportSnapshotRecord',
                ],
                // ...
            ],
            'state' => 'Started|Succeeded|Failed',
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
cloudFormationStackRecords
Type: Array of CloudFormationStackRecord structures

A list of objects describing the CloudFormation stack records.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetCloudFormationStackRecords request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetContactMethods

$result = $client->getContactMethods([/* ... */]);
$promise = $client->getContactMethodsAsync([/* ... */]);

Returns information about the configured contact methods. Specify a protocol in your request to return information about a specific contact method.

A contact method is used to send you notifications about your Amazon Lightsail resources. You can add one email address and one mobile phone number contact method in each Amazon Web Services Region. However, SMS text messaging is not supported in some Amazon Web Services Regions, and SMS text messages cannot be sent to some countries/regions. For more information, see Notifications in Amazon Lightsail.

Parameter Syntax

$result = $client->getContactMethods([
    'protocols' => ['<string>', ...],
]);

Parameter Details

Members
protocols
Type: Array of strings

The protocols used to send notifications, such as Email, or SMS (text messaging).

Specify a protocol in your request to return information about a specific contact method protocol.

Result Syntax

[
    'contactMethods' => [
        [
            'arn' => '<string>',
            'contactEndpoint' => '<string>',
            'createdAt' => <DateTime>,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'protocol' => 'Email|SMS',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'PendingVerification|Valid|Invalid',
            'supportCode' => '<string>',
        ],
        // ...
    ],
]

Result Details

Members
contactMethods
Type: Array of ContactMethod structures

An array of objects that describe the contact methods.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetContainerAPIMetadata

$result = $client->getContainerAPIMetadata([/* ... */]);
$promise = $client->getContainerAPIMetadataAsync([/* ... */]);

Returns information about Amazon Lightsail containers, such as the current version of the Lightsail Control (lightsailctl) plugin.

Parameter Syntax

$result = $client->getContainerAPIMetadata([
]);

Parameter Details

Members

Result Syntax

[
    'metadata' => [
        ['<string>', ...],
        // ...
    ],
]

Result Details

Members
metadata
Type: Array of stringss

Metadata about Lightsail containers, such as the current version of the Lightsail Control (lightsailctl) plugin.

Errors

ServiceException:

A general service exception.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetContainerImages

$result = $client->getContainerImages([/* ... */]);
$promise = $client->getContainerImagesAsync([/* ... */]);

Returns the container images that are registered to your Amazon Lightsail container service.

If you created a deployment on your Lightsail container service that uses container images from a public registry like Docker Hub, those images are not returned as part of this action. Those images are not registered to your Lightsail container service.

Parameter Syntax

$result = $client->getContainerImages([
    'serviceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
serviceName
Required: Yes
Type: string

The name of the container service for which to return registered container images.

Result Syntax

[
    'containerImages' => [
        [
            'createdAt' => <DateTime>,
            'digest' => '<string>',
            'image' => '<string>',
        ],
        // ...
    ],
]

Result Details

Members
containerImages
Type: Array of ContainerImage structures

An array of objects that describe container images that are registered to the container service.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetContainerLog

$result = $client->getContainerLog([/* ... */]);
$promise = $client->getContainerLogAsync([/* ... */]);

Returns the log events of a container of your Amazon Lightsail container service.

If your container service has more than one node (i.e., a scale greater than 1), then the log events that are returned for the specified container are merged from all nodes on your container service.

Container logs are retained for a certain amount of time. For more information, see Amazon Lightsail endpoints and quotas in the Amazon Web Services General Reference.

Parameter Syntax

$result = $client->getContainerLog([
    'containerName' => '<string>', // REQUIRED
    'endTime' => <integer || string || DateTime>,
    'filterPattern' => '<string>',
    'pageToken' => '<string>',
    'serviceName' => '<string>', // REQUIRED
    'startTime' => <integer || string || DateTime>,
]);

Parameter Details

Members
containerName
Required: Yes
Type: string

The name of the container that is either running or previously ran on the container service for which to return a log.

endTime
Type: timestamp (string|DateTime or anything parsable by strtotime)

The end of the time interval for which to get log data.

Constraints:

  • Specified in Coordinated Universal Time (UTC).

  • Specified in the Unix time format.

    For example, if you wish to use an end time of October 1, 2018, at 9 PM UTC, specify 1538427600 as the end time.

You can convert a human-friendly time to Unix time format using a converter like Epoch converter.

filterPattern
Type: string

The pattern to use to filter the returned log events to a specific term.

The following are a few examples of filter patterns that you can specify:

  • To return all log events, specify a filter pattern of "".

  • To exclude log events that contain the ERROR term, and return all other log events, specify a filter pattern of "-ERROR".

  • To return log events that contain the ERROR term, specify a filter pattern of "ERROR".

  • To return log events that contain both the ERROR and Exception terms, specify a filter pattern of "ERROR Exception".

  • To return log events that contain the ERROR or the Exception term, specify a filter pattern of "?ERROR ?Exception".

pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetContainerLog request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

serviceName
Required: Yes
Type: string

The name of the container service for which to get a container log.

startTime
Type: timestamp (string|DateTime or anything parsable by strtotime)

The start of the time interval for which to get log data.

Constraints:

  • Specified in Coordinated Universal Time (UTC).

  • Specified in the Unix time format.

    For example, if you wish to use a start time of October 1, 2018, at 8 PM UTC, specify 1538424000 as the start time.

You can convert a human-friendly time to Unix time format using a converter like Epoch converter.

Result Syntax

[
    'logEvents' => [
        [
            'createdAt' => <DateTime>,
            'message' => '<string>',
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
logEvents
Type: Array of ContainerServiceLogEvent structures

An array of objects that describe the log events of a container.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetContainerLog request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetContainerServiceDeployments

$result = $client->getContainerServiceDeployments([/* ... */]);
$promise = $client->getContainerServiceDeploymentsAsync([/* ... */]);

Returns the deployments for your Amazon Lightsail container service

A deployment specifies the settings, such as the ports and launch command, of containers that are deployed to your container service.

The deployments are ordered by version in ascending order. The newest version is listed at the top of the response.

A set number of deployments are kept before the oldest one is replaced with the newest one. For more information, see Amazon Lightsail endpoints and quotas in the Amazon Web Services General Reference.

Parameter Syntax

$result = $client->getContainerServiceDeployments([
    'serviceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
serviceName
Required: Yes
Type: string

The name of the container service for which to return deployments.

Result Syntax

[
    'deployments' => [
        [
            'containers' => [
                '<ContainerName>' => [
                    'command' => ['<string>', ...],
                    'environment' => ['<string>', ...],
                    'image' => '<string>',
                    'ports' => ['<string>', ...],
                ],
                // ...
            ],
            'createdAt' => <DateTime>,
            'publicEndpoint' => [
                'containerName' => '<string>',
                'containerPort' => <integer>,
                'healthCheck' => [
                    'healthyThreshold' => <integer>,
                    'intervalSeconds' => <integer>,
                    'path' => '<string>',
                    'successCodes' => '<string>',
                    'timeoutSeconds' => <integer>,
                    'unhealthyThreshold' => <integer>,
                ],
            ],
            'state' => 'ACTIVATING|ACTIVE|INACTIVE|FAILED',
            'version' => <integer>,
        ],
        // ...
    ],
]

Result Details

Members
deployments
Type: Array of ContainerServiceDeployment structures

An array of objects that describe deployments for a container service.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetContainerServiceMetricData

$result = $client->getContainerServiceMetricData([/* ... */]);
$promise = $client->getContainerServiceMetricDataAsync([/* ... */]);

Returns the data points of a specific metric of your Amazon Lightsail container service.

Metrics report the utilization of your resources. Monitor and collect metric data regularly to maintain the reliability, availability, and performance of your resources.

Parameter Syntax

$result = $client->getContainerServiceMetricData([
    'endTime' => <integer || string || DateTime>, // REQUIRED
    'metricName' => 'CPUUtilization|MemoryUtilization', // REQUIRED
    'period' => <integer>, // REQUIRED
    'serviceName' => '<string>', // REQUIRED
    'startTime' => <integer || string || DateTime>, // REQUIRED
    'statistics' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
endTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The end time of the time period.

metricName
Required: Yes
Type: string

The metric for which you want to return information.

Valid container service metric names are listed below, along with the most useful statistics to include in your request, and the published unit value.

  • CPUUtilization - The average percentage of compute units that are currently in use across all nodes of the container service. This metric identifies the processing power required to run containers on each node of the container service.

    Statistics: The most useful statistics are Maximum and Average.

    Unit: The published unit is Percent.

  • MemoryUtilization - The average percentage of available memory that is currently in use across all nodes of the container service. This metric identifies the memory required to run containers on each node of the container service.

    Statistics: The most useful statistics are Maximum and Average.

    Unit: The published unit is Percent.

period
Required: Yes
Type: int

The granularity, in seconds, of the returned data points.

All container service metric data is available in 5-minute (300 seconds) granularity.

serviceName
Required: Yes
Type: string

The name of the container service for which to get metric data.

startTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The start time of the time period.

statistics
Required: Yes
Type: Array of strings

The statistic for the metric.

The following statistics are available:

  • Minimum - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.

  • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

  • Sum - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.

  • Average - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.

  • SampleCount - The count, or number, of data points used for the statistical calculation.

Result Syntax

[
    'metricData' => [
        [
            'average' => <float>,
            'maximum' => <float>,
            'minimum' => <float>,
            'sampleCount' => <float>,
            'sum' => <float>,
            'timestamp' => <DateTime>,
            'unit' => 'Seconds|Microseconds|Milliseconds|Bytes|Kilobytes|Megabytes|Gigabytes|Terabytes|Bits|Kilobits|Megabits|Gigabits|Terabits|Percent|Count|Bytes/Second|Kilobytes/Second|Megabytes/Second|Gigabytes/Second|Terabytes/Second|Bits/Second|Kilobits/Second|Megabits/Second|Gigabits/Second|Terabits/Second|Count/Second|None',
        ],
        // ...
    ],
    'metricName' => 'CPUUtilization|MemoryUtilization',
]

Result Details

Members
metricData
Type: Array of MetricDatapoint structures

An array of objects that describe the metric data returned.

metricName
Type: string

The name of the metric returned.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetContainerServicePowers

$result = $client->getContainerServicePowers([/* ... */]);
$promise = $client->getContainerServicePowersAsync([/* ... */]);

Returns the list of powers that can be specified for your Amazon Lightsail container services.

The power specifies the amount of memory, the number of vCPUs, and the base price of the container service.

Parameter Syntax

$result = $client->getContainerServicePowers([
]);

Parameter Details

Members

Result Syntax

[
    'powers' => [
        [
            'cpuCount' => <float>,
            'isActive' => true || false,
            'name' => '<string>',
            'powerId' => '<string>',
            'price' => <float>,
            'ramSizeInGb' => <float>,
        ],
        // ...
    ],
]

Result Details

Members
powers
Type: Array of ContainerServicePower structures

An array of objects that describe the powers that can be specified for a container service.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetContainerServices

$result = $client->getContainerServices([/* ... */]);
$promise = $client->getContainerServicesAsync([/* ... */]);

Returns information about one or more of your Amazon Lightsail container services.

Parameter Syntax

$result = $client->getContainerServices([
    'serviceName' => '<string>',
]);

Parameter Details

Members
serviceName
Type: string

The name of the container service for which to return information.

When omitted, the response includes all of your container services in the Amazon Web Services Region where the request is made.

Result Syntax

[
    'containerServices' => [
        [
            'arn' => '<string>',
            'containerServiceName' => '<string>',
            'createdAt' => <DateTime>,
            'currentDeployment' => [
                'containers' => [
                    '<ContainerName>' => [
                        'command' => ['<string>', ...],
                        'environment' => ['<string>', ...],
                        'image' => '<string>',
                        'ports' => ['<string>', ...],
                    ],
                    // ...
                ],
                'createdAt' => <DateTime>,
                'publicEndpoint' => [
                    'containerName' => '<string>',
                    'containerPort' => <integer>,
                    'healthCheck' => [
                        'healthyThreshold' => <integer>,
                        'intervalSeconds' => <integer>,
                        'path' => '<string>',
                        'successCodes' => '<string>',
                        'timeoutSeconds' => <integer>,
                        'unhealthyThreshold' => <integer>,
                    ],
                ],
                'state' => 'ACTIVATING|ACTIVE|INACTIVE|FAILED',
                'version' => <integer>,
            ],
            'isDisabled' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'nextDeployment' => [
                'containers' => [
                    '<ContainerName>' => [
                        'command' => ['<string>', ...],
                        'environment' => ['<string>', ...],
                        'image' => '<string>',
                        'ports' => ['<string>', ...],
                    ],
                    // ...
                ],
                'createdAt' => <DateTime>,
                'publicEndpoint' => [
                    'containerName' => '<string>',
                    'containerPort' => <integer>,
                    'healthCheck' => [
                        'healthyThreshold' => <integer>,
                        'intervalSeconds' => <integer>,
                        'path' => '<string>',
                        'successCodes' => '<string>',
                        'timeoutSeconds' => <integer>,
                        'unhealthyThreshold' => <integer>,
                    ],
                ],
                'state' => 'ACTIVATING|ACTIVE|INACTIVE|FAILED',
                'version' => <integer>,
            ],
            'power' => 'nano|micro|small|medium|large|xlarge',
            'powerId' => '<string>',
            'principalArn' => '<string>',
            'privateDomainName' => '<string>',
            'privateRegistryAccess' => [
                'ecrImagePullerRole' => [
                    'isActive' => true || false,
                    'principalArn' => '<string>',
                ],
            ],
            'publicDomainNames' => [
                '<string>' => ['<string>', ...],
                // ...
            ],
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'scale' => <integer>,
            'state' => 'PENDING|READY|RUNNING|UPDATING|DELETING|DISABLED|DEPLOYING',
            'stateDetail' => [
                'code' => 'CREATING_SYSTEM_RESOURCES|CREATING_NETWORK_INFRASTRUCTURE|PROVISIONING_CERTIFICATE|PROVISIONING_SERVICE|CREATING_DEPLOYMENT|EVALUATING_HEALTH_CHECK|ACTIVATING_DEPLOYMENT|CERTIFICATE_LIMIT_EXCEEDED|UNKNOWN_ERROR',
                'message' => '<string>',
            ],
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
            'url' => '<string>',
        ],
        // ...
    ],
]

Result Details

Members
containerServices
Type: Array of ContainerService structures

An array of objects that describe one or more container services.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetCostEstimate

$result = $client->getCostEstimate([/* ... */]);
$promise = $client->getCostEstimateAsync([/* ... */]);

Retrieves information about the cost estimate for a specified resource. A cost estimate will not generate for a resource that has been deleted.

Parameter Syntax

$result = $client->getCostEstimate([
    'endTime' => <integer || string || DateTime>, // REQUIRED
    'resourceName' => '<string>', // REQUIRED
    'startTime' => <integer || string || DateTime>, // REQUIRED
]);

Parameter Details

Members
endTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The cost estimate end time.

Constraints:

  • Specified in Coordinated Universal Time (UTC).

  • Specified in the Unix time format.

    For example, if you want to use an end time of October 1, 2018, at 9 PM UTC, specify 1538427600 as the end time.

You can convert a human-friendly time to Unix time format using a converter like Epoch converter.

resourceName
Required: Yes
Type: string

The resource name.

startTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The cost estimate start time.

Constraints:

  • Specified in Coordinated Universal Time (UTC).

  • Specified in the Unix time format.

    For example, if you want to use a start time of October 1, 2018, at 8 PM UTC, specify 1538424000 as the start time.

You can convert a human-friendly time to Unix time format using a converter like Epoch converter.

Result Syntax

[
    'resourcesBudgetEstimate' => [
        [
            'costEstimates' => [
                [
                    'resultsByTime' => [
                        [
                            'currency' => 'USD',
                            'pricingUnit' => 'GB|Hrs|GB-Mo|Bundles|Queries',
                            'timePeriod' => [
                                'end' => <DateTime>,
                                'start' => <DateTime>,
                            ],
                            'unit' => <float>,
                            'usageCost' => <float>,
                        ],
                        // ...
                    ],
                    'usageType' => '<string>',
                ],
                // ...
            ],
            'endTime' => <DateTime>,
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'startTime' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
resourcesBudgetEstimate
Type: Array of ResourceBudgetEstimate structures

Returns the estimate's forecasted cost or usage.

Errors

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

ServiceException:

A general service exception.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetDisk

$result = $client->getDisk([/* ... */]);
$promise = $client->getDiskAsync([/* ... */]);

Returns information about a specific block storage disk.

Parameter Syntax

$result = $client->getDisk([
    'diskName' => '<string>', // REQUIRED
]);

Parameter Details

Members
diskName
Required: Yes
Type: string

The name of the disk (my-disk).

Result Syntax

[
    'disk' => [
        'addOns' => [
            [
                'duration' => '<string>',
                'name' => '<string>',
                'nextSnapshotTimeOfDay' => '<string>',
                'snapshotTimeOfDay' => '<string>',
                'status' => '<string>',
                'threshold' => '<string>',
            ],
            // ...
        ],
        'arn' => '<string>',
        'attachedTo' => '<string>',
        'attachmentState' => '<string>',
        'autoMountStatus' => 'Failed|Pending|Mounted|NotMounted',
        'createdAt' => <DateTime>,
        'gbInUse' => <integer>,
        'iops' => <integer>,
        'isAttached' => true || false,
        'isSystemDisk' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'name' => '<string>',
        'path' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'sizeInGb' => <integer>,
        'state' => 'pending|error|available|in-use|unknown',
        'supportCode' => '<string>',
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
    ],
]

Result Details

Members
disk
Type: Disk structure

An object containing information about the disk.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetDiskSnapshot

$result = $client->getDiskSnapshot([/* ... */]);
$promise = $client->getDiskSnapshotAsync([/* ... */]);

Returns information about a specific block storage disk snapshot.

Parameter Syntax

$result = $client->getDiskSnapshot([
    'diskSnapshotName' => '<string>', // REQUIRED
]);

Parameter Details

Members
diskSnapshotName
Required: Yes
Type: string

The name of the disk snapshot (my-disk-snapshot).

Result Syntax

[
    'diskSnapshot' => [
        'arn' => '<string>',
        'createdAt' => <DateTime>,
        'fromDiskArn' => '<string>',
        'fromDiskName' => '<string>',
        'fromInstanceArn' => '<string>',
        'fromInstanceName' => '<string>',
        'isFromAutoSnapshot' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'name' => '<string>',
        'progress' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'sizeInGb' => <integer>,
        'state' => 'pending|completed|error|unknown',
        'supportCode' => '<string>',
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
    ],
]

Result Details

Members
diskSnapshot
Type: DiskSnapshot structure

An object containing information about the disk snapshot.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetDiskSnapshots

$result = $client->getDiskSnapshots([/* ... */]);
$promise = $client->getDiskSnapshotsAsync([/* ... */]);

Returns information about all block storage disk snapshots in your AWS account and region.

Parameter Syntax

$result = $client->getDiskSnapshots([
    'pageToken' => '<string>',
]);

Parameter Details

Members
pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetDiskSnapshots request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'diskSnapshots' => [
        [
            'arn' => '<string>',
            'createdAt' => <DateTime>,
            'fromDiskArn' => '<string>',
            'fromDiskName' => '<string>',
            'fromInstanceArn' => '<string>',
            'fromInstanceName' => '<string>',
            'isFromAutoSnapshot' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'progress' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'sizeInGb' => <integer>,
            'state' => 'pending|completed|error|unknown',
            'supportCode' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
diskSnapshots
Type: Array of DiskSnapshot structures

An array of objects containing information about all block storage disk snapshots.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetDiskSnapshots request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetDisks

$result = $client->getDisks([/* ... */]);
$promise = $client->getDisksAsync([/* ... */]);

Returns information about all block storage disks in your AWS account and region.

Parameter Syntax

$result = $client->getDisks([
    'pageToken' => '<string>',
]);

Parameter Details

Members
pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetDisks request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'disks' => [
        [
            'addOns' => [
                [
                    'duration' => '<string>',
                    'name' => '<string>',
                    'nextSnapshotTimeOfDay' => '<string>',
                    'snapshotTimeOfDay' => '<string>',
                    'status' => '<string>',
                    'threshold' => '<string>',
                ],
                // ...
            ],
            'arn' => '<string>',
            'attachedTo' => '<string>',
            'attachmentState' => '<string>',
            'autoMountStatus' => 'Failed|Pending|Mounted|NotMounted',
            'createdAt' => <DateTime>,
            'gbInUse' => <integer>,
            'iops' => <integer>,
            'isAttached' => true || false,
            'isSystemDisk' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'path' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'sizeInGb' => <integer>,
            'state' => 'pending|error|available|in-use|unknown',
            'supportCode' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
disks
Type: Array of Disk structures

An array of objects containing information about all block storage disks.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetDisks request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetDistributionBundles

$result = $client->getDistributionBundles([/* ... */]);
$promise = $client->getDistributionBundlesAsync([/* ... */]);

Returns the bundles that can be applied to your Amazon Lightsail content delivery network (CDN) distributions.

A distribution bundle specifies the monthly network transfer quota and monthly cost of your distribution.

Parameter Syntax

$result = $client->getDistributionBundles([
]);

Parameter Details

Members

Result Syntax

[
    'bundles' => [
        [
            'bundleId' => '<string>',
            'isActive' => true || false,
            'name' => '<string>',
            'price' => <float>,
            'transferPerMonthInGb' => <integer>,
        ],
        // ...
    ],
]

Result Details

Members
bundles
Type: Array of DistributionBundle structures

An object that describes a distribution bundle.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetDistributionLatestCacheReset

$result = $client->getDistributionLatestCacheReset([/* ... */]);
$promise = $client->getDistributionLatestCacheResetAsync([/* ... */]);

Returns the timestamp and status of the last cache reset of a specific Amazon Lightsail content delivery network (CDN) distribution.

Parameter Syntax

$result = $client->getDistributionLatestCacheReset([
    'distributionName' => '<string>',
]);

Parameter Details

Members
distributionName
Type: string

The name of the distribution for which to return the timestamp of the last cache reset.

Use the GetDistributions action to get a list of distribution names that you can specify.

When omitted, the response includes the latest cache reset timestamp of all your distributions.

Result Syntax

[
    'createTime' => <DateTime>,
    'status' => '<string>',
]

Result Details

Members
createTime
Type: timestamp (string|DateTime or anything parsable by strtotime)

The timestamp of the last cache reset (1479734909.17) in Unix time format.

status
Type: string

The status of the last cache reset.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetDistributionMetricData

$result = $client->getDistributionMetricData([/* ... */]);
$promise = $client->getDistributionMetricDataAsync([/* ... */]);

Returns the data points of a specific metric for an Amazon Lightsail content delivery network (CDN) distribution.

Metrics report the utilization of your resources, and the error counts generated by them. Monitor and collect metric data regularly to maintain the reliability, availability, and performance of your resources.

Parameter Syntax

$result = $client->getDistributionMetricData([
    'distributionName' => '<string>', // REQUIRED
    'endTime' => <integer || string || DateTime>, // REQUIRED
    'metricName' => 'Requests|BytesDownloaded|BytesUploaded|TotalErrorRate|Http4xxErrorRate|Http5xxErrorRate', // REQUIRED
    'period' => <integer>, // REQUIRED
    'startTime' => <integer || string || DateTime>, // REQUIRED
    'statistics' => ['<string>', ...], // REQUIRED
    'unit' => 'Seconds|Microseconds|Milliseconds|Bytes|Kilobytes|Megabytes|Gigabytes|Terabytes|Bits|Kilobits|Megabits|Gigabits|Terabits|Percent|Count|Bytes/Second|Kilobytes/Second|Megabytes/Second|Gigabytes/Second|Terabytes/Second|Bits/Second|Kilobits/Second|Megabits/Second|Gigabits/Second|Terabits/Second|Count/Second|None', // REQUIRED
]);

Parameter Details

Members
distributionName
Required: Yes
Type: string

The name of the distribution for which to get metric data.

Use the GetDistributions action to get a list of distribution names that you can specify.

endTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The end of the time interval for which to get metric data.

Constraints:

  • Specified in Coordinated Universal Time (UTC).

  • Specified in the Unix time format.

    For example, if you wish to use an end time of October 1, 2018, at 9 PM UTC, specify 1538427600 as the end time.

You can convert a human-friendly time to Unix time format using a converter like Epoch converter.

metricName
Required: Yes
Type: string

The metric for which you want to return information.

Valid distribution metric names are listed below, along with the most useful statistics to include in your request, and the published unit value.

  • Requests - The total number of viewer requests received by your Lightsail distribution, for all HTTP methods, and for both HTTP and HTTPS requests.

    Statistics: The most useful statistic is Sum.

    Unit: The published unit is None.

  • BytesDownloaded - The number of bytes downloaded by viewers for GET, HEAD, and OPTIONS requests.

    Statistics: The most useful statistic is Sum.

    Unit: The published unit is None.

  • BytesUploaded - The number of bytes uploaded to your origin by your Lightsail distribution, using POST and PUT requests.

    Statistics: The most useful statistic is Sum.

    Unit: The published unit is None.

  • TotalErrorRate - The percentage of all viewer requests for which the response's HTTP status code was 4xx or 5xx.

    Statistics: The most useful statistic is Average.

    Unit: The published unit is Percent.

  • 4xxErrorRate - The percentage of all viewer requests for which the response's HTTP status cod was 4xx. In these cases, the client or client viewer may have made an error. For example, a status code of 404 (Not Found) means that the client requested an object that could not be found.

    Statistics: The most useful statistic is Average.

    Unit: The published unit is Percent.

  • 5xxErrorRate - The percentage of all viewer requests for which the response's HTTP status code was 5xx. In these cases, the origin server did not satisfy the requests. For example, a status code of 503 (Service Unavailable) means that the origin server is currently unavailable.

    Statistics: The most useful statistic is Average.

    Unit: The published unit is Percent.

period
Required: Yes
Type: int

The granularity, in seconds, for the metric data points that will be returned.

startTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The start of the time interval for which to get metric data.

Constraints:

  • Specified in Coordinated Universal Time (UTC).

  • Specified in the Unix time format.

    For example, if you wish to use a start time of October 1, 2018, at 8 PM UTC, specify 1538424000 as the start time.

You can convert a human-friendly time to Unix time format using a converter like Epoch converter.

statistics
Required: Yes
Type: Array of strings

The statistic for the metric.

The following statistics are available:

  • Minimum - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.

  • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

  • Sum - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.

  • Average - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.

  • SampleCount - The count, or number, of data points used for the statistical calculation.

unit
Required: Yes
Type: string

The unit for the metric data request.

Valid units depend on the metric data being requested. For the valid units with each available metric, see the metricName parameter.

Result Syntax

[
    'metricData' => [
        [
            'average' => <float>,
            'maximum' => <float>,
            'minimum' => <float>,
            'sampleCount' => <float>,
            'sum' => <float>,
            'timestamp' => <DateTime>,
            'unit' => 'Seconds|Microseconds|Milliseconds|Bytes|Kilobytes|Megabytes|Gigabytes|Terabytes|Bits|Kilobits|Megabits|Gigabits|Terabits|Percent|Count|Bytes/Second|Kilobytes/Second|Megabytes/Second|Gigabytes/Second|Terabytes/Second|Bits/Second|Kilobits/Second|Megabits/Second|Gigabits/Second|Terabits/Second|Count/Second|None',
        ],
        // ...
    ],
    'metricName' => 'Requests|BytesDownloaded|BytesUploaded|TotalErrorRate|Http4xxErrorRate|Http5xxErrorRate',
]

Result Details

Members
metricData
Type: Array of MetricDatapoint structures

An array of objects that describe the metric data returned.

metricName
Type: string

The name of the metric returned.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetDistributions

$result = $client->getDistributions([/* ... */]);
$promise = $client->getDistributionsAsync([/* ... */]);

Returns information about one or more of your Amazon Lightsail content delivery network (CDN) distributions.

Parameter Syntax

$result = $client->getDistributions([
    'distributionName' => '<string>',
    'pageToken' => '<string>',
]);

Parameter Details

Members
distributionName
Type: string

The name of the distribution for which to return information.

When omitted, the response includes all of your distributions in the Amazon Web Services Region where the request is made.

pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetDistributions request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'distributions' => [
        [
            'ableToUpdateBundle' => true || false,
            'alternativeDomainNames' => ['<string>', ...],
            'arn' => '<string>',
            'bundleId' => '<string>',
            'cacheBehaviorSettings' => [
                'allowedHTTPMethods' => '<string>',
                'cachedHTTPMethods' => '<string>',
                'defaultTTL' => <integer>,
                'forwardedCookies' => [
                    'cookiesAllowList' => ['<string>', ...],
                    'option' => 'none|allow-list|all',
                ],
                'forwardedHeaders' => [
                    'headersAllowList' => ['<string>', ...],
                    'option' => 'none|allow-list|all',
                ],
                'forwardedQueryStrings' => [
                    'option' => true || false,
                    'queryStringsAllowList' => ['<string>', ...],
                ],
                'maximumTTL' => <integer>,
                'minimumTTL' => <integer>,
            ],
            'cacheBehaviors' => [
                [
                    'behavior' => 'dont-cache|cache',
                    'path' => '<string>',
                ],
                // ...
            ],
            'certificateName' => '<string>',
            'createdAt' => <DateTime>,
            'defaultCacheBehavior' => [
                'behavior' => 'dont-cache|cache',
            ],
            'domainName' => '<string>',
            'ipAddressType' => 'dualstack|ipv4|ipv6',
            'isEnabled' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'origin' => [
                'name' => '<string>',
                'protocolPolicy' => 'http-only|https-only',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
                'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
                'responseTimeout' => <integer>,
            ],
            'originPublicDNS' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => '<string>',
            'supportCode' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
            'viewerMinimumTlsProtocolVersion' => '<string>',
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
distributions
Type: Array of LightsailDistribution structures

An array of objects that describe your distributions.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetDistributions request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetDomain

$result = $client->getDomain([/* ... */]);
$promise = $client->getDomainAsync([/* ... */]);

Returns information about a specific domain recordset.

Parameter Syntax

$result = $client->getDomain([
    'domainName' => '<string>', // REQUIRED
]);

Parameter Details

Members
domainName
Required: Yes
Type: string

The domain name for which your want to return information about.

Result Syntax

[
    'domain' => [
        'arn' => '<string>',
        'createdAt' => <DateTime>,
        'domainEntries' => [
            [
                'id' => '<string>',
                'isAlias' => true || false,
                'name' => '<string>',
                'options' => ['<string>', ...],
                'target' => '<string>',
                'type' => '<string>',
            ],
            // ...
        ],
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'name' => '<string>',
        'registeredDomainDelegationInfo' => [
            'nameServersUpdateState' => [
                'code' => 'SUCCEEDED|PENDING|FAILED|STARTED',
                'message' => '<string>',
            ],
            'r53HostedZoneDeletionState' => [
                'code' => 'SUCCEEDED|PENDING|FAILED|STARTED',
                'message' => '<string>',
            ],
        ],
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'supportCode' => '<string>',
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
    ],
]

Result Details

Members
domain
Type: Domain structure

An array of key-value pairs containing information about your get domain request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetDomains

$result = $client->getDomains([/* ... */]);
$promise = $client->getDomainsAsync([/* ... */]);

Returns a list of all domains in the user's account.

Parameter Syntax

$result = $client->getDomains([
    'pageToken' => '<string>',
]);

Parameter Details

Members
pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetDomains request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'domains' => [
        [
            'arn' => '<string>',
            'createdAt' => <DateTime>,
            'domainEntries' => [
                [
                    'id' => '<string>',
                    'isAlias' => true || false,
                    'name' => '<string>',
                    'options' => ['<string>', ...],
                    'target' => '<string>',
                    'type' => '<string>',
                ],
                // ...
            ],
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'registeredDomainDelegationInfo' => [
                'nameServersUpdateState' => [
                    'code' => 'SUCCEEDED|PENDING|FAILED|STARTED',
                    'message' => '<string>',
                ],
                'r53HostedZoneDeletionState' => [
                    'code' => 'SUCCEEDED|PENDING|FAILED|STARTED',
                    'message' => '<string>',
                ],
            ],
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'supportCode' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
domains
Type: Array of Domain structures

An array of key-value pairs containing information about each of the domain entries in the user's account.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetDomains request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetExportSnapshotRecords

$result = $client->getExportSnapshotRecords([/* ... */]);
$promise = $client->getExportSnapshotRecordsAsync([/* ... */]);

Returns all export snapshot records created as a result of the export snapshot operation.

An export snapshot record can be used to create a new Amazon EC2 instance and its related resources with the CreateCloudFormationStack action.

Parameter Syntax

$result = $client->getExportSnapshotRecords([
    'pageToken' => '<string>',
]);

Parameter Details

Members
pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetExportSnapshotRecords request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'exportSnapshotRecords' => [
        [
            'arn' => '<string>',
            'createdAt' => <DateTime>,
            'destinationInfo' => [
                'id' => '<string>',
                'service' => '<string>',
            ],
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'sourceInfo' => [
                'arn' => '<string>',
                'createdAt' => <DateTime>,
                'diskSnapshotInfo' => [
                    'sizeInGb' => <integer>,
                ],
                'fromResourceArn' => '<string>',
                'fromResourceName' => '<string>',
                'instanceSnapshotInfo' => [
                    'fromBlueprintId' => '<string>',
                    'fromBundleId' => '<string>',
                    'fromDiskInfo' => [
                        [
                            'isSystemDisk' => true || false,
                            'name' => '<string>',
                            'path' => '<string>',
                            'sizeInGb' => <integer>,
                        ],
                        // ...
                    ],
                ],
                'name' => '<string>',
                'resourceType' => 'InstanceSnapshot|DiskSnapshot',
            ],
            'state' => 'Started|Succeeded|Failed',
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
exportSnapshotRecords
Type: Array of ExportSnapshotRecord structures

A list of objects describing the export snapshot records.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetExportSnapshotRecords request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetInstance

$result = $client->getInstance([/* ... */]);
$promise = $client->getInstanceAsync([/* ... */]);

Returns information about a specific Amazon Lightsail instance, which is a virtual private server.

Parameter Syntax

$result = $client->getInstance([
    'instanceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
instanceName
Required: Yes
Type: string

The name of the instance.

Result Syntax

[
    'instance' => [
        'addOns' => [
            [
                'duration' => '<string>',
                'name' => '<string>',
                'nextSnapshotTimeOfDay' => '<string>',
                'snapshotTimeOfDay' => '<string>',
                'status' => '<string>',
                'threshold' => '<string>',
            ],
            // ...
        ],
        'arn' => '<string>',
        'blueprintId' => '<string>',
        'blueprintName' => '<string>',
        'bundleId' => '<string>',
        'createdAt' => <DateTime>,
        'hardware' => [
            'cpuCount' => <integer>,
            'disks' => [
                [
                    'addOns' => [
                        [
                            'duration' => '<string>',
                            'name' => '<string>',
                            'nextSnapshotTimeOfDay' => '<string>',
                            'snapshotTimeOfDay' => '<string>',
                            'status' => '<string>',
                            'threshold' => '<string>',
                        ],
                        // ...
                    ],
                    'arn' => '<string>',
                    'attachedTo' => '<string>',
                    'attachmentState' => '<string>',
                    'autoMountStatus' => 'Failed|Pending|Mounted|NotMounted',
                    'createdAt' => <DateTime>,
                    'gbInUse' => <integer>,
                    'iops' => <integer>,
                    'isAttached' => true || false,
                    'isSystemDisk' => true || false,
                    'location' => [
                        'availabilityZone' => '<string>',
                        'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
                    ],
                    'name' => '<string>',
                    'path' => '<string>',
                    'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
                    'sizeInGb' => <integer>,
                    'state' => 'pending|error|available|in-use|unknown',
                    'supportCode' => '<string>',
                    'tags' => [
                        [
                            'key' => '<string>',
                            'value' => '<string>',
                        ],
                        // ...
                    ],
                ],
                // ...
            ],
            'ramSizeInGb' => <float>,
        ],
        'ipAddressType' => 'dualstack|ipv4|ipv6',
        'ipv6Addresses' => ['<string>', ...],
        'isStaticIp' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'metadataOptions' => [
            'httpEndpoint' => 'disabled|enabled',
            'httpProtocolIpv6' => 'disabled|enabled',
            'httpPutResponseHopLimit' => <integer>,
            'httpTokens' => 'optional|required',
            'state' => 'pending|applied',
        ],
        'name' => '<string>',
        'networking' => [
            'monthlyTransfer' => [
                'gbPerMonthAllocated' => <integer>,
            ],
            'ports' => [
                [
                    'accessDirection' => 'inbound|outbound',
                    'accessFrom' => '<string>',
                    'accessType' => 'Public|Private',
                    'cidrListAliases' => ['<string>', ...],
                    'cidrs' => ['<string>', ...],
                    'commonName' => '<string>',
                    'fromPort' => <integer>,
                    'ipv6Cidrs' => ['<string>', ...],
                    'protocol' => 'tcp|all|udp|icmp|icmpv6',
                    'toPort' => <integer>,
                ],
                // ...
            ],
        ],
        'privateIpAddress' => '<string>',
        'publicIpAddress' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'sshKeyName' => '<string>',
        'state' => [
            'code' => <integer>,
            'name' => '<string>',
        ],
        'supportCode' => '<string>',
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
        'username' => '<string>',
    ],
]

Result Details

Members
instance
Type: Instance structure

An array of key-value pairs containing information about the specified instance.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetInstanceAccessDetails

$result = $client->getInstanceAccessDetails([/* ... */]);
$promise = $client->getInstanceAccessDetailsAsync([/* ... */]);

Returns temporary SSH keys you can use to connect to a specific virtual private server, or instance.

The get instance access details operation supports tag-based access control via resource tags applied to the resource identified by instance name. For more information, see the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->getInstanceAccessDetails([
    'instanceName' => '<string>', // REQUIRED
    'protocol' => 'ssh|rdp',
]);

Parameter Details

Members
instanceName
Required: Yes
Type: string

The name of the instance to access.

protocol
Type: string

The protocol to use to connect to your instance. Defaults to ssh.

Result Syntax

[
    'accessDetails' => [
        'certKey' => '<string>',
        'expiresAt' => <DateTime>,
        'hostKeys' => [
            [
                'algorithm' => '<string>',
                'fingerprintSHA1' => '<string>',
                'fingerprintSHA256' => '<string>',
                'notValidAfter' => <DateTime>,
                'notValidBefore' => <DateTime>,
                'publicKey' => '<string>',
                'witnessedAt' => <DateTime>,
            ],
            // ...
        ],
        'instanceName' => '<string>',
        'ipAddress' => '<string>',
        'ipv6Addresses' => ['<string>', ...],
        'password' => '<string>',
        'passwordData' => [
            'ciphertext' => '<string>',
            'keyPairName' => '<string>',
        ],
        'privateKey' => '<string>',
        'protocol' => 'ssh|rdp',
        'username' => '<string>',
    ],
]

Result Details

Members
accessDetails
Type: InstanceAccessDetails structure

An array of key-value pairs containing information about a get instance access request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetInstanceMetricData

$result = $client->getInstanceMetricData([/* ... */]);
$promise = $client->getInstanceMetricDataAsync([/* ... */]);

Returns the data points for the specified Amazon Lightsail instance metric, given an instance name.

Metrics report the utilization of your resources, and the error counts generated by them. Monitor and collect metric data regularly to maintain the reliability, availability, and performance of your resources.

Parameter Syntax

$result = $client->getInstanceMetricData([
    'endTime' => <integer || string || DateTime>, // REQUIRED
    'instanceName' => '<string>', // REQUIRED
    'metricName' => 'CPUUtilization|NetworkIn|NetworkOut|StatusCheckFailed|StatusCheckFailed_Instance|StatusCheckFailed_System|BurstCapacityTime|BurstCapacityPercentage|MetadataNoToken', // REQUIRED
    'period' => <integer>, // REQUIRED
    'startTime' => <integer || string || DateTime>, // REQUIRED
    'statistics' => ['<string>', ...], // REQUIRED
    'unit' => 'Seconds|Microseconds|Milliseconds|Bytes|Kilobytes|Megabytes|Gigabytes|Terabytes|Bits|Kilobits|Megabits|Gigabits|Terabits|Percent|Count|Bytes/Second|Kilobytes/Second|Megabytes/Second|Gigabytes/Second|Terabytes/Second|Bits/Second|Kilobits/Second|Megabits/Second|Gigabits/Second|Terabits/Second|Count/Second|None', // REQUIRED
]);

Parameter Details

Members
endTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The end time of the time period.

instanceName
Required: Yes
Type: string

The name of the instance for which you want to get metrics data.

metricName
Required: Yes
Type: string

The metric for which you want to return information.

Valid instance metric names are listed below, along with the most useful statistics to include in your request, and the published unit value.

  • BurstCapacityPercentage - The percentage of CPU performance available for your instance to burst above its baseline. Your instance continuously accrues and consumes burst capacity. Burst capacity stops accruing when your instance's BurstCapacityPercentage reaches 100%. For more information, see Viewing instance burst capacity in Amazon Lightsail.

    Statistics: The most useful statistics are Maximum and Average.

    Unit: The published unit is Percent.

  • BurstCapacityTime - The available amount of time for your instance to burst at 100% CPU utilization. Your instance continuously accrues and consumes burst capacity. Burst capacity time stops accruing when your instance's BurstCapacityPercentage metric reaches 100%.

    Burst capacity time is consumed at the full rate only when your instance operates at 100% CPU utilization. For example, if your instance operates at 50% CPU utilization in the burstable zone for a 5-minute period, then it consumes CPU burst capacity minutes at a 50% rate in that period. Your instance consumed 2 minutes and 30 seconds of CPU burst capacity minutes in the 5-minute period. For more information, see Viewing instance burst capacity in Amazon Lightsail.

    Statistics: The most useful statistics are Maximum and Average.

    Unit: The published unit is Seconds.

  • CPUUtilization - The percentage of allocated compute units that are currently in use on the instance. This metric identifies the processing power to run the applications on the instance. Tools in your operating system can show a lower percentage than Lightsail when the instance is not allocated a full processor core.

    Statistics: The most useful statistics are Maximum and Average.

    Unit: The published unit is Percent.

  • NetworkIn - The number of bytes received on all network interfaces by the instance. This metric identifies the volume of incoming network traffic to the instance. The number reported is the number of bytes received during the period. Because this metric is reported in 5-minute intervals, divide the reported number by 300 to find Bytes/second.

    Statistics: The most useful statistic is Sum.

    Unit: The published unit is Bytes.

  • NetworkOut - The number of bytes sent out on all network interfaces by the instance. This metric identifies the volume of outgoing network traffic from the instance. The number reported is the number of bytes sent during the period. Because this metric is reported in 5-minute intervals, divide the reported number by 300 to find Bytes/second.

    Statistics: The most useful statistic is Sum.

    Unit: The published unit is Bytes.

  • StatusCheckFailed - Reports whether the instance passed or failed both the instance status check and the system status check. This metric can be either 0 (passed) or 1 (failed). This metric data is available in 1-minute (60 seconds) granularity.

    Statistics: The most useful statistic is Sum.

    Unit: The published unit is Count.

  • StatusCheckFailed_Instance - Reports whether the instance passed or failed the instance status check. This metric can be either 0 (passed) or 1 (failed). This metric data is available in 1-minute (60 seconds) granularity.

    Statistics: The most useful statistic is Sum.

    Unit: The published unit is Count.

  • StatusCheckFailed_System - Reports whether the instance passed or failed the system status check. This metric can be either 0 (passed) or 1 (failed). This metric data is available in 1-minute (60 seconds) granularity.

    Statistics: The most useful statistic is Sum.

    Unit: The published unit is Count.

  • MetadataNoToken - Reports the number of times that the instance metadata service was successfully accessed without a token. This metric determines if there are any processes accessing instance metadata by using Instance Metadata Service Version 1, which doesn't use a token. If all requests use token-backed sessions, such as Instance Metadata Service Version 2, then the value is 0.

    Statistics: The most useful statistic is Sum.

    Unit: The published unit is Count.

period
Required: Yes
Type: int

The granularity, in seconds, of the returned data points.

The StatusCheckFailed, StatusCheckFailed_Instance, and StatusCheckFailed_System instance metric data is available in 1-minute (60 seconds) granularity. All other instance metric data is available in 5-minute (300 seconds) granularity.

startTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The start time of the time period.

statistics
Required: Yes
Type: Array of strings

The statistic for the metric.

The following statistics are available:

  • Minimum - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.

  • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

  • Sum - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.

  • Average - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.

  • SampleCount - The count, or number, of data points used for the statistical calculation.

unit
Required: Yes
Type: string

The unit for the metric data request. Valid units depend on the metric data being requested. For the valid units to specify with each available metric, see the metricName parameter.

Result Syntax

[
    'metricData' => [
        [
            'average' => <float>,
            'maximum' => <float>,
            'minimum' => <float>,
            'sampleCount' => <float>,
            'sum' => <float>,
            'timestamp' => <DateTime>,
            'unit' => 'Seconds|Microseconds|Milliseconds|Bytes|Kilobytes|Megabytes|Gigabytes|Terabytes|Bits|Kilobits|Megabits|Gigabits|Terabits|Percent|Count|Bytes/Second|Kilobytes/Second|Megabytes/Second|Gigabytes/Second|Terabytes/Second|Bits/Second|Kilobits/Second|Megabits/Second|Gigabits/Second|Terabits/Second|Count/Second|None',
        ],
        // ...
    ],
    'metricName' => 'CPUUtilization|NetworkIn|NetworkOut|StatusCheckFailed|StatusCheckFailed_Instance|StatusCheckFailed_System|BurstCapacityTime|BurstCapacityPercentage|MetadataNoToken',
]

Result Details

Members
metricData
Type: Array of MetricDatapoint structures

An array of objects that describe the metric data returned.

metricName
Type: string

The name of the metric returned.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetInstancePortStates

$result = $client->getInstancePortStates([/* ... */]);
$promise = $client->getInstancePortStatesAsync([/* ... */]);

Returns the firewall port states for a specific Amazon Lightsail instance, the IP addresses allowed to connect to the instance through the ports, and the protocol.

Parameter Syntax

$result = $client->getInstancePortStates([
    'instanceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
instanceName
Required: Yes
Type: string

The name of the instance for which to return firewall port states.

Result Syntax

[
    'portStates' => [
        [
            'cidrListAliases' => ['<string>', ...],
            'cidrs' => ['<string>', ...],
            'fromPort' => <integer>,
            'ipv6Cidrs' => ['<string>', ...],
            'protocol' => 'tcp|all|udp|icmp|icmpv6',
            'state' => 'open|closed',
            'toPort' => <integer>,
        ],
        // ...
    ],
]

Result Details

Members
portStates
Type: Array of InstancePortState structures

An array of objects that describe the firewall port states for the specified instance.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetInstanceSnapshot

$result = $client->getInstanceSnapshot([/* ... */]);
$promise = $client->getInstanceSnapshotAsync([/* ... */]);

Returns information about a specific instance snapshot.

Parameter Syntax

$result = $client->getInstanceSnapshot([
    'instanceSnapshotName' => '<string>', // REQUIRED
]);

Parameter Details

Members
instanceSnapshotName
Required: Yes
Type: string

The name of the snapshot for which you are requesting information.

Result Syntax

[
    'instanceSnapshot' => [
        'arn' => '<string>',
        'createdAt' => <DateTime>,
        'fromAttachedDisks' => [
            [
                'addOns' => [
                    [
                        'duration' => '<string>',
                        'name' => '<string>',
                        'nextSnapshotTimeOfDay' => '<string>',
                        'snapshotTimeOfDay' => '<string>',
                        'status' => '<string>',
                        'threshold' => '<string>',
                    ],
                    // ...
                ],
                'arn' => '<string>',
                'attachedTo' => '<string>',
                'attachmentState' => '<string>',
                'autoMountStatus' => 'Failed|Pending|Mounted|NotMounted',
                'createdAt' => <DateTime>,
                'gbInUse' => <integer>,
                'iops' => <integer>,
                'isAttached' => true || false,
                'isSystemDisk' => true || false,
                'location' => [
                    'availabilityZone' => '<string>',
                    'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
                ],
                'name' => '<string>',
                'path' => '<string>',
                'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
                'sizeInGb' => <integer>,
                'state' => 'pending|error|available|in-use|unknown',
                'supportCode' => '<string>',
                'tags' => [
                    [
                        'key' => '<string>',
                        'value' => '<string>',
                    ],
                    // ...
                ],
            ],
            // ...
        ],
        'fromBlueprintId' => '<string>',
        'fromBundleId' => '<string>',
        'fromInstanceArn' => '<string>',
        'fromInstanceName' => '<string>',
        'isFromAutoSnapshot' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'name' => '<string>',
        'progress' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'sizeInGb' => <integer>,
        'state' => 'pending|error|available',
        'supportCode' => '<string>',
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
    ],
]

Result Details

Members
instanceSnapshot
Type: InstanceSnapshot structure

An array of key-value pairs containing information about the results of your get instance snapshot request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetInstanceSnapshots

$result = $client->getInstanceSnapshots([/* ... */]);
$promise = $client->getInstanceSnapshotsAsync([/* ... */]);

Returns all instance snapshots for the user's account.

Parameter Syntax

$result = $client->getInstanceSnapshots([
    'pageToken' => '<string>',
]);

Parameter Details

Members
pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetInstanceSnapshots request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'instanceSnapshots' => [
        [
            'arn' => '<string>',
            'createdAt' => <DateTime>,
            'fromAttachedDisks' => [
                [
                    'addOns' => [
                        [
                            'duration' => '<string>',
                            'name' => '<string>',
                            'nextSnapshotTimeOfDay' => '<string>',
                            'snapshotTimeOfDay' => '<string>',
                            'status' => '<string>',
                            'threshold' => '<string>',
                        ],
                        // ...
                    ],
                    'arn' => '<string>',
                    'attachedTo' => '<string>',
                    'attachmentState' => '<string>',
                    'autoMountStatus' => 'Failed|Pending|Mounted|NotMounted',
                    'createdAt' => <DateTime>,
                    'gbInUse' => <integer>,
                    'iops' => <integer>,
                    'isAttached' => true || false,
                    'isSystemDisk' => true || false,
                    'location' => [
                        'availabilityZone' => '<string>',
                        'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
                    ],
                    'name' => '<string>',
                    'path' => '<string>',
                    'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
                    'sizeInGb' => <integer>,
                    'state' => 'pending|error|available|in-use|unknown',
                    'supportCode' => '<string>',
                    'tags' => [
                        [
                            'key' => '<string>',
                            'value' => '<string>',
                        ],
                        // ...
                    ],
                ],
                // ...
            ],
            'fromBlueprintId' => '<string>',
            'fromBundleId' => '<string>',
            'fromInstanceArn' => '<string>',
            'fromInstanceName' => '<string>',
            'isFromAutoSnapshot' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'progress' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'sizeInGb' => <integer>,
            'state' => 'pending|error|available',
            'supportCode' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
instanceSnapshots
Type: Array of InstanceSnapshot structures

An array of key-value pairs containing information about the results of your get instance snapshots request.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetInstanceSnapshots request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetInstanceState

$result = $client->getInstanceState([/* ... */]);
$promise = $client->getInstanceStateAsync([/* ... */]);

Returns the state of a specific instance. Works on one instance at a time.

Parameter Syntax

$result = $client->getInstanceState([
    'instanceName' => '<string>', // REQUIRED
]);

Parameter Details

Members
instanceName
Required: Yes
Type: string

The name of the instance to get state information about.

Result Syntax

[
    'state' => [
        'code' => <integer>,
        'name' => '<string>',
    ],
]

Result Details

Members
state
Type: InstanceState structure

The state of the instance.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetInstances

$result = $client->getInstances([/* ... */]);
$promise = $client->getInstancesAsync([/* ... */]);

Returns information about all Amazon Lightsail virtual private servers, or instances.

Parameter Syntax

$result = $client->getInstances([
    'pageToken' => '<string>',
]);

Parameter Details

Members
pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetInstances request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'instances' => [
        [
            'addOns' => [
                [
                    'duration' => '<string>',
                    'name' => '<string>',
                    'nextSnapshotTimeOfDay' => '<string>',
                    'snapshotTimeOfDay' => '<string>',
                    'status' => '<string>',
                    'threshold' => '<string>',
                ],
                // ...
            ],
            'arn' => '<string>',
            'blueprintId' => '<string>',
            'blueprintName' => '<string>',
            'bundleId' => '<string>',
            'createdAt' => <DateTime>,
            'hardware' => [
                'cpuCount' => <integer>,
                'disks' => [
                    [
                        'addOns' => [
                            [
                                'duration' => '<string>',
                                'name' => '<string>',
                                'nextSnapshotTimeOfDay' => '<string>',
                                'snapshotTimeOfDay' => '<string>',
                                'status' => '<string>',
                                'threshold' => '<string>',
                            ],
                            // ...
                        ],
                        'arn' => '<string>',
                        'attachedTo' => '<string>',
                        'attachmentState' => '<string>',
                        'autoMountStatus' => 'Failed|Pending|Mounted|NotMounted',
                        'createdAt' => <DateTime>,
                        'gbInUse' => <integer>,
                        'iops' => <integer>,
                        'isAttached' => true || false,
                        'isSystemDisk' => true || false,
                        'location' => [
                            'availabilityZone' => '<string>',
                            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
                        ],
                        'name' => '<string>',
                        'path' => '<string>',
                        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
                        'sizeInGb' => <integer>,
                        'state' => 'pending|error|available|in-use|unknown',
                        'supportCode' => '<string>',
                        'tags' => [
                            [
                                'key' => '<string>',
                                'value' => '<string>',
                            ],
                            // ...
                        ],
                    ],
                    // ...
                ],
                'ramSizeInGb' => <float>,
            ],
            'ipAddressType' => 'dualstack|ipv4|ipv6',
            'ipv6Addresses' => ['<string>', ...],
            'isStaticIp' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'metadataOptions' => [
                'httpEndpoint' => 'disabled|enabled',
                'httpProtocolIpv6' => 'disabled|enabled',
                'httpPutResponseHopLimit' => <integer>,
                'httpTokens' => 'optional|required',
                'state' => 'pending|applied',
            ],
            'name' => '<string>',
            'networking' => [
                'monthlyTransfer' => [
                    'gbPerMonthAllocated' => <integer>,
                ],
                'ports' => [
                    [
                        'accessDirection' => 'inbound|outbound',
                        'accessFrom' => '<string>',
                        'accessType' => 'Public|Private',
                        'cidrListAliases' => ['<string>', ...],
                        'cidrs' => ['<string>', ...],
                        'commonName' => '<string>',
                        'fromPort' => <integer>,
                        'ipv6Cidrs' => ['<string>', ...],
                        'protocol' => 'tcp|all|udp|icmp|icmpv6',
                        'toPort' => <integer>,
                    ],
                    // ...
                ],
            ],
            'privateIpAddress' => '<string>',
            'publicIpAddress' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'sshKeyName' => '<string>',
            'state' => [
                'code' => <integer>,
                'name' => '<string>',
            ],
            'supportCode' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
            'username' => '<string>',
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
instances
Type: Array of Instance structures

An array of key-value pairs containing information about your instances.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetInstances request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetKeyPair

$result = $client->getKeyPair([/* ... */]);
$promise = $client->getKeyPairAsync([/* ... */]);

Returns information about a specific key pair.

Parameter Syntax

$result = $client->getKeyPair([
    'keyPairName' => '<string>', // REQUIRED
]);

Parameter Details

Members
keyPairName
Required: Yes
Type: string

The name of the key pair for which you are requesting information.

Result Syntax

[
    'keyPair' => [
        'arn' => '<string>',
        'createdAt' => <DateTime>,
        'fingerprint' => '<string>',
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'name' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'supportCode' => '<string>',
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
    ],
]

Result Details

Members
keyPair
Type: KeyPair structure

An array of key-value pairs containing information about the key pair.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetKeyPairs

$result = $client->getKeyPairs([/* ... */]);
$promise = $client->getKeyPairsAsync([/* ... */]);

Returns information about all key pairs in the user's account.

Parameter Syntax

$result = $client->getKeyPairs([
    'includeDefaultKeyPair' => true || false,
    'pageToken' => '<string>',
]);

Parameter Details

Members
includeDefaultKeyPair
Type: boolean

A Boolean value that indicates whether to include the default key pair in the response of your request.

pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetKeyPairs request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'keyPairs' => [
        [
            'arn' => '<string>',
            'createdAt' => <DateTime>,
            'fingerprint' => '<string>',
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'supportCode' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
keyPairs
Type: Array of KeyPair structures

An array of key-value pairs containing information about the key pairs.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetKeyPairs request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetLoadBalancer

$result = $client->getLoadBalancer([/* ... */]);
$promise = $client->getLoadBalancerAsync([/* ... */]);

Returns information about the specified Lightsail load balancer.

Parameter Syntax

$result = $client->getLoadBalancer([
    'loadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
loadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[
    'loadBalancer' => [
        'arn' => '<string>',
        'configurationOptions' => ['<string>', ...],
        'createdAt' => <DateTime>,
        'dnsName' => '<string>',
        'healthCheckPath' => '<string>',
        'httpsRedirectionEnabled' => true || false,
        'instanceHealthSummary' => [
            [
                'instanceHealth' => 'initial|healthy|unhealthy|unused|draining|unavailable',
                'instanceHealthReason' => 'Lb.RegistrationInProgress|Lb.InitialHealthChecking|Lb.InternalError|Instance.ResponseCodeMismatch|Instance.Timeout|Instance.FailedHealthChecks|Instance.NotRegistered|Instance.NotInUse|Instance.DeregistrationInProgress|Instance.InvalidState|Instance.IpUnusable',
                'instanceName' => '<string>',
            ],
            // ...
        ],
        'instancePort' => <integer>,
        'ipAddressType' => 'dualstack|ipv4|ipv6',
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'name' => '<string>',
        'protocol' => 'HTTP_HTTPS|HTTP',
        'publicPorts' => [<integer>, ...],
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'state' => 'active|provisioning|active_impaired|failed|unknown',
        'supportCode' => '<string>',
        'tags' => [
            [
                'key' => '<string>',
                'value' => '<string>',
            ],
            // ...
        ],
        'tlsCertificateSummaries' => [
            [
                'isAttached' => true || false,
                'name' => '<string>',
            ],
            // ...
        ],
        'tlsPolicyName' => '<string>',
    ],
]

Result Details

Members
loadBalancer
Type: LoadBalancer structure

An object containing information about your load balancer.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetLoadBalancerMetricData

$result = $client->getLoadBalancerMetricData([/* ... */]);
$promise = $client->getLoadBalancerMetricDataAsync([/* ... */]);

Returns information about health metrics for your Lightsail load balancer.

Metrics report the utilization of your resources, and the error counts generated by them. Monitor and collect metric data regularly to maintain the reliability, availability, and performance of your resources.

Parameter Syntax

$result = $client->getLoadBalancerMetricData([
    'endTime' => <integer || string || DateTime>, // REQUIRED
    'loadBalancerName' => '<string>', // REQUIRED
    'metricName' => 'ClientTLSNegotiationErrorCount|HealthyHostCount|UnhealthyHostCount|HTTPCode_LB_4XX_Count|HTTPCode_LB_5XX_Count|HTTPCode_Instance_2XX_Count|HTTPCode_Instance_3XX_Count|HTTPCode_Instance_4XX_Count|HTTPCode_Instance_5XX_Count|InstanceResponseTime|RejectedConnectionCount|RequestCount', // REQUIRED
    'period' => <integer>, // REQUIRED
    'startTime' => <integer || string || DateTime>, // REQUIRED
    'statistics' => ['<string>', ...], // REQUIRED
    'unit' => 'Seconds|Microseconds|Milliseconds|Bytes|Kilobytes|Megabytes|Gigabytes|Terabytes|Bits|Kilobits|Megabits|Gigabits|Terabits|Percent|Count|Bytes/Second|Kilobytes/Second|Megabytes/Second|Gigabytes/Second|Terabytes/Second|Bits/Second|Kilobits/Second|Megabits/Second|Gigabits/Second|Terabits/Second|Count/Second|None', // REQUIRED
]);

Parameter Details

Members
endTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The end time of the period.

loadBalancerName
Required: Yes
Type: string

The name of the load balancer.

metricName
Required: Yes
Type: string

The metric for which you want to return information.

Valid load balancer metric names are listed below, along with the most useful statistics to include in your request, and the published unit value.

  • ClientTLSNegotiationErrorCount - The number of TLS connections initiated by the client that did not establish a session with the load balancer due to a TLS error generated by the load balancer. Possible causes include a mismatch of ciphers or protocols.

    Statistics: The most useful statistic is Sum.

    Unit: The published unit is Count.

  • HealthyHostCount - The number of target instances that are considered healthy.

    Statistics: The most useful statistic are Average, Minimum, and Maximum.

    Unit: The published unit is Count.

  • HTTPCode_Instance_2XX_Count - The number of HTTP 2XX response codes generated by the target instances. This does not include any response codes generated by the load balancer.

    Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    Unit: The published unit is Count.

  • HTTPCode_Instance_3XX_Count - The number of HTTP 3XX response codes generated by the target instances. This does not include any response codes generated by the load balancer.

    Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    Unit: The published unit is Count.

  • HTTPCode_Instance_4XX_Count - The number of HTTP 4XX response codes generated by the target instances. This does not include any response codes generated by the load balancer.

    Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    Unit: The published unit is Count.

  • HTTPCode_Instance_5XX_Count - The number of HTTP 5XX response codes generated by the target instances. This does not include any response codes generated by the load balancer.

    Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    Unit: The published unit is Count.

  • HTTPCode_LB_4XX_Count - The number of HTTP 4XX client error codes that originated from the load balancer. Client errors are generated when requests are malformed or incomplete. These requests were not received by the target instance. This count does not include response codes generated by the target instances.

    Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    Unit: The published unit is Count.

  • HTTPCode_LB_5XX_Count - The number of HTTP 5XX server error codes that originated from the load balancer. This does not include any response codes generated by the target instance. This metric is reported if there are no healthy instances attached to the load balancer, or if the request rate exceeds the capacity of the instances (spillover) or the load balancer.

    Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    Unit: The published unit is Count.

  • InstanceResponseTime - The time elapsed, in seconds, after the request leaves the load balancer until a response from the target instance is received.

    Statistics: The most useful statistic is Average.

    Unit: The published unit is Seconds.

  • RejectedConnectionCount - The number of connections that were rejected because the load balancer had reached its maximum number of connections.

    Statistics: The most useful statistic is Sum.

    Unit: The published unit is Count.

  • RequestCount - The number of requests processed over IPv4. This count includes only the requests with a response generated by a target instance of the load balancer.

    Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    Unit: The published unit is Count.

  • UnhealthyHostCount - The number of target instances that are considered unhealthy.

    Statistics: The most useful statistic are Average, Minimum, and Maximum.

    Unit: The published unit is Count.

period
Required: Yes
Type: int

The granularity, in seconds, of the returned data points.

startTime
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The start time of the period.

statistics
Required: Yes
Type: Array of strings

The statistic for the metric.

The following statistics are available:

  • Minimum - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.

  • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

  • Sum - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.

  • Average - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.

  • SampleCount - The count, or number, of data points used for the statistical calculation.

unit
Required: Yes
Type: string

The unit for the metric data request. Valid units depend on the metric data being requested. For the valid units with each available metric, see the metricName parameter.

Result Syntax

[
    'metricData' => [
        [
            'average' => <float>,
            'maximum' => <float>,
            'minimum' => <float>,
            'sampleCount' => <float>,
            'sum' => <float>,
            'timestamp' => <DateTime>,
            'unit' => 'Seconds|Microseconds|Milliseconds|Bytes|Kilobytes|Megabytes|Gigabytes|Terabytes|Bits|Kilobits|Megabits|Gigabits|Terabits|Percent|Count|Bytes/Second|Kilobytes/Second|Megabytes/Second|Gigabytes/Second|Terabytes/Second|Bits/Second|Kilobits/Second|Megabits/Second|Gigabits/Second|Terabits/Second|Count/Second|None',
        ],
        // ...
    ],
    'metricName' => 'ClientTLSNegotiationErrorCount|HealthyHostCount|UnhealthyHostCount|HTTPCode_LB_4XX_Count|HTTPCode_LB_5XX_Count|HTTPCode_Instance_2XX_Count|HTTPCode_Instance_3XX_Count|HTTPCode_Instance_4XX_Count|HTTPCode_Instance_5XX_Count|InstanceResponseTime|RejectedConnectionCount|RequestCount',
]

Result Details

Members
metricData
Type: Array of MetricDatapoint structures

An array of objects that describe the metric data returned.

metricName
Type: string

The name of the metric returned.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetLoadBalancerTlsCertificates

$result = $client->getLoadBalancerTlsCertificates([/* ... */]);
$promise = $client->getLoadBalancerTlsCertificatesAsync([/* ... */]);

Returns information about the TLS certificates that are associated with the specified Lightsail load balancer.

TLS is just an updated, more secure version of Secure Socket Layer (SSL).

You can have a maximum of 2 certificates associated with a Lightsail load balancer. One is active and the other is inactive.

Parameter Syntax

$result = $client->getLoadBalancerTlsCertificates([
    'loadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
loadBalancerName
Required: Yes
Type: string

The name of the load balancer you associated with your SSL/TLS certificate.

Result Syntax

[
    'tlsCertificates' => [
        [
            'arn' => '<string>',
            'createdAt' => <DateTime>,
            'domainName' => '<string>',
            'domainValidationRecords' => [
                [
                    'dnsRecordCreationState' => [
                        'code' => 'SUCCEEDED|STARTED|FAILED',
                        'message' => '<string>',
                    ],
                    'domainName' => '<string>',
                    'name' => '<string>',
                    'type' => '<string>',
                    'validationStatus' => 'PENDING_VALIDATION|FAILED|SUCCESS',
                    'value' => '<string>',
                ],
                // ...
            ],
            'failureReason' => 'NO_AVAILABLE_CONTACTS|ADDITIONAL_VERIFICATION_REQUIRED|DOMAIN_NOT_ALLOWED|INVALID_PUBLIC_DOMAIN|OTHER',
            'isAttached' => true || false,
            'issuedAt' => <DateTime>,
            'issuer' => '<string>',
            'keyAlgorithm' => '<string>',
            'loadBalancerName' => '<string>',
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'notAfter' => <DateTime>,
            'notBefore' => <DateTime>,
            'renewalSummary' => [
                'domainValidationOptions' => [
                    [
                        'domainName' => '<string>',
                        'validationStatus' => 'PENDING_VALIDATION|FAILED|SUCCESS',
                    ],
                    // ...
                ],
                'renewalStatus' => 'PENDING_AUTO_RENEWAL|PENDING_VALIDATION|SUCCESS|FAILED',
            ],
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'revocationReason' => 'UNSPECIFIED|KEY_COMPROMISE|CA_COMPROMISE|AFFILIATION_CHANGED|SUPERCEDED|CESSATION_OF_OPERATION|CERTIFICATE_HOLD|REMOVE_FROM_CRL|PRIVILEGE_WITHDRAWN|A_A_COMPROMISE',
            'revokedAt' => <DateTime>,
            'serial' => '<string>',
            'signatureAlgorithm' => '<string>',
            'status' => 'PENDING_VALIDATION|ISSUED|INACTIVE|EXPIRED|VALIDATION_TIMED_OUT|REVOKED|FAILED|UNKNOWN',
            'subject' => '<string>',
            'subjectAlternativeNames' => ['<string>', ...],
            'supportCode' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
        ],
        // ...
    ],
]

Result Details

Members
tlsCertificates
Type: Array of LoadBalancerTlsCertificate structures

An array of LoadBalancerTlsCertificate objects describing your SSL/TLS certificates.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetLoadBalancerTlsPolicies

$result = $client->getLoadBalancerTlsPolicies([/* ... */]);
$promise = $client->getLoadBalancerTlsPoliciesAsync([/* ... */]);

Returns a list of TLS security policies that you can apply to Lightsail load balancers.

For more information about load balancer TLS security policies, see Configuring TLS security policies on your Amazon Lightsail load balancers in the Amazon Lightsail Developer Guide.

Parameter Syntax

$result = $client->getLoadBalancerTlsPolicies([
    'pageToken' => '<string>',
]);

Parameter Details

Members
pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetLoadBalancerTlsPolicies request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'nextPageToken' => '<string>',
    'tlsPolicies' => [
        [
            'ciphers' => ['<string>', ...],
            'description' => '<string>',
            'isDefault' => true || false,
            'name' => '<string>',
            'protocols' => ['<string>', ...],
        ],
        // ...
    ],
]

Result Details

Members
nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetLoadBalancerTlsPolicies request and specify the next page token using the pageToken parameter.

tlsPolicies
Type: Array of LoadBalancerTlsPolicy structures

An array of objects that describe the TLS security policies that are available.

Errors

ServiceException:

A general service exception.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

GetLoadBalancers

$result = $client->getLoadBalancers([/* ... */]);
$promise = $client->getLoadBalancersAsync([/* ... */]);

Returns information about all load balancers in an account.

Parameter Syntax

$result = $client->getLoadBalancers([
    'pageToken' => '<string>',
]);

Parameter Details

Members
pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetLoadBalancers request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'loadBalancers' => [
        [
            'arn' => '<string>',
            'configurationOptions' => ['<string>', ...],
            'createdAt' => <DateTime>,
            'dnsName' => '<string>',
            'healthCheckPath' => '<string>',
            'httpsRedirectionEnabled' => true || false,
            'instanceHealthSummary' => [
                [
                    'instanceHealth' => 'initial|healthy|unhealthy|unused|draining|unavailable',
                    'instanceHealthReason' => 'Lb.RegistrationInProgress|Lb.InitialHealthChecking|Lb.InternalError|Instance.ResponseCodeMismatch|Instance.Timeout|Instance.FailedHealthChecks|Instance.NotRegistered|Instance.NotInUse|Instance.DeregistrationInProgress|Instance.InvalidState|Instance.IpUnusable',
                    'instanceName' => '<string>',
                ],
                // ...
            ],
            'instancePort' => <integer>,
            'ipAddressType' => 'dualstack|ipv4|ipv6',
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'name' => '<string>',
            'protocol' => 'HTTP_HTTPS|HTTP',
            'publicPorts' => [<integer>, ...],
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'state' => 'active|provisioning|active_impaired|failed|unknown',
            'supportCode' => '<string>',
            'tags' => [
                [
                    'key' => '<string>',
                    'value' => '<string>',
                ],
                // ...
            ],
            'tlsCertificateSummaries' => [
                [
                    'isAttached' => true || false,
                    'name' => '<string>',
                ],
                // ...
            ],
            'tlsPolicyName' => '<string>',
        ],
        // ...
    ],
    'nextPageToken' => '<string>',
]

Result Details

Members
loadBalancers
Type: Array of LoadBalancer structures

An array of LoadBalancer objects describing your load balancers.

nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetLoadBalancers request and specify the next page token using the pageToken parameter.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetOperation

$result = $client->getOperation([/* ... */]);
$promise = $client->getOperationAsync([/* ... */]);

Returns information about a specific operation. Operations include events such as when you create an instance, allocate a static IP, attach a static IP, and so on.

Parameter Syntax

$result = $client->getOperation([
    'operationId' => '<string>', // REQUIRED
]);

Parameter Details

Members
operationId
Required: Yes
Type: string

A GUID used to identify the operation.

Result Syntax

[
    'operation' => [
        'createdAt' => <DateTime>,
        'errorCode' => '<string>',
        'errorDetails' => '<string>',
        'id' => '<string>',
        'isTerminal' => true || false,
        'location' => [
            'availabilityZone' => '<string>',
            'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
        ],
        'operationDetails' => '<string>',
        'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
        'resourceName' => '<string>',
        'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
        'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
        'statusChangedAt' => <DateTime>,
    ],
]

Result Details

Members
operation
Type: Operation structure

An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.

Errors

ServiceException:

A general service exception.

InvalidInputException:

Lightsail throws this exception when user input does not conform to the validation rules of an input field.

Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

NotFoundException:

Lightsail throws this exception when it cannot find a resource.

OperationFailureException:

Lightsail throws this exception when an operation fails to execute.

AccessDeniedException:

Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

AccountSetupInProgressException:

Lightsail throws this exception when an account is still in the setup in progress state.

UnauthenticatedException:

Lightsail throws this exception when the user has not been authenticated.

GetOperations

$result = $client->getOperations([/* ... */]);
$promise = $client->getOperationsAsync([/* ... */]);

Returns information about all operations.

Results are returned from oldest to newest, up to a maximum of 200. Results can be paged by making each subsequent call to GetOperations use the maximum (last) statusChangedAt value from the previous request.

Parameter Syntax

$result = $client->getOperations([
    'pageToken' => '<string>',
]);

Parameter Details

Members
pageToken
Type: string

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetOperations request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

Result Syntax

[
    'nextPageToken' => '<string>',
    'operations' => [
        [
            'createdAt' => <DateTime>,
            'errorCode' => '<string>',
            'errorDetails' => '<string>',
            'id' => '<string>',
            'isTerminal' => true || false,
            'location' => [
                'availabilityZone' => '<string>',
                'regionName' => 'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|ca-central-1|ap-south-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|eu-north-1',
            ],
            'operationDetails' => '<string>',
            'operationType' => 'DeleteKnownHostKeys|DeleteInstance|CreateInstance|StopInstance|StartInstance|RebootInstance|OpenInstancePublicPorts|PutInstancePublicPorts|CloseInstancePublicPorts|AllocateStaticIp|ReleaseStaticIp|AttachStaticIp|DetachStaticIp|UpdateDomainEntry|DeleteDomainEntry|CreateDomain|DeleteDomain|CreateInstanceSnapshot|DeleteInstanceSnapshot|CreateInstancesFromSnapshot|CreateLoadBalancer|DeleteLoadBalancer|AttachInstancesToLoadBalancer|DetachInstancesFromLoadBalancer|UpdateLoadBalancerAttribute|CreateLoadBalancerTlsCertificate|DeleteLoadBalancerTlsCertificate|AttachLoadBalancerTlsCertificate|CreateDisk|DeleteDisk|AttachDisk|DetachDisk|CreateDiskSnapshot|DeleteDiskSnapshot|CreateDiskFromSnapshot|CreateRelationalDatabase|UpdateRelationalDatabase|DeleteRelationalDatabase|CreateRelationalDatabaseFromSnapshot|CreateRelationalDatabaseSnapshot|DeleteRelationalDatabaseSnapshot|UpdateRelationalDatabaseParameters|StartRelationalDatabase|RebootRelationalDatabase|StopRelationalDatabase|EnableAddOn|DisableAddOn|PutAlarm|GetAlarms|DeleteAlarm|TestAlarm|CreateContactMethod|GetContactMethods|SendContactMethodVerification|DeleteContactMethod|CreateDistribution|UpdateDistribution|DeleteDistribution|ResetDistributionCache|AttachCertificateToDistribution|DetachCertificateFromDistribution|UpdateDistributionBundle|SetIpAddressType|CreateCertificate|DeleteCertificate|CreateContainerService|UpdateContainerService|DeleteContainerService|CreateContainerServiceDeployment|CreateContainerServiceRegistryLogin|RegisterContainerImage|DeleteContainerImage|CreateBucket|DeleteBucket|CreateBucketAccessKey|DeleteBucketAccessKey|UpdateBucketBundle|UpdateBucket|SetResourceAccessForBucket|UpdateInstanceMetadataOptions|StartGUISession|StopGUISession|SetupInstanceHttps',
            'resourceName' => '<string>',
            'resourceType' => 'ContainerService|Instance|StaticIp|KeyPair|InstanceSnapshot|Domain|PeeredVpc|LoadBalancer|LoadBalancerTlsCertificate|Disk|DiskSnapshot|RelationalDatabase|RelationalDatabaseSnapshot|ExportSnapshotRecord|CloudFormationStackRecord|Alarm|ContactMethod|Distribution|Certificate|Bucket',
            'status' => 'NotStarted|Started|Failed|Completed|Succeeded',
            'statusChangedAt' => <DateTime>,
        ],
        // ...
    ],
]

Result Details

Members
nextPageToken
Type: string

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetOperations request and specify the next page token using the pageToken parameter.

operations