Table of Contents
Lightsail.
Client
¶A low-level client representing Amazon Lightsail
Amazon Lightsail is the easiest way to get started with Amazon Web Services (Amazon Web Services) for developers who need to build websites or web applications. It includes everything you need to launch your project quickly - instances (virtual private servers), container services, storage buckets, managed databases, SSD-based block storage, static IP addresses, load balancers, content delivery network (CDN) distributions, DNS management of registered domains, and resource snapshots (backups) - for a low, predictable monthly price.
You can manage your Lightsail resources using the Lightsail console, Lightsail API, Command Line Interface (CLI), or SDKs. For more information about Lightsail concepts and tasks, see the Amazon Lightsail Developer Guide.
This API Reference provides detailed information about the actions, data types, parameters, and errors of the Lightsail service. For more information about the supported Amazon Web Services Regions, endpoints, and service quotas of the Lightsail service, see Amazon Lightsail Endpoints and Quotas in the Amazon Web Services General Reference .
import boto3
client = boto3.client('lightsail')
These are the available methods:
allocate_static_ip()
attach_certificate_to_distribution()
attach_disk()
attach_instances_to_load_balancer()
attach_load_balancer_tls_certificate()
attach_static_ip()
can_paginate()
close()
close_instance_public_ports()
copy_snapshot()
create_bucket()
create_bucket_access_key()
create_certificate()
create_cloud_formation_stack()
create_contact_method()
create_container_service()
create_container_service_deployment()
create_container_service_registry_login()
create_disk()
create_disk_from_snapshot()
create_disk_snapshot()
create_distribution()
create_domain()
create_domain_entry()
create_instance_snapshot()
create_instances()
create_instances_from_snapshot()
create_key_pair()
create_load_balancer()
create_load_balancer_tls_certificate()
create_relational_database()
create_relational_database_from_snapshot()
create_relational_database_snapshot()
delete_alarm()
delete_auto_snapshot()
delete_bucket()
delete_bucket_access_key()
delete_certificate()
delete_contact_method()
delete_container_image()
delete_container_service()
delete_disk()
delete_disk_snapshot()
delete_distribution()
delete_domain()
delete_domain_entry()
delete_instance()
delete_instance_snapshot()
delete_key_pair()
delete_known_host_keys()
delete_load_balancer()
delete_load_balancer_tls_certificate()
delete_relational_database()
delete_relational_database_snapshot()
detach_certificate_from_distribution()
detach_disk()
detach_instances_from_load_balancer()
detach_static_ip()
disable_add_on()
download_default_key_pair()
enable_add_on()
export_snapshot()
get_active_names()
get_alarms()
get_auto_snapshots()
get_blueprints()
get_bucket_access_keys()
get_bucket_bundles()
get_bucket_metric_data()
get_buckets()
get_bundles()
get_certificates()
get_cloud_formation_stack_records()
get_contact_methods()
get_container_api_metadata()
get_container_images()
get_container_log()
get_container_service_deployments()
get_container_service_metric_data()
get_container_service_powers()
get_container_services()
get_disk()
get_disk_snapshot()
get_disk_snapshots()
get_disks()
get_distribution_bundles()
get_distribution_latest_cache_reset()
get_distribution_metric_data()
get_distributions()
get_domain()
get_domains()
get_export_snapshot_records()
get_instance()
get_instance_access_details()
get_instance_metric_data()
get_instance_port_states()
get_instance_snapshot()
get_instance_snapshots()
get_instance_state()
get_instances()
get_key_pair()
get_key_pairs()
get_load_balancer()
get_load_balancer_metric_data()
get_load_balancer_tls_certificates()
get_load_balancer_tls_policies()
get_load_balancers()
get_operation()
get_operations()
get_operations_for_resource()
get_paginator()
get_regions()
get_relational_database()
get_relational_database_blueprints()
get_relational_database_bundles()
get_relational_database_events()
get_relational_database_log_events()
get_relational_database_log_streams()
get_relational_database_master_user_password()
get_relational_database_metric_data()
get_relational_database_parameters()
get_relational_database_snapshot()
get_relational_database_snapshots()
get_relational_databases()
get_static_ip()
get_static_ips()
get_waiter()
import_key_pair()
is_vpc_peered()
open_instance_public_ports()
peer_vpc()
put_alarm()
put_instance_public_ports()
reboot_instance()
reboot_relational_database()
register_container_image()
release_static_ip()
reset_distribution_cache()
send_contact_method_verification()
set_ip_address_type()
set_resource_access_for_bucket()
start_instance()
start_relational_database()
stop_instance()
stop_relational_database()
tag_resource()
test_alarm()
unpeer_vpc()
untag_resource()
update_bucket()
update_bucket_bundle()
update_container_service()
update_distribution()
update_distribution_bundle()
update_domain_entry()
update_instance_metadata_options()
update_load_balancer_attribute()
update_relational_database()
update_relational_database_parameters()
allocate_static_ip
(**kwargs)¶Allocates a static IP address.
See also: AWS API Documentation
Request Syntax
response = client.allocate_static_ip(
staticIpName='string'
)
[REQUIRED]
The name of the static IP address.
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response 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.
Describes the API operation.
The ID of the operation.
The resource name.
The resource type.
The timestamp when the operation was initialized (e.g., 1479816991.349
).
The Amazon Web Services Region and Availability Zone.
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
The Amazon Web Services Region name.
A Boolean value indicating whether the operation is terminal.
Details about the operation (e.g., Debian-1GB-Ohio-1
).
The type of operation.
The status of the operation.
The timestamp when the status was changed (e.g., 1479816991.349
).
The error code.
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
attach_certificate_to_distribution
(**kwargs)¶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.
Warning
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.
See also: AWS API Documentation
Request Syntax
response = client.attach_certificate_to_distribution(
distributionName='string',
certificateName='string'
)
[REQUIRED]
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.
[REQUIRED]
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.
Note
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
.
dict
Response Syntax
{
'operation': {
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
}
}
Response Structure
(dict) --
operation (dict) --
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.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.UnauthenticatedException
attach_disk
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.attach_disk(
diskName='string',
instanceName='string',
diskPath='string'
)
[REQUIRED]
The unique Lightsail disk name (e.g., my-disk
).
[REQUIRED]
The name of the Lightsail instance where you want to utilize the storage disk.
[REQUIRED]
The disk path to expose to the instance (e.g., /dev/xvdf
).
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
attach_instances_to_load_balancer
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.attach_instances_to_load_balancer(
loadBalancerName='string',
instanceNames=[
'string',
]
)
[REQUIRED]
The name of the load balancer.
[REQUIRED]
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).
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
attach_load_balancer_tls_certificate
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.attach_load_balancer_tls_certificate(
loadBalancerName='string',
certificateName='string'
)
[REQUIRED]
The name of the load balancer to which you want to associate the SSL/TLS certificate.
[REQUIRED]
The name of your SSL/TLS certificate.
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
attach_static_ip
(**kwargs)¶Attaches a static IP address to a specific Amazon Lightsail instance.
See also: AWS API Documentation
Request Syntax
response = client.attach_static_ip(
staticIpName='string',
instanceName='string'
)
[REQUIRED]
The name of the static IP.
[REQUIRED]
The instance name to which you want to attach the static IP address.
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
can_paginate
(operation_name)¶Check if an operation can be paginated.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.True
if the operation can be paginated,
False
otherwise.close
()¶Closes underlying endpoint connections.
close_instance_public_ports
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.close_instance_public_ports(
portInfo={
'fromPort': 123,
'toPort': 123,
'protocol': 'tcp'|'all'|'udp'|'icmp',
'cidrs': [
'string',
],
'ipv6Cidrs': [
'string',
],
'cidrListAliases': [
'string',
]
},
instanceName='string'
)
[REQUIRED]
An object to describe the ports to close for the specified instance.
The first port in a range of open ports on an instance.
Allowed ports:
0
to 65535
8
as the fromPort
(ICMP type), and -1
as the toPort
(ICMP code), to enable ICMP Ping. For more information, see Control Messages on Wikipedia .128
as the fromPort
(ICMPv6 type), and 0
as toPort
(ICMPv6 code). For more information, see Internet Control Message Protocol for IPv6.The last port in a range of open ports on an instance.
Allowed ports:
0
to 65535
8
as the fromPort
(ICMP type), and -1
as the toPort
(ICMP code), to enable ICMP Ping. For more information, see Control Messages on Wikipedia .128
as the fromPort
(ICMPv6 type), and 0
as toPort
(ICMPv6 code). For more information, see Internet Control Message Protocol for IPv6.The IP protocol name.
The name can be one of the following:
tcp
- Transmission Control Protocol (TCP) provides reliable, ordered, and error-checked delivery of streamed data between applications running on hosts communicating by an IP network. If you have an application that doesn't require reliable data stream service, use UDP instead.all
- All transport layer protocol types. For more general information, see Transport layer on Wikipedia .udp
- With User Datagram Protocol (UDP), computer applications can send messages (or datagrams) to other hosts on an Internet Protocol (IP) network. Prior communications are not required to set up transmission channels or data paths. Applications that don't require reliable data stream service can use UDP, which provides a connectionless datagram service that emphasizes reduced latency over reliability. If you do require reliable data stream service, use TCP instead.icmp
- Internet Control Message Protocol (ICMP) is used to send error messages and operational information indicating success or failure when communicating with an instance. For example, an error is indicated when an instance could not be reached. When you specify icmp
as the protocol
, you must specify the ICMP type using the fromPort
parameter, and ICMP code using the toPort
parameter.The IPv4 address, or range of IPv4 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol.
Note
The ipv6Cidrs
parameter lists the IPv6 addresses that are allowed to connect to an instance.
Examples:
192.0.2.44
, specify 192.0.2.44
or 192.0.2.44/32
.192.0.2.0
to 192.0.2.255
, specify 192.0.2.0/24
.For more information about CIDR block notation, see Classless Inter-Domain Routing on Wikipedia .
The IPv6 address, or range of IPv6 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol. Only devices with an IPv6 address can connect to an instance through IPv6; otherwise, IPv4 should be used.
Note
The cidrs
parameter lists the IPv4 addresses that are allowed to connect to an instance.
For more information about CIDR block notation, see Classless Inter-Domain Routing on Wikipedia .
An alias that defines access for a preconfigured range of IP addresses.
The only alias currently supported is lightsail-connect
, which allows IP addresses of the browser-based RDP/SSH client in the Lightsail console to connect to your instance.
[REQUIRED]
The name of the instance for which to close ports.
dict
Response Syntax
{
'operation': {
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
}
}
Response Structure
(dict) --
operation (dict) --
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.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
copy_snapshot
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.copy_snapshot(
sourceSnapshotName='string',
sourceResourceName='string',
restoreDate='string',
useLatestRestorableAutoSnapshot=True|False,
targetSnapshotName='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'
)
The name of the source manual snapshot to copy.
Constraint:
The name of the source instance or disk from which the source automatic snapshot was created.
Constraint:
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:
YYYY-MM-DD
format.use latest restorable auto snapshot
parameter. The restore date
and use latest restorable auto snapshot
parameters are mutually exclusive.A Boolean value to indicate whether to use the latest available automatic snapshot of the specified source instance or disk.
Constraints:
restore date
parameter. The use latest restorable auto snapshot
and restore date
parameters are mutually exclusive.[REQUIRED]
The name of the new manual snapshot to be created as a copy.
[REQUIRED]
The Amazon Web Services Region where the source manual or automatic snapshot is located.
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_bucket
(**kwargs)¶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 .
See also: AWS API Documentation
Request Syntax
response = client.create_bucket(
bucketName='string',
bundleId='string',
tags=[
{
'key': 'string',
'value': 'string'
},
],
enableObjectVersioning=True|False
)
[REQUIRED]
The name for the bucket.
For more information about bucket names, see Bucket naming rules in Amazon Lightsail in the Amazon Lightsail Developer Guide .
[REQUIRED]
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.
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
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 .
dict
Response Syntax
{
'bucket': {
'resourceType': 'string',
'accessRules': {
'getObject': 'public'|'private',
'allowPublicOverrides': True|False
},
'arn': 'string',
'bundleId': 'string',
'createdAt': datetime(2015, 1, 1),
'url': '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',
'supportCode': 'string',
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'objectVersioning': 'string',
'ableToUpdateBundle': True|False,
'readonlyAccessAccounts': [
'string',
],
'resourcesReceivingAccess': [
{
'name': 'string',
'resourceType': 'string'
},
],
'state': {
'code': 'string',
'message': 'string'
},
'accessLogConfig': {
'enabled': True|False,
'destination': 'string',
'prefix': 'string'
}
},
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
bucket (dict) --
An object that describes the bucket that is created.
resourceType (string) --
The Lightsail resource type of the bucket (for example, Bucket
).
accessRules (dict) --
An object that describes the access rules of the bucket.
getObject (string) --
Specifies the anonymous access to all objects in a bucket.
The following options can be specified:
public
- Sets all objects in the bucket to public (read-only), making them readable by anyone in the world. If the getObject
value is set to public
, then all objects in the bucket default to public regardless of the allowPublicOverrides
value.private
- Sets all objects in the bucket to private, making them readable only by you or anyone you give access to. If the getObject
value is set to private
, and the allowPublicOverrides
value is set to true
, then all objects in the bucket default to private unless they are configured with a public-read
ACL. Individual objects with a public-read
ACL are readable by anyone in the world.allowPublicOverrides (boolean) --
A Boolean value that indicates whether the access control list (ACL) permissions that are applied to individual objects override the getObject
option that is currently specified.
When this is true, you can use the PutObjectAcl Amazon S3 API action to set individual objects to public (read-only) using the public-read
ACL, or to private using the private
ACL.
arn (string) --
The Amazon Resource Name (ARN) of the bucket.
bundleId (string) --
The ID of the bundle currently applied to the bucket.
A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket.
Use the UpdateBucketBundle action to change the bundle of a bucket.
createdAt (datetime) --
The timestamp when the distribution was created.
url (string) --
The URL of the bucket.
location (dict) --
An object that describes the location of the bucket, such as the Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
name (string) --
The name of the bucket.
supportCode (string) --
The support code for a bucket. Include this code in your email to support when you have questions about a Lightsail bucket. This code enables our support team to look up your Lightsail information more easily.
tags (list) --
The tag keys and optional values for the bucket. For more information, see Tags in Amazon Lightsail in the Amazon Lightsail Developer Guide .
(dict) --
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
key (string) --
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
value (string) --
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
objectVersioning (string) --
Indicates whether object versioning is enabled for the bucket.
The following options can be configured:
Enabled
- Object versioning is enabled.Suspended
- Object versioning was previously enabled but is currently suspended. Existing object versions are retained.NeverEnabled
- Object versioning has never been enabled.ableToUpdateBundle (boolean) --
Indicates whether the bundle that is currently applied to a bucket can be changed to another bundle.
You can update a bucket's bundle only one time within a monthly Amazon Web Services billing cycle.
Use the UpdateBucketBundle action to change a bucket's bundle.
readonlyAccessAccounts (list) --
An array of strings that specify the Amazon Web Services account IDs that have read-only access to the bucket.
resourcesReceivingAccess (list) --
An array of objects that describe Lightsail instances that have access to the bucket.
Use the SetResourceAccessForBucket action to update the instances that have access to a bucket.
(dict) --
Describes an Amazon Lightsail instance that has access to a Lightsail bucket.
name (string) --
The name of the Lightsail instance.
resourceType (string) --
The Lightsail resource type (for example, Instance
).
state (dict) --
An object that describes the state of the bucket.
code (string) --
The state code of the bucket.
The following codes are possible:
OK
- The bucket is in a running state.Unknown
- Creation of the bucket might have timed-out. You might want to delete the bucket and create a new one.message (string) --
A message that describes the state of the bucket.
accessLogConfig (dict) --
An object that describes the access log configuration for the bucket.
enabled (boolean) --
A Boolean value that indicates whether bucket access logging is enabled for the bucket.
destination (string) --
The name of the bucket where the access logs are saved. The destination can be a Lightsail bucket in the same account, and in the same Amazon Web Services Region as the source bucket.
Note
This parameter is required when enabling the access log for a bucket, and should be omitted when disabling the access log.
prefix (string) --
The optional object prefix for the bucket access log.
The prefix is an optional addition to the object key that organizes your access log files in the destination bucket. For example, if you specify a logs/
prefix, then each log object will begin with the logs/
prefix in its key (for example, logs/2021-11-01-21-32-16-E568B2907131C0C0
).
Note
This parameter can be optionally specified when enabling the access log for a bucket, and should be omitted when disabling the access log.
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.UnauthenticatedException
create_bucket_access_key
(**kwargs)¶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 .
Warning
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.
See also: AWS API Documentation
Request Syntax
response = client.create_bucket_access_key(
bucketName='string'
)
[REQUIRED]
The name of the bucket that the new access key will belong to, and grant access to.
{
'accessKey': {
'accessKeyId': 'string',
'secretAccessKey': 'string',
'status': 'Active'|'Inactive',
'createdAt': datetime(2015, 1, 1),
'lastUsed': {
'lastUsedDate': datetime(2015, 1, 1),
'region': 'string',
'serviceName': 'string'
}
},
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
An object that describes the access key that is created.
The ID of the access key.
The secret access key used to sign requests.
You should store the secret access key in a safe location. We recommend that you delete the access key if the secret access key is compromised.
The status of the access key.
A status of Active
means that the key is valid, while Inactive
means it is not.
The timestamp when the access key was created.
An object that describes the last time the access key was used.
Note
This object does not include data in the response of a CreateBucketAccessKey action. If the access key has not been used, the region
and serviceName
values are N/A
, and the lastUsedDate
value is null.
The date and time when the access key was most recently used.
This value is null if the access key has not been used.
The Amazon Web Services Region where this access key was most recently used.
This value is N/A
if the access key has not been used.
The name of the Amazon Web Services service with which this access key was most recently used.
This value is N/A
if the access key has not been used.
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.
Describes the API operation.
The ID of the operation.
The resource name.
The resource type.
The timestamp when the operation was initialized (e.g., 1479816991.349
).
The Amazon Web Services Region and Availability Zone.
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
The Amazon Web Services Region name.
A Boolean value indicating whether the operation is terminal.
Details about the operation (e.g., Debian-1GB-Ohio-1
).
The type of operation.
The status of the operation.
The timestamp when the status was changed (e.g., 1479816991.349
).
The error code.
The error details.
Exceptions
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.UnauthenticatedException
create_certificate
(**kwargs)¶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.
Warning
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.
See also: AWS API Documentation
Request Syntax
response = client.create_certificate(
certificateName='string',
domainName='string',
subjectAlternativeNames=[
'string',
],
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The name for the certificate.
[REQUIRED]
The domain name (e.g., example.com
) for the certificate.
An array of strings that specify the alternate domains (e.g., example2.com
) and subdomains (e.g., 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 (e.g., *.example.com
) are not supported.
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
dict
Response Syntax
{
'certificate': {
'certificateArn': 'string',
'certificateName': 'string',
'domainName': 'string',
'certificateDetail': {
'arn': 'string',
'name': 'string',
'domainName': 'string',
'status': 'PENDING_VALIDATION'|'ISSUED'|'INACTIVE'|'EXPIRED'|'VALIDATION_TIMED_OUT'|'REVOKED'|'FAILED',
'serialNumber': 'string',
'subjectAlternativeNames': [
'string',
],
'domainValidationRecords': [
{
'domainName': 'string',
'resourceRecord': {
'name': 'string',
'type': 'string',
'value': 'string'
},
'dnsRecordCreationState': {
'code': 'SUCCEEDED'|'STARTED'|'FAILED',
'message': 'string'
},
'validationStatus': 'PENDING_VALIDATION'|'FAILED'|'SUCCESS'
},
],
'requestFailureReason': 'string',
'inUseResourceCount': 123,
'keyAlgorithm': 'string',
'createdAt': datetime(2015, 1, 1),
'issuedAt': datetime(2015, 1, 1),
'issuerCA': 'string',
'notBefore': datetime(2015, 1, 1),
'notAfter': datetime(2015, 1, 1),
'eligibleToRenew': 'string',
'renewalSummary': {
'domainValidationRecords': [
{
'domainName': 'string',
'resourceRecord': {
'name': 'string',
'type': 'string',
'value': 'string'
},
'dnsRecordCreationState': {
'code': 'SUCCEEDED'|'STARTED'|'FAILED',
'message': 'string'
},
'validationStatus': 'PENDING_VALIDATION'|'FAILED'|'SUCCESS'
},
],
'renewalStatus': 'PendingAutoRenewal'|'PendingValidation'|'Success'|'Failed',
'renewalStatusReason': 'string',
'updatedAt': datetime(2015, 1, 1)
},
'revokedAt': datetime(2015, 1, 1),
'revocationReason': 'string',
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'supportCode': 'string'
},
'tags': [
{
'key': 'string',
'value': 'string'
},
]
},
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
certificate (dict) --
An object that describes the certificate created.
certificateArn (string) --
The Amazon Resource Name (ARN) of the certificate.
certificateName (string) --
The name of the certificate.
domainName (string) --
The domain name of the certificate.
certificateDetail (dict) --
An object that describes a certificate in detail.
arn (string) --
The Amazon Resource Name (ARN) of the certificate.
name (string) --
The name of the certificate (e.g., my-certificate
).
domainName (string) --
The domain name of the certificate.
status (string) --
The validation status of the certificate.
serialNumber (string) --
The serial number of the certificate.
subjectAlternativeNames (list) --
An array of strings that specify the alternate domains (e.g., example2.com
) and subdomains (e.g., blog.example.com
) of the certificate.
domainValidationRecords (list) --
An array of objects that describe the domain validation records of the certificate.
(dict) --
Describes the domain name system (DNS) records that you must add to the DNS of your registered domain to validate ownership for an Amazon Lightsail SSL/TLS certificate.
domainName (string) --
The domain name of the certificate validation record. For example, example.com
or www.example.com
.
resourceRecord (dict) --
An object that describes the DNS records to add to your domain's DNS to validate it for the certificate.
name (string) --
The name of the record.
type (string) --
The DNS record type.
value (string) --
The value for the DNS record.
dnsRecordCreationState (dict) --
An object that describes the state of the canonical name (CNAME) records that are automatically added by Lightsail to the DNS of the domain to validate domain ownership.
code (string) --
The status code for the automated DNS record creation.
Following are the possible values:
SUCCEEDED
- The validation records were successfully added to the domain.STARTED
- The automatic DNS record creation has started.FAILED
- The validation records failed to be added to the domain.message (string) --
The message that describes the reason for the status code.
validationStatus (string) --
The validation status of the record.
requestFailureReason (string) --
The validation failure reason, if any, of the certificate.
The following failure reasons are possible:
NO_AVAILABLE_CONTACTS
- This failure applies to email validation, which is not available for Lightsail certificates.ADDITIONAL_VERIFICATION_REQUIRED
- Lightsail requires additional information to process this certificate request. This can happen as a fraud-protection measure, such as when the domain ranks within the Alexa top 1000 websites. To provide the required information, use the Amazon Web Services Support Center to contact Amazon Web Services Support.Note
You cannot request a certificate for Amazon-owned domain names such as those ending in amazonaws.com, cloudfront.net, or elasticbeanstalk.com.
DOMAIN_NOT_ALLOWED
- One or more of the domain names in the certificate request was reported as an unsafe domain by VirusTotal. To correct the problem, search for your domain name on the VirusTotal website. If your domain is reported as suspicious, see Google Help for Hacked Websites to learn what you can do. If you believe that the result is a false positive, notify the organization that is reporting the domain. VirusTotal is an aggregate of several antivirus and URL scanners and cannot remove your domain from a block list itself. After you correct the problem and the VirusTotal registry has been updated, request a new certificate. If you see this error and your domain is not included in the VirusTotal list, visit the Amazon Web Services Support Center and create a case.INVALID_PUBLIC_DOMAIN
- One or more of the domain names in the certificate request is not valid. Typically, this is because a domain name in the request is not a valid top-level domain. Try to request a certificate again, correcting any spelling errors or typos that were in the failed request, and ensure that all domain names in the request are for valid top-level domains. For example, you cannot request a certificate for example.invalidpublicdomain
because invalidpublicdomain
is not a valid top-level domain.OTHER
- Typically, this failure occurs when there is a typographical error in one or more of the domain names in the certificate request. Try to request a certificate again, correcting any spelling errors or typos that were in the failed request.inUseResourceCount (integer) --
The number of Lightsail resources that the certificate is attached to.
keyAlgorithm (string) --
The algorithm used to generate the key pair (the public and private key) of the certificate.
createdAt (datetime) --
The timestamp when the certificate was created.
issuedAt (datetime) --
The timestamp when the certificate was issued.
issuerCA (string) --
The certificate authority that issued the certificate.
notBefore (datetime) --
The timestamp when the certificate is first valid.
notAfter (datetime) --
The timestamp when the certificate expires.
eligibleToRenew (string) --
The renewal eligibility of the certificate.
renewalSummary (dict) --
An object that describes the status of the certificate renewal managed by Lightsail.
domainValidationRecords (list) --
An array of objects that describe the domain validation records of the certificate.
(dict) --
Describes the domain name system (DNS) records that you must add to the DNS of your registered domain to validate ownership for an Amazon Lightsail SSL/TLS certificate.
domainName (string) --
The domain name of the certificate validation record. For example, example.com
or www.example.com
.
resourceRecord (dict) --
An object that describes the DNS records to add to your domain's DNS to validate it for the certificate.
name (string) --
The name of the record.
type (string) --
The DNS record type.
value (string) --
The value for the DNS record.
dnsRecordCreationState (dict) --
An object that describes the state of the canonical name (CNAME) records that are automatically added by Lightsail to the DNS of the domain to validate domain ownership.
code (string) --
The status code for the automated DNS record creation.
Following are the possible values:
SUCCEEDED
- The validation records were successfully added to the domain.STARTED
- The automatic DNS record creation has started.FAILED
- The validation records failed to be added to the domain.message (string) --
The message that describes the reason for the status code.
validationStatus (string) --
The validation status of the record.
renewalStatus (string) --
The renewal status of the certificate.
The following renewal status are possible:
PendingAutoRenewal
- Lightsail is attempting to automatically validate the domain names of the certificate. No further action is required.PendingValidation
- Lightsail couldn't automatically validate one or more domain names of the certificate. You must take action to validate these domain names or the certificate won't be renewed. Check to make sure your certificate's domain validation records exist in your domain's DNS, and that your certificate remains in use.Success
- All domain names in the certificate are validated, and Lightsail renewed the certificate. No further action is required.Failed
- One or more domain names were not validated before the certificate expired, and Lightsail did not renew the certificate. You can request a new certificate using the CreateCertificate
action.renewalStatusReason (string) --
The reason for the renewal status of the certificate.
updatedAt (datetime) --
The timestamp when the certificate was last updated.
revokedAt (datetime) --
The timestamp when the certificate was revoked. This value is present only when the certificate status is REVOKED
.
revocationReason (string) --
The reason the certificate was revoked. This value is present only when the certificate status is REVOKED
.
tags (list) --
The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
(dict) --
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
key (string) --
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
value (string) --
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
supportCode (string) --
The support code. Include this code in your email to support when you have questions about your Lightsail certificate. This code enables our support team to look up your Lightsail information more easily.
tags (list) --
The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
(dict) --
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
key (string) --
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
value (string) --
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.UnauthenticatedException
create_cloud_formation_stack
(**kwargs)¶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.
Warning
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.
See also: AWS API Documentation
Request Syntax
response = client.create_cloud_formation_stack(
instances=[
{
'sourceName': 'string',
'instanceType': 'string',
'portInfoSource': 'DEFAULT'|'INSTANCE'|'NONE'|'CLOSED',
'userData': 'string',
'availabilityZone': 'string'
},
]
)
[REQUIRED]
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.
Describes the Amazon Elastic Compute Cloud instance and related resources to be created using the create cloud formation stack
operation.
The name of the export snapshot record, which contains the exported Lightsail instance snapshot that will be used as the source of the new Amazon EC2 instance.
Use the get export snapshot records
operation to get a list of export snapshot records that you can use to create a CloudFormation stack.
The instance type (e.g., t2.micro
) to use for the new Amazon EC2 instance.
The port configuration to use for the new Amazon EC2 instance.
The following configuration options are available:
DEFAULT
- Use the default firewall settings from the Lightsail instance blueprint. If this is specified, then IPv4 and IPv6 will be configured for the new instance that is created in Amazon EC2.INSTANCE
- Use the configured firewall settings from the source Lightsail instance. If this is specified, the new instance that is created in Amazon EC2 will be configured to match the configuration of the source Lightsail instance. For example, if the source instance is configured for dual-stack (IPv4 and IPv6), then IPv4 and IPv6 will be configured for the new instance that is created in Amazon EC2. If the source instance is configured for IPv4 only, then only IPv4 will be configured for the new instance that is created in Amazon EC2.NONE
- Use the default Amazon EC2 security group. If this is specified, then only IPv4 will be configured for the new instance that is created in Amazon EC2.CLOSED
- All ports closed. If this is specified, then only IPv4 will be configured for the new instance that is created in Amazon EC2.Note
If you configured lightsail-connect
as a cidrListAliases
on your instance, or if you chose to allow the Lightsail browser-based SSH or RDP clients to connect to your instance, that configuration is not carried over to your new Amazon EC2 instance.
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
.
Note
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
.
The Availability Zone for the new Amazon EC2 instance.
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response 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.
Describes the API operation.
The ID of the operation.
The resource name.
The resource type.
The timestamp when the operation was initialized (e.g., 1479816991.349
).
The Amazon Web Services Region and Availability Zone.
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
The Amazon Web Services Region name.
A Boolean value indicating whether the operation is terminal.
Details about the operation (e.g., Debian-1GB-Ohio-1
).
The type of operation.
The status of the operation.
The timestamp when the status was changed (e.g., 1479816991.349
).
The error code.
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_contact_method
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_contact_method(
protocol='Email'|'SMS',
contactEndpoint='string'
)
[REQUIRED]
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-1
)us-west-2
)eu-west-1
)ap-northeast-1
)ap-southeast-1
)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.
[REQUIRED]
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 .
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.UnauthenticatedException
create_container_service
(**kwargs)¶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 .
See also: AWS API Documentation
Request Syntax
response = client.create_container_service(
serviceName='string',
power='nano'|'micro'|'small'|'medium'|'large'|'xlarge',
scale=123,
tags=[
{
'key': 'string',
'value': 'string'
},
],
publicDomainNames={
'string': [
'string',
]
},
deployment={
'containers': {
'string': {
'image': 'string',
'command': [
'string',
],
'environment': {
'string': 'string'
},
'ports': {
'string': 'HTTP'|'HTTPS'|'TCP'|'UDP'
}
}
},
'publicEndpoint': {
'containerName': 'string',
'containerPort': 123,
'healthCheck': {
'healthyThreshold': 123,
'unhealthyThreshold': 123,
'timeoutSeconds': 123,
'intervalSeconds': 123,
'path': 'string',
'successCodes': 'string'
}
}
},
privateRegistryAccess={
'ecrImagePullerRole': {
'isActive': True|False
}
}
)
[REQUIRED]
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:
[REQUIRED]
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.
[REQUIRED]
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.
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
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.
Warning
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.
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.
An object that describes the configuration for the containers of the deployment.
Describes the settings of a container that will be launched, or that is launched, to an Amazon Lightsail container service.
The name of the image used for the container.
Container images sourced from your Lightsail container service, that are registered and stored on your service, start with a colon ( :
). For example, if your container service name is container-service-1
, the container image label is mystaticsite
, and you want to use the third ( 3
) version of the registered container image, then you should specify :container-service-1.mystaticsite.3
. To use the latest version of a container image, specify latest
instead of a version number (for example, :container-service-1.mystaticsite.latest
). Lightsail will automatically use the highest numbered version of the registered container image.
Container images sourced from a public registry like Docker Hub don't start with a colon. For example, nginx:latest
or nginx
.
The launch command for the container.
The environment variables of the container.
The open firewall ports of the container.
An object that describes the endpoint of the deployment.
The name of the container for the endpoint.
The port of the container to which traffic is forwarded to.
An object that describes the health check configuration of the container.
The number of consecutive health checks successes required before moving the container to the Healthy
state. The default value is 2
.
The number of consecutive health check failures required before moving the container to the Unhealthy
state. The default value is 2
.
The amount of time, in seconds, during which no response means a failed health check. You can specify between 2 and 60 seconds. The default value is 2
.
The approximate interval, in seconds, between health checks of an individual container. You can specify between 5 and 300 seconds. The default value is 5
.
The path on the container on which to perform the health check. The default value is /
.
The HTTP codes to use when checking for a successful response from a container. You can specify values between 200
and 499
. You can specify multiple values (for example, 200,202
) or a range of values (for example, 200-299
).
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 .
An object to describe a request to activate or deactivate the role that you can use to grant an Amazon Lightsail container service access to Amazon Elastic Container Registry (Amazon ECR) private repositories.
A Boolean value that indicates whether to activate the role.
dict
Response Syntax
{
'containerService': {
'containerServiceName': 'string',
'arn': 'string',
'createdAt': datetime(2015, 1, 1),
'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'
},
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'power': 'nano'|'micro'|'small'|'medium'|'large'|'xlarge',
'powerId': 'string',
'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'
},
'scale': 123,
'currentDeployment': {
'version': 123,
'state': 'ACTIVATING'|'ACTIVE'|'INACTIVE'|'FAILED',
'containers': {
'string': {
'image': 'string',
'command': [
'string',
],
'environment': {
'string': 'string'
},
'ports': {
'string': 'HTTP'|'HTTPS'|'TCP'|'UDP'
}
}
},
'publicEndpoint': {
'containerName': 'string',
'containerPort': 123,
'healthCheck': {
'healthyThreshold': 123,
'unhealthyThreshold': 123,
'timeoutSeconds': 123,
'intervalSeconds': 123,
'path': 'string',
'successCodes': 'string'
}
},
'createdAt': datetime(2015, 1, 1)
},
'nextDeployment': {
'version': 123,
'state': 'ACTIVATING'|'ACTIVE'|'INACTIVE'|'FAILED',
'containers': {
'string': {
'image': 'string',
'command': [
'string',
],
'environment': {
'string': 'string'
},
'ports': {
'string': 'HTTP'|'HTTPS'|'TCP'|'UDP'
}
}
},
'publicEndpoint': {
'containerName': 'string',
'containerPort': 123,
'healthCheck': {
'healthyThreshold': 123,
'unhealthyThreshold': 123,
'timeoutSeconds': 123,
'intervalSeconds': 123,
'path': 'string',
'successCodes': 'string'
}
},
'createdAt': datetime(2015, 1, 1)
},
'isDisabled': True|False,
'principalArn': 'string',
'privateDomainName': 'string',
'publicDomainNames': {
'string': [
'string',
]
},
'url': 'string',
'privateRegistryAccess': {
'ecrImagePullerRole': {
'isActive': True|False,
'principalArn': 'string'
}
}
}
}
Response Structure
(dict) --
containerService (dict) --
An object that describes a container service.
containerServiceName (string) --
The name of the container service.
arn (string) --
The Amazon Resource Name (ARN) of the container service.
createdAt (datetime) --
The timestamp when the container service was created.
location (dict) --
An object that describes the location of the container service, such as the Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
resourceType (string) --
The Lightsail resource type of the container service (i.e., ContainerService
).
tags (list) --
The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
(dict) --
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
key (string) --
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
value (string) --
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
power (string) --
The power specification of the container service.
The power specifies the amount of RAM, the number of vCPUs, and the base price of the container service.
powerId (string) --
The ID of the power of the container service.
state (string) --
The current state of the container service.
The following container service states are possible:
PENDING
- The container service is being created.READY
- The container service is running but it does not have an active container deployment.DEPLOYING
- The container service is launching a container deployment.RUNNING
- The container service is running and it has an active container deployment.UPDATING
- The container service capacity or its custom domains are being updated.DELETING
- The container service is being deleted.DISABLED
- The container service is disabled, and its active deployment and containers, if any, are shut down.stateDetail (dict) --
An object that describes the current state of the container service.
Note
The state detail is populated only when a container service is in a PENDING
, DEPLOYING
, or UPDATING
state.
code (string) --
The state code of the container service.
The following state codes are possible:
DEPLOYING
or UPDATING
state:CREATING_SYSTEM_RESOURCES
- The system resources for your container service are being created.CREATING_NETWORK_INFRASTRUCTURE
- The network infrastructure for your container service are being created.PROVISIONING_CERTIFICATE
- The SSL/TLS certificate for your container service is being created.PROVISIONING_SERVICE
- Your container service is being provisioned.CREATING_DEPLOYMENT
- Your deployment is being created on your container service.EVALUATING_HEALTH_CHECK
- The health of your deployment is being evaluated.ACTIVATING_DEPLOYMENT
- Your deployment is being activated.PENDING
state:CERTIFICATE_LIMIT_EXCEEDED
- The SSL/TLS certificate required for your container service exceeds the maximum number of certificates allowed for your account.UNKNOWN_ERROR
- An error was experienced when your container service was being created.message (string) --
A message that provides more information for the state code.
Note
The state detail is populated only when a container service is in a PENDING
, DEPLOYING
, or UPDATING
state.
scale (integer) --
The scale specification of the container service.
The scale specifies the allocated compute nodes of the container service.
currentDeployment (dict) --
An object that describes the current container deployment of the container service.
version (integer) --
The version number of the deployment.
state (string) --
The state of the deployment.
A deployment can be in one of the following states:
Activating
- The deployment is being created.Active
- The deployment was successfully created, and it's currently running on the container service. The container service can have only one deployment in an active state at a time.Inactive
- The deployment was previously successfully created, but it is not currently running on the container service.Failed
- The deployment failed. Use the GetContainerLog
action to view the log events for the containers in the deployment to try to determine the reason for the failure.containers (dict) --
An object that describes the configuration for the containers of the deployment.
(string) --
(dict) --
Describes the settings of a container that will be launched, or that is launched, to an Amazon Lightsail container service.
image (string) --
The name of the image used for the container.
Container images sourced from your Lightsail container service, that are registered and stored on your service, start with a colon ( :
). For example, if your container service name is container-service-1
, the container image label is mystaticsite
, and you want to use the third ( 3
) version of the registered container image, then you should specify :container-service-1.mystaticsite.3
. To use the latest version of a container image, specify latest
instead of a version number (for example, :container-service-1.mystaticsite.latest
). Lightsail will automatically use the highest numbered version of the registered container image.
Container images sourced from a public registry like Docker Hub don't start with a colon. For example, nginx:latest
or nginx
.
command (list) --
The launch command for the container.
environment (dict) --
The environment variables of the container.
ports (dict) --
The open firewall ports of the container.
publicEndpoint (dict) --
An object that describes the endpoint of the deployment.
containerName (string) --
The name of the container entry of the deployment that the endpoint configuration applies to.
containerPort (integer) --
The port of the specified container to which traffic is forwarded to.
healthCheck (dict) --
An object that describes the health check configuration of the container.
healthyThreshold (integer) --
The number of consecutive health checks successes required before moving the container to the Healthy
state. The default value is 2
.
unhealthyThreshold (integer) --
The number of consecutive health check failures required before moving the container to the Unhealthy
state. The default value is 2
.
timeoutSeconds (integer) --
The amount of time, in seconds, during which no response means a failed health check. You can specify between 2 and 60 seconds. The default value is 2
.
intervalSeconds (integer) --
The approximate interval, in seconds, between health checks of an individual container. You can specify between 5 and 300 seconds. The default value is 5
.
path (string) --
The path on the container on which to perform the health check. The default value is /
.
successCodes (string) --
The HTTP codes to use when checking for a successful response from a container. You can specify values between 200
and 499
. You can specify multiple values (for example, 200,202
) or a range of values (for example, 200-299
).
createdAt (datetime) --
The timestamp when the deployment was created.
nextDeployment (dict) --
An object that describes the next deployment of the container service.
This value is null
when there is no deployment in a pending
state.
version (integer) --
The version number of the deployment.
state (string) --
The state of the deployment.
A deployment can be in one of the following states:
Activating
- The deployment is being created.Active
- The deployment was successfully created, and it's currently running on the container service. The container service can have only one deployment in an active state at a time.Inactive
- The deployment was previously successfully created, but it is not currently running on the container service.Failed
- The deployment failed. Use the GetContainerLog
action to view the log events for the containers in the deployment to try to determine the reason for the failure.containers (dict) --
An object that describes the configuration for the containers of the deployment.
(string) --
(dict) --
Describes the settings of a container that will be launched, or that is launched, to an Amazon Lightsail container service.
image (string) --
The name of the image used for the container.
Container images sourced from your Lightsail container service, that are registered and stored on your service, start with a colon ( :
). For example, if your container service name is container-service-1
, the container image label is mystaticsite
, and you want to use the third ( 3
) version of the registered container image, then you should specify :container-service-1.mystaticsite.3
. To use the latest version of a container image, specify latest
instead of a version number (for example, :container-service-1.mystaticsite.latest
). Lightsail will automatically use the highest numbered version of the registered container image.
Container images sourced from a public registry like Docker Hub don't start with a colon. For example, nginx:latest
or nginx
.
command (list) --
The launch command for the container.
environment (dict) --
The environment variables of the container.
ports (dict) --
The open firewall ports of the container.
publicEndpoint (dict) --
An object that describes the endpoint of the deployment.
containerName (string) --
The name of the container entry of the deployment that the endpoint configuration applies to.
containerPort (integer) --
The port of the specified container to which traffic is forwarded to.
healthCheck (dict) --
An object that describes the health check configuration of the container.
healthyThreshold (integer) --
The number of consecutive health checks successes required before moving the container to the Healthy
state. The default value is 2
.
unhealthyThreshold (integer) --
The number of consecutive health check failures required before moving the container to the Unhealthy
state. The default value is 2
.
timeoutSeconds (integer) --
The amount of time, in seconds, during which no response means a failed health check. You can specify between 2 and 60 seconds. The default value is 2
.
intervalSeconds (integer) --
The approximate interval, in seconds, between health checks of an individual container. You can specify between 5 and 300 seconds. The default value is 5
.
path (string) --
The path on the container on which to perform the health check. The default value is /
.
successCodes (string) --
The HTTP codes to use when checking for a successful response from a container. You can specify values between 200
and 499
. You can specify multiple values (for example, 200,202
) or a range of values (for example, 200-299
).
createdAt (datetime) --
The timestamp when the deployment was created.
isDisabled (boolean) --
A Boolean value indicating whether the container service is disabled.
principalArn (string) --
The principal ARN of the container service.
The principal ARN can be used to create a trust relationship between your standard Amazon Web Services account and your Lightsail container service. This allows you to give your service permission to access resources in your standard Amazon Web Services account.
privateDomainName (string) --
The private domain name of the container service.
The private domain name is accessible only by other resources within the default virtual private cloud (VPC) of your Lightsail account.
publicDomainNames (dict) --
The public domain name of 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.
Warning
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.
See CreateContainerService
or UpdateContainerService
for information about how to specify public domain names for your Lightsail container service.
url (string) --
The publicly accessible URL of the container service.
If no public endpoint is specified in the currentDeployment
, this URL returns a 404 response.
privateRegistryAccess (dict) --
An object that describes 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 .
ecrImagePullerRole (dict) --
An object that describes the activation status of the role that you can use to grant a Lightsail container service access to Amazon ECR private repositories. If the role is activated, the Amazon Resource Name (ARN) of the role is also listed.
isActive (boolean) --
A Boolean value that indicates whether the role is activated.
principalArn (string) --
The Amazon Resource Name (ARN) of the role, if it is activated.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.UnauthenticatedException
create_container_service_deployment
(**kwargs)¶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 .
See also: AWS API Documentation
Request Syntax
response = client.create_container_service_deployment(
serviceName='string',
containers={
'string': {
'image': 'string',
'command': [
'string',
],
'environment': {
'string': 'string'
},
'ports': {
'string': 'HTTP'|'HTTPS'|'TCP'|'UDP'
}
}
},
publicEndpoint={
'containerName': 'string',
'containerPort': 123,
'healthCheck': {
'healthyThreshold': 123,
'unhealthyThreshold': 123,
'timeoutSeconds': 123,
'intervalSeconds': 123,
'path': 'string',
'successCodes': 'string'
}
}
)
[REQUIRED]
The name of the container service for which to create the deployment.
An object that describes the settings of the containers that will be launched on the container service.
Describes the settings of a container that will be launched, or that is launched, to an Amazon Lightsail container service.
The name of the image used for the container.
Container images sourced from your Lightsail container service, that are registered and stored on your service, start with a colon ( :
). For example, if your container service name is container-service-1
, the container image label is mystaticsite
, and you want to use the third ( 3
) version of the registered container image, then you should specify :container-service-1.mystaticsite.3
. To use the latest version of a container image, specify latest
instead of a version number (for example, :container-service-1.mystaticsite.latest
). Lightsail will automatically use the highest numbered version of the registered container image.
Container images sourced from a public registry like Docker Hub don't start with a colon. For example, nginx:latest
or nginx
.
The launch command for the container.
The environment variables of the container.
The open firewall ports of the container.
An object that describes the settings of the public endpoint for the container service.
The name of the container for the endpoint.
The port of the container to which traffic is forwarded to.
An object that describes the health check configuration of the container.
The number of consecutive health checks successes required before moving the container to the Healthy
state. The default value is 2
.
The number of consecutive health check failures required before moving the container to the Unhealthy
state. The default value is 2
.
The amount of time, in seconds, during which no response means a failed health check. You can specify between 2 and 60 seconds. The default value is 2
.
The approximate interval, in seconds, between health checks of an individual container. You can specify between 5 and 300 seconds. The default value is 5
.
The path on the container on which to perform the health check. The default value is /
.
The HTTP codes to use when checking for a successful response from a container. You can specify values between 200
and 499
. You can specify multiple values (for example, 200,202
) or a range of values (for example, 200-299
).
dict
Response Syntax
{
'containerService': {
'containerServiceName': 'string',
'arn': 'string',
'createdAt': datetime(2015, 1, 1),
'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'
},
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'power': 'nano'|'micro'|'small'|'medium'|'large'|'xlarge',
'powerId': 'string',
'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'
},
'scale': 123,
'currentDeployment': {
'version': 123,
'state': 'ACTIVATING'|'ACTIVE'|'INACTIVE'|'FAILED',
'containers': {
'string': {
'image': 'string',
'command': [
'string',
],
'environment': {
'string': 'string'
},
'ports': {
'string': 'HTTP'|'HTTPS'|'TCP'|'UDP'
}
}
},
'publicEndpoint': {
'containerName': 'string',
'containerPort': 123,
'healthCheck': {
'healthyThreshold': 123,
'unhealthyThreshold': 123,
'timeoutSeconds': 123,
'intervalSeconds': 123,
'path': 'string',
'successCodes': 'string'
}
},
'createdAt': datetime(2015, 1, 1)
},
'nextDeployment': {
'version': 123,
'state': 'ACTIVATING'|'ACTIVE'|'INACTIVE'|'FAILED',
'containers': {
'string': {
'image': 'string',
'command': [
'string',
],
'environment': {
'string': 'string'
},
'ports': {
'string': 'HTTP'|'HTTPS'|'TCP'|'UDP'
}
}
},
'publicEndpoint': {
'containerName': 'string',
'containerPort': 123,
'healthCheck': {
'healthyThreshold': 123,
'unhealthyThreshold': 123,
'timeoutSeconds': 123,
'intervalSeconds': 123,
'path': 'string',
'successCodes': 'string'
}
},
'createdAt': datetime(2015, 1, 1)
},
'isDisabled': True|False,
'principalArn': 'string',
'privateDomainName': 'string',
'publicDomainNames': {
'string': [
'string',
]
},
'url': 'string',
'privateRegistryAccess': {
'ecrImagePullerRole': {
'isActive': True|False,
'principalArn': 'string'
}
}
}
}
Response Structure
(dict) --
containerService (dict) --
An object that describes a container service.
containerServiceName (string) --
The name of the container service.
arn (string) --
The Amazon Resource Name (ARN) of the container service.
createdAt (datetime) --
The timestamp when the container service was created.
location (dict) --
An object that describes the location of the container service, such as the Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
resourceType (string) --
The Lightsail resource type of the container service (i.e., ContainerService
).
tags (list) --
The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
(dict) --
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
key (string) --
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
value (string) --
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
power (string) --
The power specification of the container service.
The power specifies the amount of RAM, the number of vCPUs, and the base price of the container service.
powerId (string) --
The ID of the power of the container service.
state (string) --
The current state of the container service.
The following container service states are possible:
PENDING
- The container service is being created.READY
- The container service is running but it does not have an active container deployment.DEPLOYING
- The container service is launching a container deployment.RUNNING
- The container service is running and it has an active container deployment.UPDATING
- The container service capacity or its custom domains are being updated.DELETING
- The container service is being deleted.DISABLED
- The container service is disabled, and its active deployment and containers, if any, are shut down.stateDetail (dict) --
An object that describes the current state of the container service.
Note
The state detail is populated only when a container service is in a PENDING
, DEPLOYING
, or UPDATING
state.
code (string) --
The state code of the container service.
The following state codes are possible:
DEPLOYING
or UPDATING
state:CREATING_SYSTEM_RESOURCES
- The system resources for your container service are being created.CREATING_NETWORK_INFRASTRUCTURE
- The network infrastructure for your container service are being created.PROVISIONING_CERTIFICATE
- The SSL/TLS certificate for your container service is being created.PROVISIONING_SERVICE
- Your container service is being provisioned.CREATING_DEPLOYMENT
- Your deployment is being created on your container service.EVALUATING_HEALTH_CHECK
- The health of your deployment is being evaluated.ACTIVATING_DEPLOYMENT
- Your deployment is being activated.PENDING
state:CERTIFICATE_LIMIT_EXCEEDED
- The SSL/TLS certificate required for your container service exceeds the maximum number of certificates allowed for your account.UNKNOWN_ERROR
- An error was experienced when your container service was being created.message (string) --
A message that provides more information for the state code.
Note
The state detail is populated only when a container service is in a PENDING
, DEPLOYING
, or UPDATING
state.
scale (integer) --
The scale specification of the container service.
The scale specifies the allocated compute nodes of the container service.
currentDeployment (dict) --
An object that describes the current container deployment of the container service.
version (integer) --
The version number of the deployment.
state (string) --
The state of the deployment.
A deployment can be in one of the following states:
Activating
- The deployment is being created.Active
- The deployment was successfully created, and it's currently running on the container service. The container service can have only one deployment in an active state at a time.Inactive
- The deployment was previously successfully created, but it is not currently running on the container service.Failed
- The deployment failed. Use the GetContainerLog
action to view the log events for the containers in the deployment to try to determine the reason for the failure.containers (dict) --
An object that describes the configuration for the containers of the deployment.
(string) --
(dict) --
Describes the settings of a container that will be launched, or that is launched, to an Amazon Lightsail container service.
image (string) --
The name of the image used for the container.
Container images sourced from your Lightsail container service, that are registered and stored on your service, start with a colon ( :
). For example, if your container service name is container-service-1
, the container image label is mystaticsite
, and you want to use the third ( 3
) version of the registered container image, then you should specify :container-service-1.mystaticsite.3
. To use the latest version of a container image, specify latest
instead of a version number (for example, :container-service-1.mystaticsite.latest
). Lightsail will automatically use the highest numbered version of the registered container image.
Container images sourced from a public registry like Docker Hub don't start with a colon. For example, nginx:latest
or nginx
.
command (list) --
The launch command for the container.
environment (dict) --
The environment variables of the container.
ports (dict) --
The open firewall ports of the container.
publicEndpoint (dict) --
An object that describes the endpoint of the deployment.
containerName (string) --
The name of the container entry of the deployment that the endpoint configuration applies to.
containerPort (integer) --
The port of the specified container to which traffic is forwarded to.
healthCheck (dict) --
An object that describes the health check configuration of the container.
healthyThreshold (integer) --
The number of consecutive health checks successes required before moving the container to the Healthy
state. The default value is 2
.
unhealthyThreshold (integer) --
The number of consecutive health check failures required before moving the container to the Unhealthy
state. The default value is 2
.
timeoutSeconds (integer) --
The amount of time, in seconds, during which no response means a failed health check. You can specify between 2 and 60 seconds. The default value is 2
.
intervalSeconds (integer) --
The approximate interval, in seconds, between health checks of an individual container. You can specify between 5 and 300 seconds. The default value is 5
.
path (string) --
The path on the container on which to perform the health check. The default value is /
.
successCodes (string) --
The HTTP codes to use when checking for a successful response from a container. You can specify values between 200
and 499
. You can specify multiple values (for example, 200,202
) or a range of values (for example, 200-299
).
createdAt (datetime) --
The timestamp when the deployment was created.
nextDeployment (dict) --
An object that describes the next deployment of the container service.
This value is null
when there is no deployment in a pending
state.
version (integer) --
The version number of the deployment.
state (string) --
The state of the deployment.
A deployment can be in one of the following states:
Activating
- The deployment is being created.Active
- The deployment was successfully created, and it's currently running on the container service. The container service can have only one deployment in an active state at a time.Inactive
- The deployment was previously successfully created, but it is not currently running on the container service.Failed
- The deployment failed. Use the GetContainerLog
action to view the log events for the containers in the deployment to try to determine the reason for the failure.containers (dict) --
An object that describes the configuration for the containers of the deployment.
(string) --
(dict) --
Describes the settings of a container that will be launched, or that is launched, to an Amazon Lightsail container service.
image (string) --
The name of the image used for the container.
Container images sourced from your Lightsail container service, that are registered and stored on your service, start with a colon ( :
). For example, if your container service name is container-service-1
, the container image label is mystaticsite
, and you want to use the third ( 3
) version of the registered container image, then you should specify :container-service-1.mystaticsite.3
. To use the latest version of a container image, specify latest
instead of a version number (for example, :container-service-1.mystaticsite.latest
). Lightsail will automatically use the highest numbered version of the registered container image.
Container images sourced from a public registry like Docker Hub don't start with a colon. For example, nginx:latest
or nginx
.
command (list) --
The launch command for the container.
environment (dict) --
The environment variables of the container.
ports (dict) --
The open firewall ports of the container.
publicEndpoint (dict) --
An object that describes the endpoint of the deployment.
containerName (string) --
The name of the container entry of the deployment that the endpoint configuration applies to.
containerPort (integer) --
The port of the specified container to which traffic is forwarded to.
healthCheck (dict) --
An object that describes the health check configuration of the container.
healthyThreshold (integer) --
The number of consecutive health checks successes required before moving the container to the Healthy
state. The default value is 2
.
unhealthyThreshold (integer) --
The number of consecutive health check failures required before moving the container to the Unhealthy
state. The default value is 2
.
timeoutSeconds (integer) --
The amount of time, in seconds, during which no response means a failed health check. You can specify between 2 and 60 seconds. The default value is 2
.
intervalSeconds (integer) --
The approximate interval, in seconds, between health checks of an individual container. You can specify between 5 and 300 seconds. The default value is 5
.
path (string) --
The path on the container on which to perform the health check. The default value is /
.
successCodes (string) --
The HTTP codes to use when checking for a successful response from a container. You can specify values between 200
and 499
. You can specify multiple values (for example, 200,202
) or a range of values (for example, 200-299
).
createdAt (datetime) --
The timestamp when the deployment was created.
isDisabled (boolean) --
A Boolean value indicating whether the container service is disabled.
principalArn (string) --
The principal ARN of the container service.
The principal ARN can be used to create a trust relationship between your standard Amazon Web Services account and your Lightsail container service. This allows you to give your service permission to access resources in your standard Amazon Web Services account.
privateDomainName (string) --
The private domain name of the container service.
The private domain name is accessible only by other resources within the default virtual private cloud (VPC) of your Lightsail account.
publicDomainNames (dict) --
The public domain name of 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.
Warning
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.
See CreateContainerService
or UpdateContainerService
for information about how to specify public domain names for your Lightsail container service.
url (string) --
The publicly accessible URL of the container service.
If no public endpoint is specified in the currentDeployment
, this URL returns a 404 response.
privateRegistryAccess (dict) --
An object that describes 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 .
ecrImagePullerRole (dict) --
An object that describes the activation status of the role that you can use to grant a Lightsail container service access to Amazon ECR private repositories. If the role is activated, the Amazon Resource Name (ARN) of the role is also listed.
isActive (boolean) --
A Boolean value that indicates whether the role is activated.
principalArn (string) --
The Amazon Resource Name (ARN) of the role, if it is activated.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.UnauthenticatedException
create_container_service_registry_login
()¶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.
Note
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.
Note
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 .
See also: AWS API Documentation
Request Syntax
response = client.create_container_service_registry_login()
{
'registryLogin': {
'username': 'string',
'password': 'string',
'expiresAt': datetime(2015, 1, 1),
'registry': 'string'
}
}
Response Structure
An object that describes the log in information for the container service registry of your Lightsail account.
The container service registry username to use to push container images to the container image registry of a Lightsail account.
The container service registry password to use to push container images to the container image registry of a Lightsail account
The timestamp of when the container image registry username and password expire.
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 using the CreateContainerServiceRegistryLogin
action.
The address to use to push container images to the container image registry of a Lightsail account.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.UnauthenticatedException
create_disk
(**kwargs)¶Creates a block storage disk that can be attached to an Amazon Lightsail instance in the same Availability Zone (e.g., us-east-2a
).
The create disk
operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.
See also: AWS API Documentation
Request Syntax
response = client.create_disk(
diskName='string',
availabilityZone='string',
sizeInGb=123,
tags=[
{
'key': 'string',
'value': 'string'
},
],
addOns=[
{
'addOnType': 'AutoSnapshot',
'autoSnapshotAddOnRequest': {
'snapshotTimeOfDay': 'string'
}
},
]
)
[REQUIRED]
The unique Lightsail disk name (e.g., my-disk
).
[REQUIRED]
The Availability Zone where you want to create the disk (e.g., 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.
[REQUIRED]
The size of the disk in GB (e.g., 32
).
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
An array of objects that represent the add-ons to enable for the new disk.
Describes a request to enable, modify, or disable an add-on for an Amazon Lightsail resource.
Note
An additional cost may be associated with enabling add-ons. For more information, see the Lightsail pricing page.
The add-on type.
An object that represents additional parameters when enabling or modifying the automatic snapshot add-on.
The daily time when an automatic snapshot will be created.
Constraints:
HH:00
format, and in an hourly increment.dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_disk_from_snapshot
(**kwargs)¶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 (e.g., 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.
See also: AWS API Documentation
Request Syntax
response = client.create_disk_from_snapshot(
diskName='string',
diskSnapshotName='string',
availabilityZone='string',
sizeInGb=123,
tags=[
{
'key': 'string',
'value': 'string'
},
],
addOns=[
{
'addOnType': 'AutoSnapshot',
'autoSnapshotAddOnRequest': {
'snapshotTimeOfDay': 'string'
}
},
],
sourceDiskName='string',
restoreDate='string',
useLatestRestorableAutoSnapshot=True|False
)
[REQUIRED]
The unique Lightsail disk name (e.g., my-disk
).
The name of the disk snapshot (e.g., my-snapshot
) from which to create the new storage disk.
Constraint:
source disk name
parameter. The disk snapshot name
and source disk name
parameters are mutually exclusive.[REQUIRED]
The Availability Zone where you want to create the disk (e.g., 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.
[REQUIRED]
The size of the disk in GB (e.g., 32
).
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
An array of objects that represent the add-ons to enable for the new disk.
Describes a request to enable, modify, or disable an add-on for an Amazon Lightsail resource.
Note
An additional cost may be associated with enabling add-ons. For more information, see the Lightsail pricing page.
The add-on type.
An object that represents additional parameters when enabling or modifying the automatic snapshot add-on.
The daily time when an automatic snapshot will be created.
Constraints:
HH:00
format, and in an hourly increment.The name of the source disk from which the source automatic snapshot was created.
Constraints:
disk snapshot name
parameter. The source disk name
and disk snapshot name
parameters are mutually exclusive.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:
YYYY-MM-DD
format.use latest restorable auto snapshot
parameter. The restore date
and use latest restorable auto snapshot
parameters are mutually exclusive.A Boolean value to indicate whether to use the latest available automatic snapshot.
Constraints:
restore date
parameter. The use latest restorable auto snapshot
and restore date
parameters are mutually exclusive.dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_disk_snapshot
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_disk_snapshot(
diskName='string',
diskSnapshotName='string',
instanceName='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
The unique name of the source disk (e.g., Disk-Virginia-1
).
Note
This parameter cannot be defined together with the instance name
parameter. The disk name
and instance name
parameters are mutually exclusive.
[REQUIRED]
The name of the destination disk snapshot (e.g., my-disk-snapshot
) based on the source disk.
The unique name of the source instance (e.g., Amazon_Linux-512MB-Virginia-1
). When this is defined, a snapshot of the instance's system volume is created.
Note
This parameter cannot be defined together with the disk name
parameter. The instance name
and disk name
parameters are mutually exclusive.
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_distribution
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_distribution(
distributionName='string',
origin={
'name': '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',
'protocolPolicy': 'http-only'|'https-only'
},
defaultCacheBehavior={
'behavior': 'dont-cache'|'cache'
},
cacheBehaviorSettings={
'defaultTTL': 123,
'minimumTTL': 123,
'maximumTTL': 123,
'allowedHTTPMethods': 'string',
'cachedHTTPMethods': 'string',
'forwardedCookies': {
'option': 'none'|'allow-list'|'all',
'cookiesAllowList': [
'string',
]
},
'forwardedHeaders': {
'option': 'none'|'allow-list'|'all',
'headersAllowList': [
'Accept'|'Accept-Charset'|'Accept-Datetime'|'Accept-Encoding'|'Accept-Language'|'Authorization'|'CloudFront-Forwarded-Proto'|'CloudFront-Is-Desktop-Viewer'|'CloudFront-Is-Mobile-Viewer'|'CloudFront-Is-SmartTV-Viewer'|'CloudFront-Is-Tablet-Viewer'|'CloudFront-Viewer-Country'|'Host'|'Origin'|'Referer',
]
},
'forwardedQueryStrings': {
'option': True|False,
'queryStringsAllowList': [
'string',
]
}
},
cacheBehaviors=[
{
'path': 'string',
'behavior': 'dont-cache'|'cache'
},
],
bundleId='string',
ipAddressType='dualstack'|'ipv4',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The name for the distribution.
[REQUIRED]
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.
The name of the origin resource.
The AWS Region name of the origin resource.
The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.
[REQUIRED]
An object that describes the default cache behavior for the distribution.
The cache behavior of the distribution.
The following cache behaviors can be specified:
cache
- This option is best for static sites. When specified, your distribution caches and serves your entire website as static content. This behavior is ideal for websites with static content that doesn't change depending on who views it, or for websites that don't use cookies, headers, or query strings to personalize content.dont-cache
- This option is best for sites that serve a mix of static and dynamic content. When specified, your distribution caches and serve only the content that is specified in the distribution's CacheBehaviorPerPath
parameter. This behavior is ideal for websites or web applications that use cookies, headers, and query strings to personalize content for individual users.An object that describes the cache behavior settings for the distribution.
The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.
Note
The value specified applies only when the origin does not add HTTP headers such as Cache-Control max-age
, Cache-Control s-maxage
, and Expires
to objects.
The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.
A value of 0
must be specified for minimumTTL
if the distribution is configured to forward all headers to the origin.
The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.
The value specified applies only when the origin adds HTTP headers such as Cache-Control max-age
, Cache-Control s-maxage
, and Expires
to objects.
The HTTP methods that are processed and forwarded to the distribution's origin.
You can specify the following options:
GET,HEAD
- The distribution forwards the GET
and HEAD
methods.GET,HEAD,OPTIONS
- The distribution forwards the GET
, HEAD
, and OPTIONS
methods.GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE
- The distribution forwards the GET
, HEAD
, OPTIONS
, PUT
, PATCH
, POST
, and DELETE
methods.If you specify the third option, you might need to restrict access to your distribution's origin so users can't perform operations that you don't want them to. For example, you might not want users to have permission to delete objects from your origin.
The HTTP method responses that are cached by your distribution.
You can specify the following options:
GET,HEAD
- The distribution caches responses to the GET
and HEAD
methods.GET,HEAD,OPTIONS
- The distribution caches responses to the GET
, HEAD
, and OPTIONS
methods.An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded.
Specifies which cookies to forward to the distribution's origin for a cache behavior: all
, none
, or allow-list
to forward only the cookies specified in the cookiesAllowList
parameter.
The specific cookies to forward to your distribution's origin.
An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded.
The headers that you want your distribution to forward to your origin and base caching on.
You can configure your distribution to do one of the following:
all
- Forward all headers to your origin.none
- Forward only the default headers.allow-list
- Forward only the headers you specify using the headersAllowList
parameter.The specific headers to forward to your distribution's origin.
An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded.
Indicates whether the distribution forwards and caches based on query strings.
The specific query strings that the distribution forwards to the origin.
Your distribution will cache content based on the specified query strings.
If the option
parameter is true, then your distribution forwards all query strings, regardless of what you specify using the queryStringsAllowList
parameter.
An array of objects that describe the per-path cache behavior for the distribution.
Describes the per-path cache behavior of an Amazon Lightsail content delivery network (CDN) distribution.
A per-path cache behavior is used to override, or add an exception to, the default cache behavior of a distribution. For example, if the cacheBehavior
is set to cache
, then a per-path cache behavior can be used to specify a directory, file, or file type that your distribution will cache. Alternately, if the distribution's cacheBehavior
is dont-cache
, then a per-path cache behavior can be used to specify a directory, file, or file type that your distribution will not cache.
The path to a directory or file to cached, or not cache. Use an asterisk symbol to specify wildcard directories ( path/to/assets/*
), and file types ( *.html, *jpg, *js
). Directories and file paths are case-sensitive.
Examples:
var/www/html/
var/www/html/index.html
var/www/html/*.html
var/www/html/images/*.jpg
var/www/html/images/*.png
var/www/html/images/*.gif
Specify the following to cache all files in the images sub-directory of the document root of an Apache web server. var/www/html/images/
The cache behavior for the specified path.
You can specify one of the following per-path cache behaviors:
cache
- This behavior caches the specified path.dont-cache
- This behavior doesn't cache the specified path.[REQUIRED]
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.
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
.
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
dict
Response Syntax
{
'distribution': {
'name': 'string',
'arn': 'string',
'supportCode': 'string',
'createdAt': datetime(2015, 1, 1),
'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'
},
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'alternativeDomainNames': [
'string',
],
'status': 'string',
'isEnabled': True|False,
'domainName': 'string',
'bundleId': 'string',
'certificateName': 'string',
'origin': {
'name': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'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',
'protocolPolicy': 'http-only'|'https-only'
},
'originPublicDNS': 'string',
'defaultCacheBehavior': {
'behavior': 'dont-cache'|'cache'
},
'cacheBehaviorSettings': {
'defaultTTL': 123,
'minimumTTL': 123,
'maximumTTL': 123,
'allowedHTTPMethods': 'string',
'cachedHTTPMethods': 'string',
'forwardedCookies': {
'option': 'none'|'allow-list'|'all',
'cookiesAllowList': [
'string',
]
},
'forwardedHeaders': {
'option': 'none'|'allow-list'|'all',
'headersAllowList': [
'Accept'|'Accept-Charset'|'Accept-Datetime'|'Accept-Encoding'|'Accept-Language'|'Authorization'|'CloudFront-Forwarded-Proto'|'CloudFront-Is-Desktop-Viewer'|'CloudFront-Is-Mobile-Viewer'|'CloudFront-Is-SmartTV-Viewer'|'CloudFront-Is-Tablet-Viewer'|'CloudFront-Viewer-Country'|'Host'|'Origin'|'Referer',
]
},
'forwardedQueryStrings': {
'option': True|False,
'queryStringsAllowList': [
'string',
]
}
},
'cacheBehaviors': [
{
'path': 'string',
'behavior': 'dont-cache'|'cache'
},
],
'ableToUpdateBundle': True|False,
'ipAddressType': 'dualstack'|'ipv4',
'tags': [
{
'key': 'string',
'value': 'string'
},
]
},
'operation': {
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
}
}
Response Structure
(dict) --
distribution (dict) --
An object that describes the distribution created.
name (string) --
The name of the distribution.
arn (string) --
The Amazon Resource Name (ARN) of the distribution.
supportCode (string) --
The support code. Include this code in your email to support when you have questions about your Lightsail distribution. This code enables our support team to look up your Lightsail information more easily.
createdAt (datetime) --
The timestamp when the distribution was created.
location (dict) --
An object that describes the location of the distribution, such as the Amazon Web Services Region and Availability Zone.
Note
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.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
resourceType (string) --
The Lightsail resource type (e.g., Distribution
).
alternativeDomainNames (list) --
The alternate domain names of the distribution.
status (string) --
The status of the distribution.
isEnabled (boolean) --
Indicates whether the distribution is enabled.
domainName (string) --
The domain name of the distribution.
bundleId (string) --
The ID of the bundle currently applied to the distribution.
certificateName (string) --
The name of the SSL/TLS certificate attached to the distribution, if any.
origin (dict) --
An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.
The distribution pulls, caches, and serves content from the origin.
name (string) --
The name of the origin resource.
resourceType (string) --
The resource type of the origin resource (e.g., Instance ).
regionName (string) --
The AWS Region name of the origin resource.
protocolPolicy (string) --
The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.
originPublicDNS (string) --
The public DNS of the origin.
defaultCacheBehavior (dict) --
An object that describes the default cache behavior of the distribution.
behavior (string) --
The cache behavior of the distribution.
The following cache behaviors can be specified:
cache
- This option is best for static sites. When specified, your distribution caches and serves your entire website as static content. This behavior is ideal for websites with static content that doesn't change depending on who views it, or for websites that don't use cookies, headers, or query strings to personalize content.dont-cache
- This option is best for sites that serve a mix of static and dynamic content. When specified, your distribution caches and serve only the content that is specified in the distribution's CacheBehaviorPerPath
parameter. This behavior is ideal for websites or web applications that use cookies, headers, and query strings to personalize content for individual users.cacheBehaviorSettings (dict) --
An object that describes the cache behavior settings of the distribution.
defaultTTL (integer) --
The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.
Note
The value specified applies only when the origin does not add HTTP headers such as Cache-Control max-age
, Cache-Control s-maxage
, and Expires
to objects.
minimumTTL (integer) --
The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.
A value of 0
must be specified for minimumTTL
if the distribution is configured to forward all headers to the origin.
maximumTTL (integer) --
The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.
The value specified applies only when the origin adds HTTP headers such as Cache-Control max-age
, Cache-Control s-maxage
, and Expires
to objects.
allowedHTTPMethods (string) --
The HTTP methods that are processed and forwarded to the distribution's origin.
You can specify the following options:
GET,HEAD
- The distribution forwards the GET
and HEAD
methods.GET,HEAD,OPTIONS
- The distribution forwards the GET
, HEAD
, and OPTIONS
methods.GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE
- The distribution forwards the GET
, HEAD
, OPTIONS
, PUT
, PATCH
, POST
, and DELETE
methods.If you specify the third option, you might need to restrict access to your distribution's origin so users can't perform operations that you don't want them to. For example, you might not want users to have permission to delete objects from your origin.
cachedHTTPMethods (string) --
The HTTP method responses that are cached by your distribution.
You can specify the following options:
GET,HEAD
- The distribution caches responses to the GET
and HEAD
methods.GET,HEAD,OPTIONS
- The distribution caches responses to the GET
, HEAD
, and OPTIONS
methods.forwardedCookies (dict) --
An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded.
option (string) --
Specifies which cookies to forward to the distribution's origin for a cache behavior: all
, none
, or allow-list
to forward only the cookies specified in the cookiesAllowList
parameter.
cookiesAllowList (list) --
The specific cookies to forward to your distribution's origin.
forwardedHeaders (dict) --
An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded.
option (string) --
The headers that you want your distribution to forward to your origin and base caching on.
You can configure your distribution to do one of the following:
all
- Forward all headers to your origin.none
- Forward only the default headers.allow-list
- Forward only the headers you specify using the headersAllowList
parameter.headersAllowList (list) --
The specific headers to forward to your distribution's origin.
forwardedQueryStrings (dict) --
An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded.
option (boolean) --
Indicates whether the distribution forwards and caches based on query strings.
queryStringsAllowList (list) --
The specific query strings that the distribution forwards to the origin.
Your distribution will cache content based on the specified query strings.
If the option
parameter is true, then your distribution forwards all query strings, regardless of what you specify using the queryStringsAllowList
parameter.
cacheBehaviors (list) --
An array of objects that describe the per-path cache behavior of the distribution.
(dict) --
Describes the per-path cache behavior of an Amazon Lightsail content delivery network (CDN) distribution.
A per-path cache behavior is used to override, or add an exception to, the default cache behavior of a distribution. For example, if the cacheBehavior
is set to cache
, then a per-path cache behavior can be used to specify a directory, file, or file type that your distribution will cache. Alternately, if the distribution's cacheBehavior
is dont-cache
, then a per-path cache behavior can be used to specify a directory, file, or file type that your distribution will not cache.
path (string) --
The path to a directory or file to cached, or not cache. Use an asterisk symbol to specify wildcard directories ( path/to/assets/*
), and file types ( *.html, *jpg, *js
). Directories and file paths are case-sensitive.
Examples:
var/www/html/
var/www/html/index.html
var/www/html/*.html
var/www/html/images/*.jpg
var/www/html/images/*.png
var/www/html/images/*.gif
Specify the following to cache all files in the images sub-directory of the document root of an Apache web server. var/www/html/images/
behavior (string) --
The cache behavior for the specified path.
You can specify one of the following per-path cache behaviors:
cache
- This behavior caches the specified path.dont-cache
- This behavior doesn't cache the specified path.ableToUpdateBundle (boolean) --
Indicates whether the bundle that is currently applied to your distribution, specified using the distributionName
parameter, can be changed to another bundle.
Use the UpdateDistributionBundle
action to change your distribution's bundle.
ipAddressType (string) --
The IP address type of the distribution.
The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
tags (list) --
The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
(dict) --
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
key (string) --
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
value (string) --
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
operation (dict) --
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.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.UnauthenticatedException
create_domain
(**kwargs)¶Creates a domain resource for the specified domain (e.g., example.com).
The create domain
operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.
See also: AWS API Documentation
Request Syntax
response = client.create_domain(
domainName='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The domain name to manage (e.g., example.com
).
Note
You cannot register a new domain name using Lightsail. You must register a domain name using Amazon Route 53 or another domain name registrar. If you have already registered your domain, you can enter its name in this parameter to manage the DNS records for that domain using Lightsail.
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
dict
Response Syntax
{
'operation': {
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
}
}
Response Structure
(dict) --
operation (dict) --
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.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_domain_entry
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_domain_entry(
domainName='string',
domainEntry={
'id': 'string',
'name': 'string',
'target': 'string',
'isAlias': True|False,
'type': 'string',
'options': {
'string': 'string'
}
}
)
[REQUIRED]
The domain name (e.g., example.com
) for which you want to create the domain entry.
[REQUIRED]
An array of key-value pairs containing information about the domain entry request.
The ID of the domain recordset entry.
The name of the domain.
The target IP address (e.g., 192.0.2.0
), or AWS name server (e.g., ns-111.awsdns-22.com.
).
For Lightsail load balancers, the value looks like ab1234c56789c6b86aba6fb203d443bc-123456789.us-east-2.elb.amazonaws.com
. For Lightsail distributions, the value looks like exampled1182ne.cloudfront.net
. For Lightsail container services, the value looks like container-service-1.example23scljs.us-west-2.cs.amazonlightsail.com
. Be sure to also set isAlias
to true
when setting up an A record for a Lightsail load balancer, distribution, or container service.
When true
, specifies whether the domain entry is an alias used by the Lightsail load balancer. You can include an alias (A type) record in your request, which points to a load balancer DNS name and routes traffic to your load balancer.
The type of domain entry, such as address for IPv4 (A), address for IPv6 (AAAA), canonical name (CNAME), mail exchanger (MX), name server (NS), start of authority (SOA), service locator (SRV), or text (TXT).
The following domain entry types can be used:
A
AAAA
CNAME
MX
NS
SOA
SRV
TXT
(Deprecated) The options for the domain entry.
Note
In releases prior to November 29, 2017, this parameter was not included in the API response. It is now deprecated.
dict
Response Syntax
{
'operation': {
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
}
}
Response Structure
(dict) --
operation (dict) --
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.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_instance_snapshot
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_instance_snapshot(
instanceSnapshotName='string',
instanceName='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The name for your new snapshot.
[REQUIRED]
The Lightsail instance on which to base your snapshot.
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_instances
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_instances(
instanceNames=[
'string',
],
availabilityZone='string',
customImageName='string',
blueprintId='string',
bundleId='string',
userData='string',
keyPairName='string',
tags=[
{
'key': 'string',
'value': 'string'
},
],
addOns=[
{
'addOnType': 'AutoSnapshot',
'autoSnapshotAddOnRequest': {
'snapshotTimeOfDay': 'string'
}
},
],
ipAddressType='dualstack'|'ipv4'
)
[REQUIRED]
The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for example: ["MyFirstInstance","MySecondInstance"]
[REQUIRED]
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.
(Deprecated) The name for your custom image.
Note
In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated.
[REQUIRED]
The ID for a virtual private server image (e.g., app_wordpress_4_4
or app_lamp_7_0
). Use the get blueprints
operation to return a list of available images (or blueprints ).
Note
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.
[REQUIRED]
The bundle of specification information for your virtual private server (or instance ), including the pricing plan (e.g., micro_1_0
).
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
.
Note
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.
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
An array of objects representing the add-ons to enable for the new instance.
Describes a request to enable, modify, or disable an add-on for an Amazon Lightsail resource.
Note
An additional cost may be associated with enabling add-ons. For more information, see the Lightsail pricing page.
The add-on type.
An object that represents additional parameters when enabling or modifying the automatic snapshot add-on.
The daily time when an automatic snapshot will be created.
Constraints:
HH:00
format, and in an hourly increment.The IP address type for the instance.
The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
The default value is dualstack
.
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_instances_from_snapshot
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_instances_from_snapshot(
instanceNames=[
'string',
],
attachedDiskMapping={
'string': [
{
'originalDiskPath': 'string',
'newDiskName': 'string'
},
]
},
availabilityZone='string',
instanceSnapshotName='string',
bundleId='string',
userData='string',
keyPairName='string',
tags=[
{
'key': 'string',
'value': 'string'
},
],
addOns=[
{
'addOnType': 'AutoSnapshot',
'autoSnapshotAddOnRequest': {
'snapshotTimeOfDay': 'string'
}
},
],
ipAddressType='dualstack'|'ipv4',
sourceInstanceName='string',
restoreDate='string',
useLatestRestorableAutoSnapshot=True|False
)
[REQUIRED]
The names for your new instances.
An object containing information about one or more disk mappings.
Describes a block storage disk mapping.
The original disk path exposed to the instance (for example, /dev/sdh
).
The new disk name (e.g., my-new-disk
).
[REQUIRED]
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.
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:
source instance name
parameter. The instance snapshot name
and source instance name
parameters are mutually exclusive.[REQUIRED]
The bundle of specification information for your virtual private server (or instance ), including the pricing plan (e.g., micro_1_0
).
You can create a launch script that configures a server with additional user data. For example, apt-get -y update
.
Note
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.
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
An array of objects representing the add-ons to enable for the new instance.
Describes a request to enable, modify, or disable an add-on for an Amazon Lightsail resource.
Note
An additional cost may be associated with enabling add-ons. For more information, see the Lightsail pricing page.
The add-on type.
An object that represents additional parameters when enabling or modifying the automatic snapshot add-on.
The daily time when an automatic snapshot will be created.
Constraints:
HH:00
format, and in an hourly increment.The IP address type for the instance.
The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
The default value is dualstack
.
The name of the source instance from which the source automatic snapshot was created.
Constraints:
instance snapshot name
parameter. The source instance name
and instance snapshot name
parameters are mutually exclusive.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:
YYYY-MM-DD
format.use latest restorable auto snapshot
parameter. The restore date
and use latest restorable auto snapshot
parameters are mutually exclusive.A Boolean value to indicate whether to use the latest available automatic snapshot.
Constraints:
restore date
parameter. The use latest restorable auto snapshot
and restore date
parameters are mutually exclusive.dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_key_pair
(**kwargs)¶Creates a custom SSH key pair that you can use with an Amazon Lightsail instance.
Note
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.
See also: AWS API Documentation
Request Syntax
response = client.create_key_pair(
keyPairName='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The name for your new key pair.
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
dict
Response Syntax
{
'keyPair': {
'name': 'string',
'arn': 'string',
'supportCode': 'string',
'createdAt': datetime(2015, 1, 1),
'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'
},
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'fingerprint': 'string'
},
'publicKeyBase64': 'string',
'privateKeyBase64': 'string',
'operation': {
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
}
}
Response Structure
(dict) --
keyPair (dict) --
An array of key-value pairs containing information about the new key pair you just created.
name (string) --
The friendly name of the SSH key pair.
arn (string) --
The Amazon Resource Name (ARN) of the key pair (e.g., arn:aws:lightsail:us-east-2:123456789101:KeyPair/05859e3d-331d-48ba-9034-12345EXAMPLE
).
supportCode (string) --
The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
createdAt (datetime) --
The timestamp when the key pair was created (e.g., 1479816991.349
).
location (dict) --
The region name and Availability Zone where the key pair was created.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
resourceType (string) --
The resource type (usually KeyPair
).
tags (list) --
The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
(dict) --
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
key (string) --
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
value (string) --
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
fingerprint (string) --
The RSA fingerprint of the key pair.
publicKeyBase64 (string) --
A base64-encoded public key of the ssh-rsa
type.
privateKeyBase64 (string) --
A base64-encoded RSA private key.
operation (dict) --
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.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_load_balancer
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_load_balancer(
loadBalancerName='string',
instancePort=123,
healthCheckPath='string',
certificateName='string',
certificateDomainName='string',
certificateAlternativeNames=[
'string',
],
tags=[
{
'key': 'string',
'value': 'string'
},
],
ipAddressType='dualstack'|'ipv4',
tlsPolicyName='string'
)
[REQUIRED]
The name of your load balancer.
[REQUIRED]
The instance port where you're creating your load balancer.
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 (e.g., "/"
).
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.
The name of the SSL/TLS certificate.
If you specify certificateName
, then certificateDomainName
is required (and vice-versa).
The domain name with which your certificate is associated (e.g., example.com
).
If you specify certificateDomainName
, then certificateName
is required (and vice-versa).
The optional alternative domains and subdomains to use with your SSL/TLS certificate (e.g., www.example.com
, example.com
, m.example.com
, blog.example.com
).
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The IP address type for the load balancer.
The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
The default value is dualstack
.
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 .
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_load_balancer_tls_certificate
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_load_balancer_tls_certificate(
loadBalancerName='string',
certificateName='string',
certificateDomainName='string',
certificateAlternativeNames=[
'string',
],
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The load balancer name where you want to create the SSL/TLS certificate.
[REQUIRED]
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.
[REQUIRED]
The domain name (e.g., example.com
) for your SSL/TLS certificate.
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 (e.g., *.example.com
).
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_relational_database
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_relational_database(
relationalDatabaseName='string',
availabilityZone='string',
relationalDatabaseBlueprintId='string',
relationalDatabaseBundleId='string',
masterDatabaseName='string',
masterUsername='string',
masterUserPassword='string',
preferredBackupWindow='string',
preferredMaintenanceWindow='string',
publiclyAccessible=True|False,
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The name to use for your new Lightsail database resource.
Constraints:
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.
[REQUIRED]
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.
[REQUIRED]
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.
[REQUIRED]
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:
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:
[REQUIRED]
The name for the master user.
MySQL
Constraints:
PostgreSQL
Constraints:
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.
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:
hh24:mi-hh24:mi
format. Example: 16:00-16:30
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:
ddd:hh24:mi-ddd:hh24:mi
format.Tue:17:00-Tue:17:30
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.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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_relational_database_from_snapshot
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_relational_database_from_snapshot(
relationalDatabaseName='string',
availabilityZone='string',
publiclyAccessible=True|False,
relationalDatabaseSnapshotName='string',
relationalDatabaseBundleId='string',
sourceRelationalDatabaseName='string',
restoreTime=datetime(2015, 1, 1),
useLatestRestorableTime=True|False,
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The name to use for your new Lightsail database resource.
Constraints:
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.
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.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.
The date and time to restore your database from.
Constraints:
use latest restorable time
parameter is true
.1538424000
as the restore time.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.
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
create_relational_database_snapshot
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_relational_database_snapshot(
relationalDatabaseName='string',
relationalDatabaseSnapshotName='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The name of the database on which to base your new snapshot.
[REQUIRED]
The name for your new database snapshot.
Constraints:
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.
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
delete_alarm
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.delete_alarm(
alarmName='string'
)
[REQUIRED]
The name of the alarm to delete.
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response 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.
Describes the API operation.
The ID of the operation.
The resource name.
The resource type.
The timestamp when the operation was initialized (e.g., 1479816991.349
).
The Amazon Web Services Region and Availability Zone.
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
The Amazon Web Services Region name.
A Boolean value indicating whether the operation is terminal.
Details about the operation (e.g., Debian-1GB-Ohio-1
).
The type of operation.
The status of the operation.
The timestamp when the status was changed (e.g., 1479816991.349
).
The error code.
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.UnauthenticatedException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.NotFoundException
delete_auto_snapshot
(**kwargs)¶Deletes an automatic snapshot of an instance or disk. For more information, see the Amazon Lightsail Developer Guide.
See also: AWS API Documentation
Request Syntax
response = client.delete_auto_snapshot(
resourceName='string',
date='string'
)
[REQUIRED]
The name of the source instance or disk from which to delete the automatic snapshot.
[REQUIRED]
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.
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.UnauthenticatedException
delete_bucket
(**kwargs)¶Deletes a Amazon Lightsail bucket.
Note
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.
See also: AWS API Documentation
Request Syntax
response = client.delete_bucket(
bucketName='string',
forceDelete=True|False
)
[REQUIRED]
The name of the bucket to delete.
Use the GetBuckets action to get a list of bucket names that you can specify.
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:
Warning
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.
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.UnauthenticatedException
delete_bucket_access_key
(**kwargs)¶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 .
See also: AWS API Documentation
Request Syntax
response = client.delete_bucket_access_key(
bucketName='string',
accessKeyId='string'
)
[REQUIRED]
The name of the bucket that the access key belongs to.
[REQUIRED]
The ID of the access key to delete.
Use the GetBucketAccessKeys action to get a list of access key IDs that you can specify.
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.UnauthenticatedException
delete_certificate
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.delete_certificate(
certificateName='string'
)
[REQUIRED]
The name of the certificate to delete.
Use the GetCertificates
action to get a list of certificate names that you can specify.
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response 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.
Describes the API operation.
The ID of the operation.
The resource name.
The resource type.
The timestamp when the operation was initialized (e.g., 1479816991.349
).
The Amazon Web Services Region and Availability Zone.
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
The Amazon Web Services Region name.
A Boolean value indicating whether the operation is terminal.
Details about the operation (e.g., Debian-1GB-Ohio-1
).
The type of operation.
The status of the operation.
The timestamp when the status was changed (e.g., 1479816991.349
).
The error code.
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.UnauthenticatedException
delete_contact_method
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.delete_contact_method(
protocol='Email'|'SMS'
)
[REQUIRED]
The protocol that will be deleted, such as Email
or SMS
(text messaging).
Note
To delete an Email
and an SMS
contact method if you added both, you must run separate DeleteContactMethod
actions to delete each protocol.
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response 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.
Describes the API operation.
The ID of the operation.
The resource name.
The resource type.
The timestamp when the operation was initialized (e.g., 1479816991.349
).
The Amazon Web Services Region and Availability Zone.
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
The Amazon Web Services Region name.
A Boolean value indicating whether the operation is terminal.
Details about the operation (e.g., Debian-1GB-Ohio-1
).
The type of operation.
The status of the operation.
The timestamp when the status was changed (e.g., 1479816991.349
).
The error code.
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.UnauthenticatedException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.NotFoundException
delete_container_image
(**kwargs)¶Deletes a container image that is registered to your Amazon Lightsail container service.
See also: AWS API Documentation
Request Syntax
response = client.delete_container_image(
serviceName='string',
image='string'
)
[REQUIRED]
The name of the container service for which to delete a registered container image.
[REQUIRED]
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.
Note
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
.
dict
Response Syntax
{}
Response Structure
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.UnauthenticatedException
delete_container_service
(**kwargs)¶Deletes your Amazon Lightsail container service.
See also: AWS API Documentation
Request Syntax
response = client.delete_container_service(
serviceName='string'
)
[REQUIRED]
The name of the container service to delete.
{}
Response Structure
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.UnauthenticatedException
delete_disk
(**kwargs)¶Deletes the specified block storage disk. The disk must be in the available
state (not attached to a Lightsail instance).
Note
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.
See also: AWS API Documentation
Request Syntax
response = client.delete_disk(
diskName='string',
forceDeleteAddOns=True|False
)
[REQUIRED]
The unique name of the disk you want to delete (e.g., my-disk
).
dict
Response Syntax
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response Structure
(dict) --
operations (list) --
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.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349
).
location (dict) --
The Amazon Web Services Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
regionName (string) --
The Amazon Web Services Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1
).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349
).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
delete_disk_snapshot
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.delete_disk_snapshot(
diskSnapshotName='string'
)
[REQUIRED]
The name of the disk snapshot you want to delete (e.g., my-disk-snapshot
).
{
'operations': [
{
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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',
'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded',
'statusChangedAt': datetime(2015, 1, 1),
'errorCode': 'string',
'errorDetails': 'string'
},
]
}
Response 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.
Describes the API operation.
The ID of the operation.
The resource name.
The resource type.
The timestamp when the operation was initialized (e.g., 1479816991.349
).
The Amazon Web Services Region and Availability Zone.
The Availability Zone. Follows the format us-east-2a
(case-sensitive).
The Amazon Web Services Region name.
A Boolean value indicating whether the operation is terminal.
Details about the operation (e.g., Debian-1GB-Ohio-1
).
The type of operation.
The status of the operation.
The timestamp when the status was changed (e.g., 1479816991.349
).
The error code.
The error details.
Exceptions
Lightsail.Client.exceptions.ServiceException
Lightsail.Client.exceptions.InvalidInputException
Lightsail.Client.exceptions.NotFoundException
Lightsail.Client.exceptions.OperationFailureException
Lightsail.Client.exceptions.AccessDeniedException
Lightsail.Client.exceptions.AccountSetupInProgressException
Lightsail.Client.exceptions.UnauthenticatedException
delete_distribution
(**kwargs)¶Deletes your Amazon Lightsail content delivery network (CDN) distribution.
See also: AWS API Documentation
Request Syntax
response = client.delete_distribution(
distributionName='string'
)
The name of the distribution to delete.
Use the GetDistributions
action to get a list of distribution names that you can specify.
{
'operation': {
'id': 'string',
'resourceName': 'string',
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'createdAt': datetime(2015, 1, 1),
'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'
},
'isTerminal': True|False,
'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'|