Amazon Lightsail

2022/04/26 - Amazon Lightsail - 1 new 4 updated api methods

Changes  This release adds support for Lightsail load balancer HTTP to HTTPS redirect and TLS policy configuration.

GetLoadBalancerTlsPolicies (new) Link ¶

Returns a list of TLS security policies that you can apply to Lightsail load balancers.

For more information about load balancer TLS security policies, see Load balancer TLS security policies in the Amazon Lightsail Developer Guide .

See also: AWS API Documentation

Request Syntax

client.get_load_balancer_tls_policies(
    pageToken='string'
)
type pageToken

string

param pageToken

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetLoadBalancerTlsPolicies request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

rtype

dict

returns

Response Syntax

{
    'tlsPolicies': [
        {
            'name': 'string',
            'isDefault': True|False,
            'description': 'string',
            'protocols': [
                'string',
            ],
            'ciphers': [
                'string',
            ]
        },
    ],
    'nextPageToken': 'string'
}

Response Structure

  • (dict) --

    • tlsPolicies (list) --

      An array of objects that describe the TLS security policies that are available.

      • (dict) --

        Describes the TLS security policies that are available for Lightsail load balancers.

        For more information about load balancer TLS security policies, see Load balancer TLS security policies in the Amazon Lightsail Developer Guide .

        • name (string) --

          The name of the TLS security policy.

          The following TLS security policy names are possible:

          • TLS-2016-08

          • TLS-FS-Res-1-2-2019-08

          You can specify either of these values for the tlsSecurityPolicyName request parameter in the CreateLoadBalancer action, and the attributeValue request parameter in the UpdateLoadBalancerAttribute action.

        • isDefault (boolean) --

          A Boolean value that indicates whether the TLS security policy is the default.

        • description (string) --

          The description of the TLS security policy.

        • protocols (list) --

          The protocols used in a given TLS security policy.

          The following protocols are possible:

          • Protocol-TLSv1

          • Protocol-TLSv1.1

          • Protocol-TLSv1.2

          • (string) --

        • ciphers (list) --

          The ciphers used by the TLS security policy.

          The ciphers are listed in order of preference.

          • (string) --

    • nextPageToken (string) --

      The token to advance to the next page of results from your request.

      A next page token is not returned if there are no more results to display.

      To get the next page of results, perform another GetLoadBalancerTlsPolicies request and specify the next page token using the pageToken parameter.

CreateLoadBalancer (updated) Link ¶
Changes (request)
{'tlsPolicyName': 'string'}

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

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'
)
type loadBalancerName

string

param loadBalancerName

[REQUIRED]

The name of your load balancer.

type instancePort

integer

param instancePort

[REQUIRED]

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

type healthCheckPath

string

param healthCheckPath

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.

type certificateName

string

param certificateName

The name of the SSL/TLS certificate.

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

type certificateDomainName

string

param certificateDomainName

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

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

type certificateAlternativeNames

list

param certificateAlternativeNames

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 ).

  • (string) --

type tags

list

param tags

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.

  • (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: + - = . _ : / @

type ipAddressType

string

param ipAddressType

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 .

type tlsPolicyName

string

param tlsPolicyName

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 Load balancer TLS security policies in the Amazon Lightsail Developer Guide .

rtype

dict

returns

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',
            '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 AWS 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.

GetLoadBalancer (updated) Link ¶
Changes (response)
{'loadBalancer': {'httpsRedirectionEnabled': 'boolean',
                  'tlsPolicyName': 'string'}}

Returns information about the specified Lightsail load balancer.

See also: AWS API Documentation

Request Syntax

client.get_load_balancer(
    loadBalancerName='string'
)
type loadBalancerName

string

param loadBalancerName

[REQUIRED]

The name of the load balancer.

rtype

dict

returns

Response Syntax

{
    'loadBalancer': {
        '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'
            },
        ],
        'dnsName': 'string',
        'state': 'active'|'provisioning'|'active_impaired'|'failed'|'unknown',
        'protocol': 'HTTP_HTTPS'|'HTTP',
        'publicPorts': [
            123,
        ],
        'healthCheckPath': 'string',
        'instancePort': 123,
        'instanceHealthSummary': [
            {
                'instanceName': 'string',
                'instanceHealth': 'initial'|'healthy'|'unhealthy'|'unused'|'draining'|'unavailable',
                'instanceHealthReason': 'Lb.RegistrationInProgress'|'Lb.InitialHealthChecking'|'Lb.InternalError'|'Instance.ResponseCodeMismatch'|'Instance.Timeout'|'Instance.FailedHealthChecks'|'Instance.NotRegistered'|'Instance.NotInUse'|'Instance.DeregistrationInProgress'|'Instance.InvalidState'|'Instance.IpUnusable'
            },
        ],
        'tlsCertificateSummaries': [
            {
                'name': 'string',
                'isAttached': True|False
            },
        ],
        'configurationOptions': {
            'string': 'string'
        },
        'ipAddressType': 'dualstack'|'ipv4',
        'httpsRedirectionEnabled': True|False,
        'tlsPolicyName': 'string'
    }
}

