2026/03/23 - Amazon Lightsail - 2 updated api methods
Changes Add support for tagging of ContactMethod resource type
{'tags': [{'key': 'string', 'value': 'string'}]}
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
client.create_contact_method(
protocol='Email'|'SMS',
contactEndpoint='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
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 (N. Virginia) ( us-east-1)
US West (Oregon) ( us-west-2)
Europe (Ireland) ( eu-west-1)
Asia Pacific (Tokyo) ( ap-northeast-1)
Asia Pacific (Singapore) ( ap-southeast-1)
Asia Pacific (Sydney) ( ap-southeast-2)
For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services Regions where SMS text messaging is supported, see Supported Regions and Countries in the Amazon SNS Developer Guide.
For more information about notifications in Amazon Lightsail, see Notifications in Amazon Lightsail.
string
[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.
list
The tag keys and optional values to add to the contact method during create.
Use the TagResource action to tag a resource after it's created.
(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: + - = . _ : / @
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'|'ap-southeast-3'
},
'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'|'StartGUISession'|'StopGUISession'|'SetupInstanceHttps',
'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 ( 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 ( 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 ( 1479816991.349).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.
{'contactMethods': {'tags': [{'key': 'string', 'value': 'string'}]}}
Returns information about the configured contact methods. Specify a protocol in your request to return information about a specific contact method.
A contact method is used to send you notifications about your Amazon Lightsail resources. You can add one email address and one mobile phone number contact method in each Amazon Web Services Region. However, SMS text messaging is not supported in some Amazon Web Services Regions, and SMS text messages cannot be sent to some countries/regions. For more information, see Notifications in Amazon Lightsail.
See also: AWS API Documentation
Request Syntax
client.get_contact_methods(
protocols=[
'Email'|'SMS',
]
)
list
The protocols used to send notifications, such as Email, or SMS (text messaging).
Specify a protocol in your request to return information about a specific contact method protocol.
(string) --
dict
Response Syntax
{
'contactMethods': [
{
'contactEndpoint': 'string',
'status': 'PendingVerification'|'Valid'|'Invalid',
'protocol': 'Email'|'SMS',
'name': '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'|'ap-southeast-3'
},
'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
'supportCode': 'string',
'tags': [
{
'key': 'string',
'value': 'string'
},
]
},
]
}
Response Structure
(dict) --
contactMethods (list) --
An array of objects that describe the contact methods.
(dict) --
Describes a contact method.
A contact method is a way to send you notifications. For more information, see Notifications in Amazon Lightsail.
contactEndpoint (string) --
The destination of the contact method, such as an email address or a mobile phone number.
status (string) --
The current status of the contact method.
A contact method has the following possible status:
PendingVerification - The contact method has not yet been verified, and the verification has not yet expired.
Valid - The contact method has been verified.
InValid - An attempt was made to verify the contact method, but the verification has expired.
protocol (string) --
The protocol of the contact method, such as email or SMS (text messaging).
name (string) --
The name of the contact method.
arn (string) --
The Amazon Resource Name (ARN) of the contact method.
createdAt (datetime) --
The timestamp when the contact method was created.
location (dict) --
An object that describes the location of the contact method, 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 contact method.
supportCode (string) --
The support code. Include this code in your email to support when you have questions about your Lightsail contact method. 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: + - = . _ : / @