Response Structure

  • (dict) --

    • loadBalancer (dict) --

      An object containing information about your load balancer.

      • name (string) --

        The name of the load balancer (e.g., my-load-balancer ).

      • arn (string) --

        The Amazon Resource Name (ARN) of the load balancer.

      • supportCode (string) --

        The support code. Include this code in your email to support when you have questions about your Lightsail load balancer. This code enables our support team to look up your Lightsail information more easily.

      • createdAt (datetime) --

        The date when your load balancer was created.

      • location (dict) --

        The AWS Region where your load balancer was created (e.g., us-east-2a ). Lightsail automatically creates your load balancer across Availability Zones.

        • availabilityZone (string) --

          The Availability Zone. Follows the format us-east-2a (case-sensitive).

        • regionName (string) --

          The AWS Region name.

      • resourceType (string) --

        The resource type (e.g., LoadBalancer .

      • 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: + - = . _ : / @

      • dnsName (string) --

        The DNS name of your Lightsail load balancer.

      • state (string) --

        The status of your load balancer. Valid values are below.

      • protocol (string) --

        The protocol you have enabled for your load balancer. Valid values are below.

        You can't just have HTTP_HTTPS , but you can have just HTTP .

      • publicPorts (list) --

        An array of public port settings for your load balancer. For HTTP, use port 80. For HTTPS, use port 443.

        • (integer) --

      • healthCheckPath (string) --

        The path you specified to perform your health checks. If no path is specified, the load balancer tries to make a request to the default (root) page.

      • instancePort (integer) --

        The port where the load balancer will direct traffic to your Lightsail instances. For HTTP traffic, it's port 80. For HTTPS traffic, it's port 443.

      • instanceHealthSummary (list) --

        An array of InstanceHealthSummary objects describing the health of the load balancer.

        • (dict) --

          Describes information about the health of the instance.

          • instanceName (string) --

            The name of the Lightsail instance for which you are requesting health check data.

          • instanceHealth (string) --

            Describes the overall instance health. Valid values are below.

          • instanceHealthReason (string) --

            More information about the instance health. If the instanceHealth is healthy , then an instanceHealthReason value is not provided.

            If instanceHealth is initial , the instanceHealthReason value can be one of the following:

            • Lb.RegistrationInProgress - The target instance is in the process of being registered with the load balancer.

            • Lb.InitialHealthChecking - The Lightsail load balancer is still sending the target instance the minimum number of health checks required to determine its health status.

            If instanceHealth is unhealthy , the instanceHealthReason value can be one of the following:

            • Instance.ResponseCodeMismatch - The health checks did not return an expected HTTP code.

            • Instance.Timeout - The health check requests timed out.

            • Instance.FailedHealthChecks - The health checks failed because the connection to the target instance timed out, the target instance response was malformed, or the target instance failed the health check for an unknown reason.

            • Lb.InternalError - The health checks failed due to an internal error.

            If instanceHealth is unused , the instanceHealthReason value can be one of the following:

            • Instance.NotRegistered - The target instance is not registered with the target group.

            • Instance.NotInUse - The target group is not used by any load balancer, or the target instance is in an Availability Zone that is not enabled for its load balancer.

            • Instance.IpUnusable - The target IP address is reserved for use by a Lightsail load balancer.

            • Instance.InvalidState - The target is in the stopped or terminated state.

            If instanceHealth is draining , the instanceHealthReason value can be one of the following:

            • Instance.DeregistrationInProgress - The target instance is in the process of being deregistered and the deregistration delay period has not expired.

      • tlsCertificateSummaries (list) --

        An array of LoadBalancerTlsCertificateSummary objects that provide additional information about the SSL/TLS certificates. For example, if true , the certificate is attached to the load balancer.

        • (dict) --

          Provides a summary of SSL/TLS certificate metadata.

          • name (string) --

            The name of the SSL/TLS certificate.

          • isAttached (boolean) --

            When true , the SSL/TLS certificate is attached to the Lightsail load balancer.

      • configurationOptions (dict) --

        A string to string map of the configuration options for your load balancer. Valid values are listed below.

        • (string) --

          • (string) --

      • ipAddressType (string) --

        The IP address type of the load balancer.

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

      • httpsRedirectionEnabled (boolean) --

        A Boolean value that indicates whether HTTPS redirection is enabled for the load balancer.

      • tlsPolicyName (string) --

        The name of the TLS security policy for the load balancer.

        The following TLS security policy names are possible:

        • TLS-2016-08

        • TLS-FS-Res-1-2-2019-08

GetLoadBalancers (updated) Link ¶
Changes (response)
{'loadBalancers': {'httpsRedirectionEnabled': 'boolean',
                   'tlsPolicyName': 'string'}}

Returns information about all load balancers in an account.

See also: AWS API Documentation

Request Syntax

client.get_load_balancers(
    pageToken='string'
)
type pageToken

string

param pageToken

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetLoadBalancers request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

rtype

dict

returns

Response Syntax

{
    'loadBalancers': [
        {
            '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'
                },
            ],
            'dnsName': 'string',
            'state': 'active'|'provisioning'|'active_impaired'|'failed'|'unknown',
            'protocol': 'HTTP_HTTPS'|'HTTP',
            'publicPorts': [
                123,
            ],
            'healthCheckPath': 'string',
            'instancePort': 123,
            'instanceHealthSummary': [
                {
                    'instanceName': 'string',
                    'instanceHealth': 'initial'|'healthy'|'unhealthy'|'unused'|'draining'|'unavailable',
                    'instanceHealthReason': 'Lb.RegistrationInProgress'|'Lb.InitialHealthChecking'|'Lb.InternalError'|'Instance.ResponseCodeMismatch'|'Instance.Timeout'|'Instance.FailedHealthChecks'|'Instance.NotRegistered'|'Instance.NotInUse'|'Instance.DeregistrationInProgress'|'Instance.InvalidState'|'Instance.IpUnusable'
                },
            ],
            'tlsCertificateSummaries': [
                {
                    'name': 'string',
                    'isAttached': True|False
                },
            ],
            'configurationOptions': {
                'string': 'string'
            },
            'ipAddressType': 'dualstack'|'ipv4',
            'httpsRedirectionEnabled': True|False,
            'tlsPolicyName': 'string'
        },
    ],
    'nextPageToken': 'string'
}

Response Structure

  • (dict) --

    • loadBalancers (list) --

      An array of LoadBalancer objects describing your load balancers.

      • (dict) --

        Describes a load balancer.

        • name (string) --

          The name of the load balancer (e.g., my-load-balancer ).

        • arn (string) --

          The Amazon Resource Name (ARN) of the load balancer.

        • supportCode (string) --

          The support code. Include this code in your email to support when you have questions about your Lightsail load balancer. This code enables our support team to look up your Lightsail information more easily.

        • createdAt (datetime) --

          The date when your load balancer was created.

        • location (dict) --

          The AWS Region where your load balancer was created (e.g., us-east-2a ). Lightsail automatically creates your load balancer across Availability Zones.

          • availabilityZone (string) --

            The Availability Zone. Follows the format us-east-2a (case-sensitive).

          • regionName (string) --

            The AWS Region name.

        • resourceType (string) --

          The resource type (e.g., LoadBalancer .

        • 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: + - = . _ : / @

        • dnsName (string) --

          The DNS name of your Lightsail load balancer.

        • state (string) --

          The status of your load balancer. Valid values are below.

        • protocol (string) --

          The protocol you have enabled for your load balancer. Valid values are below.

          You can't just have HTTP_HTTPS , but you can have just HTTP .

        • publicPorts (list) --

          An array of public port settings for your load balancer. For HTTP, use port 80. For HTTPS, use port 443.

          • (integer) --

        • healthCheckPath (string) --

          The path you specified to perform your health checks. If no path is specified, the load balancer tries to make a request to the default (root) page.

        • instancePort (integer) --

          The port where the load balancer will direct traffic to your Lightsail instances. For HTTP traffic, it's port 80. For HTTPS traffic, it's port 443.

        • instanceHealthSummary (list) --

          An array of InstanceHealthSummary objects describing the health of the load balancer.

          • (dict) --

            Describes information about the health of the instance.

            • instanceName (string) --

              The name of the Lightsail instance for which you are requesting health check data.

            • instanceHealth (string) --

              Describes the overall instance health. Valid values are below.

            • instanceHealthReason (string) --

              More information about the instance health. If the instanceHealth is healthy , then an instanceHealthReason value is not provided.

              If instanceHealth is initial , the instanceHealthReason value can be one of the following:

              • Lb.RegistrationInProgress - The target instance is in the process of being registered with the load balancer.

              • Lb.InitialHealthChecking - The Lightsail load balancer is still sending the target instance the minimum number of health checks required to determine its health status.

              If instanceHealth is unhealthy , the instanceHealthReason value can be one of the following:

              • Instance.ResponseCodeMismatch - The health checks did not return an expected HTTP code.

              • Instance.Timeout - The health check requests timed out.

              • Instance.FailedHealthChecks - The health checks failed because the connection to the target instance timed out, the target instance response was malformed, or the target instance failed the health check for an unknown reason.

              • Lb.InternalError - The health checks failed due to an internal error.

              If instanceHealth is unused , the instanceHealthReason value can be one of the following:

              • Instance.NotRegistered - The target instance is not registered with the target group.

              • Instance.NotInUse - The target group is not used by any load balancer, or the target instance is in an Availability Zone that is not enabled for its load balancer.

              • Instance.IpUnusable - The target IP address is reserved for use by a Lightsail load balancer.

              • Instance.InvalidState - The target is in the stopped or terminated state.

              If instanceHealth is draining , the instanceHealthReason value can be one of the following:

              • Instance.DeregistrationInProgress - The target instance is in the process of being deregistered and the deregistration delay period has not expired.

        • tlsCertificateSummaries (list) --

          An array of LoadBalancerTlsCertificateSummary objects that provide additional information about the SSL/TLS certificates. For example, if true , the certificate is attached to the load balancer.

          • (dict) --

            Provides a summary of SSL/TLS certificate metadata.

            • name (string) --

              The name of the SSL/TLS certificate.

            • isAttached (boolean) --

              When true , the SSL/TLS certificate is attached to the Lightsail load balancer.

        • configurationOptions (dict) --

          A string to string map of the configuration options for your load balancer. Valid values are listed below.

          • (string) --

            • (string) --

        • ipAddressType (string) --

          The IP address type of the load balancer.

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

        • httpsRedirectionEnabled (boolean) --

          A Boolean value that indicates whether HTTPS redirection is enabled for the load balancer.

        • tlsPolicyName (string) --

          The name of the TLS security policy for the load balancer.

          The following TLS security policy names are possible:

          • TLS-2016-08

          • TLS-FS-Res-1-2-2019-08

    • nextPageToken (string) --

      The token to advance to the next page of results from your request.

      A next page token is not returned if there are no more results to display.

      To get the next page of results, perform another GetLoadBalancers request and specify the next page token using the pageToken parameter.

UpdateLoadBalancerAttribute (updated) Link ¶
Changes (request)
{'attributeName': {'TlsPolicyName', 'HttpsRedirectionEnabled'}}

Updates the specified attribute for a load balancer. You can only update one attribute at a time.

The update load balancer attribute 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

client.update_load_balancer_attribute(
    loadBalancerName='string',
    attributeName='HealthCheckPath'|'SessionStickinessEnabled'|'SessionStickiness_LB_CookieDurationSeconds'|'HttpsRedirectionEnabled'|'TlsPolicyName',
    attributeValue='string'
)
type loadBalancerName

string

param loadBalancerName

[REQUIRED]

The name of the load balancer that you want to modify (e.g., my-load-balancer .

type attributeName

string

param attributeName

[REQUIRED]

The name of the attribute you want to update.

type attributeValue

string

param attributeValue

[REQUIRED]

The value that you want to specify for the attribute name.

The following values are supported depending on what you specify for the attributeName request parameter:

  • If you specify HealthCheckPath for the attributeName request parameter, then the attributeValue request parameter must be the path to ping on the target (for example, /weather/us/wa/seattle ).

  • If you specify SessionStickinessEnabled for the attributeName request parameter, then the attributeValue request parameter must be true or false .

  • If you specify SessionStickiness_LB_CookieDurationSeconds for the attributeName request parameter, then the attributeValue request parameter must be an interger that represents the cookie duration in seconds.

  • If you specify HttpsRedirectionEnabled for the attributeName request parameter, then the attributeValue request parameter must be true or false .

  • If you specify TlsPolicyName for the attributeName request parameter, then the attributeValue request parameter must be TLS version 1.0, 1.1, and 1.2 or TLS version 1.2 .

rtype

dict

returns

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',
            '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 AWS 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.