Class: Aws::Lightsail::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb

Overview

An API client for Lightsail. To construct a client, you need to configure a :region and :credentials.

client = Aws::Lightsail::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

For details on configuring region and credentials see the developer guide.

See #initialize for a full list of supported configuration options.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :plugins (Array<Seahorse::Client::Plugin>) — default: []]

    A list of plugins to apply to the client. Each plugin is either a class name or an instance of a plugin class.

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • Aws::Credentials - Used for configuring static, non-refreshing credentials.

    • Aws::SharedCredentials - Used for loading static credentials from a shared file, such as ~/.aws/config.

    • Aws::AssumeRoleCredentials - Used when you need to assume a role.

    • Aws::AssumeRoleWebIdentityCredentials - Used when you need to assume a role after providing credentials via the web.

    • Aws::SSOCredentials - Used for loading credentials from AWS SSO using an access token generated from aws login.

    • Aws::ProcessCredentials - Used for loading credentials from a process that outputs to stdout.

    • Aws::InstanceProfileCredentials - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • Aws::ECSCredentials - Used for loading credentials from instances running in ECS.

    • Aws::CognitoIdentityCredentials - Used for loading credentials from the Cognito Identity service.

    When :credentials are not configured directly, the following locations will be searched for credentials:

    • Aws.config[:credentials]
    • The :access_key_id, :secret_access_key, :session_token, and :account_id options.
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'], ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID']
    • ~/.aws/credentials
    • ~/.aws/config
    • EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of Aws::InstanceProfileCredentials or Aws::ECSCredentials to enable retries and extended timeouts. Instance profile credential fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED'] to true.
  • :region (required, String)

    The AWS region to connect to. The configured :region is used to determine the service :endpoint. When not passed, a default :region is searched for in the following locations:

    • Aws.config[:region]
    • ENV['AWS_REGION']
    • ENV['AMAZON_REGION']
    • ENV['AWS_DEFAULT_REGION']
    • ~/.aws/credentials
    • ~/.aws/config
  • :access_key_id (String)
  • :account_id (String)
  • :active_endpoint_cache (Boolean) — default: false

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false.

  • :adaptive_retry_wait_to_fill (Boolean) — default: true

    Used only in adaptive retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a RetryCapacityNotAvailableError and will not retry instead of sleeping.

  • :client_side_monitoring (Boolean) — default: false

    When true, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1"

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true

    Used only in standard and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks.

  • :defaults_mode (String) — default: "legacy"

    See DefaultsModeConfiguration for a list of the accepted modes and the configuration defaults that are included.

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :disable_request_compression (Boolean) — default: false

    When set to 'true' the request body will not be compressed for supported operations.

  • :endpoint (String, URI::HTTPS, URI::HTTP)

    Normally you should not configure the :endpoint option directly. This is normally constructed from the :region option. Configuring :endpoint is normally reserved for connecting to test or custom endpoints. The endpoint should be a URI formatted like:

    'http://example.com'
    'https://example.com'
    'http://example.com:123'
    
  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec.

  • :endpoint_discovery (Boolean) — default: false

    When set to true, endpoint discovery will be enabled for operations when available.

  • :ignore_configured_endpoint_urls (Boolean)

    Setting to true disables use of endpoint URLs provided via environment variables and the shared configuration file.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the :logger at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in standard and adaptive retry modes.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used.

  • :request_min_compression_size_bytes (Integer) — default: 10240

    The minimum size in bytes that triggers compression for request bodies. The value must be non-negative integer value between 0 and 10485780 bytes inclusive.

  • :retry_backoff (Proc)

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the legacy retry mode.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the legacy retry mode.

    @see https://www.awsarchitectureblog.com/2015/03/backoff.html

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the legacy retry mode.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_mode (String) — default: "legacy"

    Specifies which retry algorithm to use. Values are:

    • legacy - The pre-existing retry behavior. This is default value if no retry mode is provided.

    • standard - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make.

    • adaptive - An experimental retry mode that includes all the functionality of standard mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future.

  • :sdk_ua_app_id (String)

    A unique and opaque application ID that is appended to the User-Agent header as app/sdk_ua_app_id. It should have a maximum length of 50. This variable is sourced from environment variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.

  • :secret_access_key (String)
  • :session_token (String)
  • :sigv4a_signing_region_set (Array)

    A list of regions that should be signed with SigV4a signing. When not passed, a default :sigv4a_signing_region_set is searched for in the following locations:

    • Aws.config[:sigv4a_signing_region_set]
    • ENV['AWS_SIGV4A_SIGNING_REGION_SET']
    • ~/.aws/config
  • :simple_json (Boolean) — default: false

    Disables request parameter conversion, validation, and formatting. Also disables response data type conversions. The request parameters hash must be formatted exactly as the API expects.This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled.

  • :telemetry_provider (Aws::Telemetry::TelemetryProviderBase) — default: Aws::Telemetry::NoOpTelemetryProvider

    Allows you to provide a telemetry provider, which is used to emit telemetry data. By default, uses NoOpTelemetryProvider which will not record or emit any telemetry data. The SDK supports the following telemetry providers:

    • OpenTelemetry (OTel) - To use the OTel provider, install and require the opentelemetry-sdk gem and then, pass in an instance of a Aws::Telemetry::OTelProvider for telemetry provider.
  • :token_provider (Aws::TokenProvider)

    A Bearer Token Provider. This can be an instance of any one of the following classes:

    • Aws::StaticTokenProvider - Used for configuring static, non-refreshing tokens.

    • Aws::SSOTokenProvider - Used for loading tokens from AWS SSO using an access token generated from aws login.

    When :token_provider is not configured directly, the Aws::TokenProviderChain will be used to search for tokens configured for your profile in shared configuration files.

  • :use_dualstack_endpoint (Boolean)

    When set to true, dualstack enabled endpoints (with .aws TLD) will be used if available.

  • :use_fips_endpoint (Boolean)

    When set to true, fips compatible endpoints will be used if available. When a fips region is used, the region is normalized and this config is set to true.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request.

  • :endpoint_provider (Aws::Lightsail::EndpointProvider)

    The endpoint provider used to resolve endpoints. Any object that responds to #resolve_endpoint(parameters) where parameters is a Struct similar to Aws::Lightsail::EndpointParameters.

  • :http_continue_timeout (Float) — default: 1

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has "Expect" header set to "100-continue". Defaults to nil which disables this behaviour. This value can safely be set per request on the session.

  • :http_idle_timeout (Float) — default: 5

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_open_timeout (Float) — default: 15

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_proxy (URI::HTTP, String)

    A proxy to send requests through. Formatted like 'http://proxy.com:123'.

  • :http_read_timeout (Float) — default: 60

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_wire_trace (Boolean) — default: false

    When true, HTTP debug output will be sent to the :logger.

  • :on_chunk_received (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the response body is received. It provides three arguments: the chunk, the number of bytes received, and the total number of bytes in the response (or nil if the server did not send a content-length).

  • :on_chunk_sent (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the request body is sent. It provides three arguments: the chunk, the number of bytes read from the body, and the total number of bytes in the body.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised.

  • :ssl_ca_bundle (String)

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_directory (String)

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_store (String)

    Sets the X509::Store to verify peer certificate.

  • :ssl_cert (OpenSSL::X509::Certificate)

    Sets a client certificate when creating http connections.

  • :ssl_key (OpenSSL::PKey)

    Sets a client key when creating http connections.

  • :ssl_timeout (Float)

    Sets the SSL timeout in seconds

  • :ssl_verify_peer (Boolean) — default: true

    When true, SSL peer certificates are verified when establishing a connection.



451
452
453
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 451

def initialize(*args)
  super
end

Instance Method Details

#allocate_static_ip(params = {}) ⇒ Types::AllocateStaticIpResult

Allocates a static IP address.

Examples:

Request syntax with placeholder values


resp = client.allocate_static_ip({
  static_ip_name: "ResourceName", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :static_ip_name (required, String)

    The name of the static IP address.

Returns:

See Also:



493
494
495
496
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 493

def allocate_static_ip(params = {}, options = {})
  req = build_request(:allocate_static_ip, params)
  req.send_request(options)
end

#attach_certificate_to_distribution(params = {}) ⇒ Types::AttachCertificateToDistributionResult

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

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

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

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

Examples:

Request syntax with placeholder values


resp = client.attach_certificate_to_distribution({
  distribution_name: "ResourceName", # required
  certificate_name: "ResourceName", # required
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operation.created_at #=> Time
resp.operation.location.availability_zone #=> String
resp.operation.location.region_name #=> String, one of "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"
resp.operation.is_terminal #=> Boolean
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :distribution_name (required, String)

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

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

  • :certificate_name (required, String)

    The name of the certificate to attach to a distribution.

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

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

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

Returns:

See Also:



568
569
570
571
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 568

def attach_certificate_to_distribution(params = {}, options = {})
  req = build_request(:attach_certificate_to_distribution, params)
  req.send_request(options)
end

#attach_disk(params = {}) ⇒ Types::AttachDiskResult

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.

Examples:

Request syntax with placeholder values


resp = client.attach_disk({
  disk_name: "ResourceName", # required
  instance_name: "ResourceName", # required
  disk_path: "NonEmptyString", # required
  auto_mounting: false,
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :disk_name (required, String)

    The unique Lightsail disk name (my-disk).

  • :instance_name (required, String)

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

  • :disk_path (required, String)

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

  • :auto_mounting (Boolean)

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

    This value only applies to Lightsail for Research resources.

Returns:

See Also:



634
635
636
637
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 634

def attach_disk(params = {}, options = {})
  req = build_request(:attach_disk, params)
  req.send_request(options)
end

#attach_instances_to_load_balancer(params = {}) ⇒ Types::AttachInstancesToLoadBalancerResult

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.

Examples:

Request syntax with placeholder values


resp = client.attach_instances_to_load_balancer({
  load_balancer_name: "ResourceName", # required
  instance_names: ["ResourceName"], # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :load_balancer_name (required, String)

    The name of the load balancer.

  • :instance_names (required, Array<String>)

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

Returns:

See Also:



699
700
701
702
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 699

def attach_instances_to_load_balancer(params = {}, options = {})
  req = build_request(:attach_instances_to_load_balancer, params)
  req.send_request(options)
end

#attach_load_balancer_tls_certificate(params = {}) ⇒ Types::AttachLoadBalancerTlsCertificateResult

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.

Examples:

Request syntax with placeholder values


resp = client.attach_load_balancer_tls_certificate({
  load_balancer_name: "ResourceName", # required
  certificate_name: "ResourceName", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :load_balancer_name (required, String)

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

  • :certificate_name (required, String)

    The name of your SSL/TLS certificate.

Returns:

See Also:



763
764
765
766
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 763

def attach_load_balancer_tls_certificate(params = {}, options = {})
  req = build_request(:attach_load_balancer_tls_certificate, params)
  req.send_request(options)
end

#attach_static_ip(params = {}) ⇒ Types::AttachStaticIpResult

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

Examples:

Request syntax with placeholder values


resp = client.attach_static_ip({
  static_ip_name: "ResourceName", # required
  instance_name: "ResourceName", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :static_ip_name (required, String)

    The name of the static IP.

  • :instance_name (required, String)

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

Returns:

See Also:



808
809
810
811
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 808

def attach_static_ip(params = {}, options = {})
  req = build_request(:attach_static_ip, params)
  req.send_request(options)
end

#close_instance_public_ports(params = {}) ⇒ Types::CloseInstancePublicPortsResult

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.

Examples:

Request syntax with placeholder values


resp = client.close_instance_public_ports({
  port_info: { # required
    from_port: 1,
    to_port: 1,
    protocol: "tcp", # accepts tcp, all, udp, icmp, icmpv6
    cidrs: ["string"],
    ipv6_cidrs: ["string"],
    cidr_list_aliases: ["string"],
  },
  instance_name: "ResourceName", # required
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operation.created_at #=> Time
resp.operation.location.availability_zone #=> String
resp.operation.location.region_name #=> String, one of "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"
resp.operation.is_terminal #=> Boolean
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :port_info (required, Types::PortInfo)

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

  • :instance_name (required, String)

    The name of the instance for which to close ports.

Returns:

See Also:



868
869
870
871
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 868

def close_instance_public_ports(params = {}, options = {})
  req = build_request(:close_instance_public_ports, params)
  req.send_request(options)
end

#copy_snapshot(params = {}) ⇒ Types::CopySnapshotResult

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.

Examples:

Request syntax with placeholder values


resp = client.copy_snapshot({
  source_snapshot_name: "ResourceName",
  source_resource_name: "string",
  restore_date: "string",
  use_latest_restorable_auto_snapshot: false,
  target_snapshot_name: "ResourceName", # required
  source_region: "us-east-1", # required, accepts 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
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :source_snapshot_name (String)

    The name of the source manual snapshot to copy.

    Constraint:

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

    ^

  • :source_resource_name (String)

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

    Constraint:

    ^

  • :restore_date (String)

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

    Constraints:

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

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

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

  • :use_latest_restorable_auto_snapshot (Boolean)

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

    Constraints:

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

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

  • :target_snapshot_name (required, String)

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

  • :source_region (required, String)

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

Returns:

See Also:



996
997
998
999
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 996

def copy_snapshot(params = {}, options = {})
  req = build_request(:copy_snapshot, params)
  req.send_request(options)
end

#create_bucket(params = {}) ⇒ Types::CreateBucketResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_bucket({
  bucket_name: "BucketName", # required
  bundle_id: "NonEmptyString", # required
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
  enable_object_versioning: false,
})

Response structure


resp.bucket.resource_type #=> String
resp.bucket.access_rules.get_object #=> String, one of "public", "private"
resp.bucket.access_rules.allow_public_overrides #=> Boolean
resp.bucket.arn #=> String
resp.bucket.bundle_id #=> String
resp.bucket.created_at #=> Time
resp.bucket.url #=> String
resp.bucket.location.availability_zone #=> String
resp.bucket.location.region_name #=> String, one of "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"
resp.bucket.name #=> String
resp.bucket.support_code #=> String
resp.bucket.tags #=> Array
resp.bucket.tags[0].key #=> String
resp.bucket.tags[0].value #=> String
resp.bucket.object_versioning #=> String
resp.bucket.able_to_update_bundle #=> Boolean
resp.bucket.readonly_access_accounts #=> Array
resp.bucket.readonly_access_accounts[0] #=> String
resp.bucket.resources_receiving_access #=> Array
resp.bucket.resources_receiving_access[0].name #=> String
resp.bucket.resources_receiving_access[0].resource_type #=> String
resp.bucket.state.code #=> String
resp.bucket.state.message #=> String
resp.bucket.access_log_config.enabled #=> Boolean
resp.bucket.access_log_config.destination #=> String
resp.bucket.access_log_config.prefix #=> String
resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :bucket_name (required, String)

    The name for the bucket.

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

  • :bundle_id (required, String)

    The ID of the bundle to use for the bucket.

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

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

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

  • :tags (Array<Types::Tag>)

    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.

  • :enable_object_versioning (Boolean)

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

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

Returns:

See Also:



1126
1127
1128
1129
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 1126

def create_bucket(params = {}, options = {})
  req = build_request(:create_bucket, params)
  req.send_request(options)
end

#create_bucket_access_key(params = {}) ⇒ Types::CreateBucketAccessKeyResult

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

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

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

Examples:

Request syntax with placeholder values


resp = client.create_bucket_access_key({
  bucket_name: "BucketName", # required
})

Response structure


resp.access_key.access_key_id #=> String
resp.access_key.secret_access_key #=> String
resp.access_key.status #=> String, one of "Active", "Inactive"
resp.access_key.created_at #=> Time
resp.access_key.last_used.last_used_date #=> Time
resp.access_key.last_used.region #=> String
resp.access_key.last_used.service_name #=> String
resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :bucket_name (required, String)

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

Returns:

See Also:



1196
1197
1198
1199
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 1196

def create_bucket_access_key(params = {}, options = {})
  req = build_request(:create_bucket_access_key, params)
  req.send_request(options)
end

#create_certificate(params = {}) ⇒ Types::CreateCertificateResult

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

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

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

Examples:

Request syntax with placeholder values


resp = client.create_certificate({
  certificate_name: "CertificateName", # required
  domain_name: "DomainName", # required
  subject_alternative_names: ["DomainName"],
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Response structure


resp.certificate.certificate_arn #=> String
resp.certificate.certificate_name #=> String
resp.certificate.domain_name #=> String
resp.certificate.certificate_detail.arn #=> String
resp.certificate.certificate_detail.name #=> String
resp.certificate.certificate_detail.domain_name #=> String
resp.certificate.certificate_detail.status #=> String, one of "PENDING_VALIDATION", "ISSUED", "INACTIVE", "EXPIRED", "VALIDATION_TIMED_OUT", "REVOKED", "FAILED"
resp.certificate.certificate_detail.serial_number #=> String
resp.certificate.certificate_detail.subject_alternative_names #=> Array
resp.certificate.certificate_detail.subject_alternative_names[0] #=> String
resp.certificate.certificate_detail.domain_validation_records #=> Array
resp.certificate.certificate_detail.domain_validation_records[0].domain_name #=> String
resp.certificate.certificate_detail.domain_validation_records[0].resource_record.name #=> String
resp.certificate.certificate_detail.domain_validation_records[0].resource_record.type #=> String
resp.certificate.certificate_detail.domain_validation_records[0].resource_record.value #=> String
resp.certificate.certificate_detail.domain_validation_records[0].dns_record_creation_state.code #=> String, one of "SUCCEEDED", "STARTED", "FAILED"
resp.certificate.certificate_detail.domain_validation_records[0].dns_record_creation_state.message #=> String
resp.certificate.certificate_detail.domain_validation_records[0].validation_status #=> String, one of "PENDING_VALIDATION", "FAILED", "SUCCESS"
resp.certificate.certificate_detail.request_failure_reason #=> String
resp.certificate.certificate_detail.in_use_resource_count #=> Integer
resp.certificate.certificate_detail.key_algorithm #=> String
resp.certificate.certificate_detail.created_at #=> Time
resp.certificate.certificate_detail.issued_at #=> Time
resp.certificate.certificate_detail.issuer_ca #=> String
resp.certificate.certificate_detail.not_before #=> Time
resp.certificate.certificate_detail.not_after #=> Time
resp.certificate.certificate_detail.eligible_to_renew #=> String
resp.certificate.certificate_detail.renewal_summary.domain_validation_records #=> Array
resp.certificate.certificate_detail.renewal_summary.domain_validation_records[0].domain_name #=> String
resp.certificate.certificate_detail.renewal_summary.domain_validation_records[0].resource_record.name #=> String
resp.certificate.certificate_detail.renewal_summary.domain_validation_records[0].resource_record.type #=> String
resp.certificate.certificate_detail.renewal_summary.domain_validation_records[0].resource_record.value #=> String
resp.certificate.certificate_detail.renewal_summary.domain_validation_records[0].dns_record_creation_state.code #=> String, one of "SUCCEEDED", "STARTED", "FAILED"
resp.certificate.certificate_detail.renewal_summary.domain_validation_records[0].dns_record_creation_state.message #=> String
resp.certificate.certificate_detail.renewal_summary.domain_validation_records[0].validation_status #=> String, one of "PENDING_VALIDATION", "FAILED", "SUCCESS"
resp.certificate.certificate_detail.renewal_summary.renewal_status #=> String, one of "PendingAutoRenewal", "PendingValidation", "Success", "Failed"
resp.certificate.certificate_detail.renewal_summary.renewal_status_reason #=> String
resp.certificate.certificate_detail.renewal_summary.updated_at #=> Time
resp.certificate.certificate_detail.revoked_at #=> Time
resp.certificate.certificate_detail.revocation_reason #=> String
resp.certificate.certificate_detail.tags #=> Array
resp.certificate.certificate_detail.tags[0].key #=> String
resp.certificate.certificate_detail.tags[0].value #=> String
resp.certificate.certificate_detail.support_code #=> String
resp.certificate.tags #=> Array
resp.certificate.tags[0].key #=> String
resp.certificate.tags[0].value #=> String
resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :certificate_name (required, String)

    The name for the certificate.

  • :domain_name (required, String)

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

  • :subject_alternative_names (Array<String>)

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

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

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

  • :tags (Array<Types::Tag>)

    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.

Returns:

See Also:



1325
1326
1327
1328
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 1325

def create_certificate(params = {}, options = {})
  req = build_request(:create_certificate, params)
  req.send_request(options)
end

#create_cloud_formation_stack(params = {}) ⇒ Types::CreateCloudFormationStackResult

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

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

Examples:

Request syntax with placeholder values


resp = client.create_cloud_formation_stack({
  instances: [ # required
    {
      source_name: "ResourceName", # required
      instance_type: "NonEmptyString", # required
      port_info_source: "DEFAULT", # required, accepts DEFAULT, INSTANCE, NONE, CLOSED
      user_data: "string",
      availability_zone: "string", # required
    },
  ],
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :instances (required, Array<Types::InstanceEntry>)

    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.

Returns:

See Also:



1385
1386
1387
1388
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 1385

def create_cloud_formation_stack(params = {}, options = {})
  req = build_request(:create_cloud_formation_stack, params)
  req.send_request(options)
end

#create_contact_method(params = {}) ⇒ Types::CreateContactMethodResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_contact_method({
  protocol: "Email", # required, accepts Email, SMS
  contact_endpoint: "StringMax256", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :protocol (required, String)

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

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

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

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

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

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

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

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

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

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

  • :contact_endpoint (required, String)

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

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

Returns:

See Also:



1484
1485
1486
1487
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 1484

def create_contact_method(params = {}, options = {})
  req = build_request(:create_contact_method, params)
  req.send_request(options)
end

#create_container_service(params = {}) ⇒ Types::CreateContainerServiceResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_container_service({
  service_name: "ContainerServiceName", # required
  power: "nano", # required, accepts nano, micro, small, medium, large, xlarge
  scale: 1, # required
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
  public_domain_names: {
    "string" => ["string"],
  },
  deployment: {
    containers: {
      "ContainerName" => {
        image: "string",
        command: ["string"],
        environment: {
          "string" => "string",
        },
        ports: {
          "string" => "HTTP", # accepts HTTP, HTTPS, TCP, UDP
        },
      },
    },
    public_endpoint: {
      container_name: "string", # required
      container_port: 1, # required
      health_check: {
        healthy_threshold: 1,
        unhealthy_threshold: 1,
        timeout_seconds: 1,
        interval_seconds: 1,
        path: "string",
        success_codes: "string",
      },
    },
  },
  private_registry_access: {
    ecr_image_puller_role: {
      is_active: false,
    },
  },
})

Response structure


resp.container_service.container_service_name #=> String
resp.container_service.arn #=> String
resp.container_service.created_at #=> Time
resp.container_service.location.availability_zone #=> String
resp.container_service.location.region_name #=> String, one of "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"
resp.container_service.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.container_service.tags #=> Array
resp.container_service.tags[0].key #=> String
resp.container_service.tags[0].value #=> String
resp.container_service.power #=> String, one of "nano", "micro", "small", "medium", "large", "xlarge"
resp.container_service.power_id #=> String
resp.container_service.state #=> String, one of "PENDING", "READY", "RUNNING", "UPDATING", "DELETING", "DISABLED", "DEPLOYING"
resp.container_service.state_detail.code #=> String, one of "CREATING_SYSTEM_RESOURCES", "CREATING_NETWORK_INFRASTRUCTURE", "PROVISIONING_CERTIFICATE", "PROVISIONING_SERVICE", "CREATING_DEPLOYMENT", "EVALUATING_HEALTH_CHECK", "ACTIVATING_DEPLOYMENT", "CERTIFICATE_LIMIT_EXCEEDED", "UNKNOWN_ERROR"
resp.container_service.state_detail.message #=> String
resp.container_service.scale #=> Integer
resp.container_service.current_deployment.version #=> Integer
resp.container_service.current_deployment.state #=> String, one of "ACTIVATING", "ACTIVE", "INACTIVE", "FAILED"
resp.container_service.current_deployment.containers #=> Hash
resp.container_service.current_deployment.containers["ContainerName"].image #=> String
resp.container_service.current_deployment.containers["ContainerName"].command #=> Array
resp.container_service.current_deployment.containers["ContainerName"].command[0] #=> String
resp.container_service.current_deployment.containers["ContainerName"].environment #=> Hash
resp.container_service.current_deployment.containers["ContainerName"].environment["string"] #=> String
resp.container_service.current_deployment.containers["ContainerName"].ports #=> Hash
resp.container_service.current_deployment.containers["ContainerName"].ports["string"] #=> String, one of "HTTP", "HTTPS", "TCP", "UDP"
resp.container_service.current_deployment.public_endpoint.container_name #=> String
resp.container_service.current_deployment.public_endpoint.container_port #=> Integer
resp.container_service.current_deployment.public_endpoint.health_check.healthy_threshold #=> Integer
resp.container_service.current_deployment.public_endpoint.health_check.unhealthy_threshold #=> Integer
resp.container_service.current_deployment.public_endpoint.health_check.timeout_seconds #=> Integer
resp.container_service.current_deployment.public_endpoint.health_check.interval_seconds #=> Integer
resp.container_service.current_deployment.public_endpoint.health_check.path #=> String
resp.container_service.current_deployment.public_endpoint.health_check.success_codes #=> String
resp.container_service.current_deployment.created_at #=> Time
resp.container_service.next_deployment.version #=> Integer
resp.container_service.next_deployment.state #=> String, one of "ACTIVATING", "ACTIVE", "INACTIVE", "FAILED"
resp.container_service.next_deployment.containers #=> Hash
resp.container_service.next_deployment.containers["ContainerName"].image #=> String
resp.container_service.next_deployment.containers["ContainerName"].command #=> Array
resp.container_service.next_deployment.containers["ContainerName"].command[0] #=> String
resp.container_service.next_deployment.containers["ContainerName"].environment #=> Hash
resp.container_service.next_deployment.containers["ContainerName"].environment["string"] #=> String
resp.container_service.next_deployment.containers["ContainerName"].ports #=> Hash
resp.container_service.next_deployment.containers["ContainerName"].ports["string"] #=> String, one of "HTTP", "HTTPS", "TCP", "UDP"
resp.container_service.next_deployment.public_endpoint.container_name #=> String
resp.container_service.next_deployment.public_endpoint.container_port #=> Integer
resp.container_service.next_deployment.public_endpoint.health_check.healthy_threshold #=> Integer
resp.container_service.next_deployment.public_endpoint.health_check.unhealthy_threshold #=> Integer
resp.container_service.next_deployment.public_endpoint.health_check.timeout_seconds #=> Integer
resp.container_service.next_deployment.public_endpoint.health_check.interval_seconds #=> Integer
resp.container_service.next_deployment.public_endpoint.health_check.path #=> String
resp.container_service.next_deployment.public_endpoint.health_check.success_codes #=> String
resp.container_service.next_deployment.created_at #=> Time
resp.container_service.is_disabled #=> Boolean
resp.container_service.principal_arn #=> String
resp.container_service.private_domain_name #=> String
resp.container_service.public_domain_names #=> Hash
resp.container_service.public_domain_names["string"] #=> Array
resp.container_service.public_domain_names["string"][0] #=> String
resp.container_service.url #=> String
resp.container_service.private_registry_access.ecr_image_puller_role.is_active #=> Boolean
resp.container_service.private_registry_access.ecr_image_puller_role.principal_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :service_name (required, String)

    The name for the container service.

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

    The following are the requirements for container service names:

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

    • Must contain 1 to 63 characters.

    • Must contain only alphanumeric characters and hyphens.

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

  • :power (required, String)

    The power specification for the container service.

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

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

  • :scale (required, Integer)

    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.

  • :tags (Array<Types::Tag>)

    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.

  • :public_domain_names (Hash<String,Array>)

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

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

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

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

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

  • :deployment (Types::ContainerServiceDeploymentRequest)

    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.

  • :private_registry_access (Types::PrivateRegistryAccessRequest)

    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.

Returns:

See Also:



1723
1724
1725
1726
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 1723

def create_container_service(params = {}, options = {})
  req = build_request(:create_container_service, params)
  req.send_request(options)
end

#create_container_service_deployment(params = {}) ⇒ Types::CreateContainerServiceDeploymentResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_container_service_deployment({
  service_name: "ContainerServiceName", # required
  containers: {
    "ContainerName" => {
      image: "string",
      command: ["string"],
      environment: {
        "string" => "string",
      },
      ports: {
        "string" => "HTTP", # accepts HTTP, HTTPS, TCP, UDP
      },
    },
  },
  public_endpoint: {
    container_name: "string", # required
    container_port: 1, # required
    health_check: {
      healthy_threshold: 1,
      unhealthy_threshold: 1,
      timeout_seconds: 1,
      interval_seconds: 1,
      path: "string",
      success_codes: "string",
    },
  },
})

Response structure


resp.container_service.container_service_name #=> String
resp.container_service.arn #=> String
resp.container_service.created_at #=> Time
resp.container_service.location.availability_zone #=> String
resp.container_service.location.region_name #=> String, one of "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"
resp.container_service.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.container_service.tags #=> Array
resp.container_service.tags[0].key #=> String
resp.container_service.tags[0].value #=> String
resp.container_service.power #=> String, one of "nano", "micro", "small", "medium", "large", "xlarge"
resp.container_service.power_id #=> String
resp.container_service.state #=> String, one of "PENDING", "READY", "RUNNING", "UPDATING", "DELETING", "DISABLED", "DEPLOYING"
resp.container_service.state_detail.code #=> String, one of "CREATING_SYSTEM_RESOURCES", "CREATING_NETWORK_INFRASTRUCTURE", "PROVISIONING_CERTIFICATE", "PROVISIONING_SERVICE", "CREATING_DEPLOYMENT", "EVALUATING_HEALTH_CHECK", "ACTIVATING_DEPLOYMENT", "CERTIFICATE_LIMIT_EXCEEDED", "UNKNOWN_ERROR"
resp.container_service.state_detail.message #=> String
resp.container_service.scale #=> Integer
resp.container_service.current_deployment.version #=> Integer
resp.container_service.current_deployment.state #=> String, one of "ACTIVATING", "ACTIVE", "INACTIVE", "FAILED"
resp.container_service.current_deployment.containers #=> Hash
resp.container_service.current_deployment.containers["ContainerName"].image #=> String
resp.container_service.current_deployment.containers["ContainerName"].command #=> Array
resp.container_service.current_deployment.containers["ContainerName"].command[0] #=> String
resp.container_service.current_deployment.containers["ContainerName"].environment #=> Hash
resp.container_service.current_deployment.containers["ContainerName"].environment["string"] #=> String
resp.container_service.current_deployment.containers["ContainerName"].ports #=> Hash
resp.container_service.current_deployment.containers["ContainerName"].ports["string"] #=> String, one of "HTTP", "HTTPS", "TCP", "UDP"
resp.container_service.current_deployment.public_endpoint.container_name #=> String
resp.container_service.current_deployment.public_endpoint.container_port #=> Integer
resp.container_service.current_deployment.public_endpoint.health_check.healthy_threshold #=> Integer
resp.container_service.current_deployment.public_endpoint.health_check.unhealthy_threshold #=> Integer
resp.container_service.current_deployment.public_endpoint.health_check.timeout_seconds #=> Integer
resp.container_service.current_deployment.public_endpoint.health_check.interval_seconds #=> Integer
resp.container_service.current_deployment.public_endpoint.health_check.path #=> String
resp.container_service.current_deployment.public_endpoint.health_check.success_codes #=> String
resp.container_service.current_deployment.created_at #=> Time
resp.container_service.next_deployment.version #=> Integer
resp.container_service.next_deployment.state #=> String, one of "ACTIVATING", "ACTIVE", "INACTIVE", "FAILED"
resp.container_service.next_deployment.containers #=> Hash
resp.container_service.next_deployment.containers["ContainerName"].image #=> String
resp.container_service.next_deployment.containers["ContainerName"].command #=> Array
resp.container_service.next_deployment.containers["ContainerName"].command[0] #=> String
resp.container_service.next_deployment.containers["ContainerName"].environment #=> Hash
resp.container_service.next_deployment.containers["ContainerName"].environment["string"] #=> String
resp.container_service.next_deployment.containers["ContainerName"].ports #=> Hash
resp.container_service.next_deployment.containers["ContainerName"].ports["string"] #=> String, one of "HTTP", "HTTPS", "TCP", "UDP"
resp.container_service.next_deployment.public_endpoint.container_name #=> String
resp.container_service.next_deployment.public_endpoint.container_port #=> Integer
resp.container_service.next_deployment.public_endpoint.health_check.healthy_threshold #=> Integer
resp.container_service.next_deployment.public_endpoint.health_check.unhealthy_threshold #=> Integer
resp.container_service.next_deployment.public_endpoint.health_check.timeout_seconds #=> Integer
resp.container_service.next_deployment.public_endpoint.health_check.interval_seconds #=> Integer
resp.container_service.next_deployment.public_endpoint.health_check.path #=> String
resp.container_service.next_deployment.public_endpoint.health_check.success_codes #=> String
resp.container_service.next_deployment.created_at #=> Time
resp.container_service.is_disabled #=> Boolean
resp.container_service.principal_arn #=> String
resp.container_service.private_domain_name #=> String
resp.container_service.public_domain_names #=> Hash
resp.container_service.public_domain_names["string"] #=> Array
resp.container_service.public_domain_names["string"][0] #=> String
resp.container_service.url #=> String
resp.container_service.private_registry_access.ecr_image_puller_role.is_active #=> Boolean
resp.container_service.private_registry_access.ecr_image_puller_role.principal_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :service_name (required, String)

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

  • :containers (Hash<String,Types::Container>)

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

  • :public_endpoint (Types::EndpointRequest)

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

Returns:

See Also:



1861
1862
1863
1864
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 1861

def create_container_service_deployment(params = {}, options = {})
  req = build_request(:create_container_service_deployment, params)
  req.send_request(options)
end

#create_container_service_registry_login(params = {}) ⇒ Types::CreateContainerServiceRegistryLoginResult

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

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

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

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

Examples:

Response structure


resp..username #=> String
resp..password #=> String
resp..expires_at #=> Time
resp..registry #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Returns:

See Also:



1913
1914
1915
1916
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 1913

def (params = {}, options = {})
  req = build_request(:create_container_service_registry_login, params)
  req.send_request(options)
end

#create_disk(params = {}) ⇒ Types::CreateDiskResult

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

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

Examples:

Request syntax with placeholder values


resp = client.create_disk({
  disk_name: "ResourceName", # required
  availability_zone: "NonEmptyString", # required
  size_in_gb: 1, # required
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
  add_ons: [
    {
      add_on_type: "AutoSnapshot", # required, accepts AutoSnapshot, StopInstanceOnIdle
      auto_snapshot_add_on_request: {
        snapshot_time_of_day: "TimeOfDay",
      },
      stop_instance_on_idle_request: {
        threshold: "string",
        duration: "string",
      },
    },
  ],
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :disk_name (required, String)

    The unique Lightsail disk name (my-disk).

  • :availability_zone (required, String)

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

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

  • :size_in_gb (required, Integer)

    The size of the disk in GB (32).

  • :tags (Array<Types::Tag>)

    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.

  • :add_ons (Array<Types::AddOnRequest>)

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

Returns:

See Also:



2003
2004
2005
2006
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 2003

def create_disk(params = {}, options = {})
  req = build_request(:create_disk, params)
  req.send_request(options)
end

#create_disk_from_snapshot(params = {}) ⇒ Types::CreateDiskFromSnapshotResult

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

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

Examples:

Request syntax with placeholder values


resp = client.create_disk_from_snapshot({
  disk_name: "ResourceName", # required
  disk_snapshot_name: "ResourceName",
  availability_zone: "NonEmptyString", # required
  size_in_gb: 1, # required
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
  add_ons: [
    {
      add_on_type: "AutoSnapshot", # required, accepts AutoSnapshot, StopInstanceOnIdle
      auto_snapshot_add_on_request: {
        snapshot_time_of_day: "TimeOfDay",
      },
      stop_instance_on_idle_request: {
        threshold: "string",
        duration: "string",
      },
    },
  ],
  source_disk_name: "string",
  restore_date: "string",
  use_latest_restorable_auto_snapshot: false,
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :disk_name (required, String)

    The unique Lightsail disk name (my-disk).

  • :disk_snapshot_name (String)

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

    Constraint:

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

    ^

  • :availability_zone (required, String)

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

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

  • :size_in_gb (required, Integer)

    The size of the disk in GB (32).

  • :tags (Array<Types::Tag>)

    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.

  • :add_ons (Array<Types::AddOnRequest>)

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

  • :source_disk_name (String)

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

    Constraints:

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

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

  • :restore_date (String)

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

    Constraints:

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

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

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

  • :use_latest_restorable_auto_snapshot (Boolean)

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

    Constraints:

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

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

Returns:

See Also:



2168
2169
2170
2171
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 2168

def create_disk_from_snapshot(params = {}, options = {})
  req = build_request(:create_disk_from_snapshot, params)
  req.send_request(options)
end

#create_disk_snapshot(params = {}) ⇒ Types::CreateDiskSnapshotResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_disk_snapshot({
  disk_name: "ResourceName",
  disk_snapshot_name: "ResourceName", # required
  instance_name: "ResourceName",
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :disk_name (String)

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

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

  • :disk_snapshot_name (required, String)

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

  • :instance_name (String)

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

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

  • :tags (Array<Types::Tag>)

    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.

Returns:

See Also:



2275
2276
2277
2278
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 2275

def create_disk_snapshot(params = {}, options = {})
  req = build_request(:create_disk_snapshot, params)
  req.send_request(options)
end

#create_distribution(params = {}) ⇒ Types::CreateDistributionResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_distribution({
  distribution_name: "ResourceName", # required
  origin: { # required
    name: "ResourceName",
    region_name: "us-east-1", # accepts 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
    protocol_policy: "http-only", # accepts http-only, https-only
    response_timeout: 1,
  },
  default_cache_behavior: { # required
    behavior: "dont-cache", # accepts dont-cache, cache
  },
  cache_behavior_settings: {
    default_ttl: 1,
    minimum_ttl: 1,
    maximum_ttl: 1,
    allowed_http_methods: "NonEmptyString",
    cached_http_methods: "NonEmptyString",
    forwarded_cookies: {
      option: "none", # accepts none, allow-list, all
      cookies_allow_list: ["string"],
    },
    forwarded_headers: {
      option: "none", # accepts none, allow-list, all
      headers_allow_list: ["Accept"], # accepts 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
    },
    forwarded_query_strings: {
      option: false,
      query_strings_allow_list: ["string"],
    },
  },
  cache_behaviors: [
    {
      path: "string",
      behavior: "dont-cache", # accepts dont-cache, cache
    },
  ],
  bundle_id: "string", # required
  ip_address_type: "dualstack", # accepts dualstack, ipv4, ipv6
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
  certificate_name: "ResourceName",
  viewer_minimum_tls_protocol_version: "TLSv1.1_2016", # accepts TLSv1.1_2016, TLSv1.2_2018, TLSv1.2_2019, TLSv1.2_2021
})

Response structure


resp.distribution.name #=> String
resp.distribution.arn #=> String
resp.distribution.support_code #=> String
resp.distribution.created_at #=> Time
resp.distribution.location.availability_zone #=> String
resp.distribution.location.region_name #=> String, one of "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"
resp.distribution.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.distribution.alternative_domain_names #=> Array
resp.distribution.alternative_domain_names[0] #=> String
resp.distribution.status #=> String
resp.distribution.is_enabled #=> Boolean
resp.distribution.domain_name #=> String
resp.distribution.bundle_id #=> String
resp.distribution.certificate_name #=> String
resp.distribution.origin.name #=> String
resp.distribution.origin.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.distribution.origin.region_name #=> String, one of "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"
resp.distribution.origin.protocol_policy #=> String, one of "http-only", "https-only"
resp.distribution.origin.response_timeout #=> Integer
resp.distribution.origin_public_dns #=> String
resp.distribution.default_cache_behavior.behavior #=> String, one of "dont-cache", "cache"
resp.distribution.cache_behavior_settings.default_ttl #=> Integer
resp.distribution.cache_behavior_settings.minimum_ttl #=> Integer
resp.distribution.cache_behavior_settings.maximum_ttl #=> Integer
resp.distribution.cache_behavior_settings.allowed_http_methods #=> String
resp.distribution.cache_behavior_settings.cached_http_methods #=> String
resp.distribution.cache_behavior_settings.forwarded_cookies.option #=> String, one of "none", "allow-list", "all"
resp.distribution.cache_behavior_settings.forwarded_cookies.cookies_allow_list #=> Array
resp.distribution.cache_behavior_settings.forwarded_cookies.cookies_allow_list[0] #=> String
resp.distribution.cache_behavior_settings.forwarded_headers.option #=> String, one of "none", "allow-list", "all"
resp.distribution.cache_behavior_settings.forwarded_headers.headers_allow_list #=> Array
resp.distribution.cache_behavior_settings.forwarded_headers.headers_allow_list[0] #=> String, one of "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"
resp.distribution.cache_behavior_settings.forwarded_query_strings.option #=> Boolean
resp.distribution.cache_behavior_settings.forwarded_query_strings.query_strings_allow_list #=> Array
resp.distribution.cache_behavior_settings.forwarded_query_strings.query_strings_allow_list[0] #=> String
resp.distribution.cache_behaviors #=> Array
resp.distribution.cache_behaviors[0].path #=> String
resp.distribution.cache_behaviors[0].behavior #=> String, one of "dont-cache", "cache"
resp.distribution.able_to_update_bundle #=> Boolean
resp.distribution.ip_address_type #=> String, one of "dualstack", "ipv4", "ipv6"
resp.distribution.tags #=> Array
resp.distribution.tags[0].key #=> String
resp.distribution.tags[0].value #=> String
resp.distribution.viewer_minimum_tls_protocol_version #=> String
resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operation.created_at #=> Time
resp.operation.location.availability_zone #=> String
resp.operation.location.region_name #=> String, one of "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"
resp.operation.is_terminal #=> Boolean
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :distribution_name (required, String)

    The name for the distribution.

  • :origin (required, Types::InputOrigin)

    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.

  • :default_cache_behavior (required, Types::CacheBehavior)

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

  • :cache_behavior_settings (Types::CacheSettings)

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

  • :cache_behaviors (Array<Types::CacheBehaviorPerPath>)

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

  • :bundle_id (required, String)

    The bundle ID to use for the distribution.

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

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

  • :ip_address_type (String)

    The IP address type for the distribution.

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

    The default value is dualstack.

  • :tags (Array<Types::Tag>)

    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.

  • :certificate_name (String)

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

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

  • :viewer_minimum_tls_protocol_version (String)

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

Returns:

See Also:



2470
2471
2472
2473
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 2470

def create_distribution(params = {}, options = {})
  req = build_request(:create_distribution, params)
  req.send_request(options)
end

#create_domain(params = {}) ⇒ Types::CreateDomainResult

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

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

Examples:

Request syntax with placeholder values


resp = client.create_domain({
  domain_name: "DomainName", # required
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operation.created_at #=> Time
resp.operation.location.availability_zone #=> String
resp.operation.location.region_name #=> String, one of "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"
resp.operation.is_terminal #=> Boolean
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :domain_name (required, String)

    The domain name to manage (example.com).

  • :tags (Array<Types::Tag>)

    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.

Returns:

See Also:



2529
2530
2531
2532
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 2529

def create_domain(params = {}, options = {})
  req = build_request(:create_domain, params)
  req.send_request(options)
end

#create_domain_entry(params = {}) ⇒ Types::CreateDomainEntryResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_domain_entry({
  domain_name: "DomainName", # required
  domain_entry: { # required
    id: "NonEmptyString",
    name: "DomainName",
    target: "string",
    is_alias: false,
    type: "DomainEntryType",
    options: {
      "DomainEntryOptionsKeys" => "string",
    },
  },
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operation.created_at #=> Time
resp.operation.location.availability_zone #=> String
resp.operation.location.region_name #=> String, one of "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"
resp.operation.is_terminal #=> Boolean
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :domain_name (required, String)

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

  • :domain_entry (required, Types::DomainEntry)

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

Returns:

See Also:



2595
2596
2597
2598
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 2595

def create_domain_entry(params = {}, options = {})
  req = build_request(:create_domain_entry, params)
  req.send_request(options)
end

#create_gui_session_access_details(params = {}) ⇒ Types::CreateGUISessionAccessDetailsResult

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

Use StartGUISession to open the session.

Examples:

Request syntax with placeholder values


resp = client.create_gui_session_access_details({
  resource_name: "ResourceName", # required
})

Response structure


resp.resource_name #=> String
resp.status #=> String, one of "startExpired", "notStarted", "started", "starting", "stopped", "stopping", "settingUpInstance", "failedInstanceCreation", "failedStartingGUISession", "failedStoppingGUISession"
resp.percentage_complete #=> Integer
resp.failure_reason #=> String
resp.sessions #=> Array
resp.sessions[0].name #=> String
resp.sessions[0].url #=> String
resp.sessions[0].is_primary #=> Boolean

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource_name (required, String)

    The resource name.

Returns:

See Also:



2640
2641
2642
2643
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 2640

def create_gui_session_access_details(params = {}, options = {})
  req = build_request(:create_gui_session_access_details, params)
  req.send_request(options)
end

#create_instance_snapshot(params = {}) ⇒ Types::CreateInstanceSnapshotResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_instance_snapshot({
  instance_snapshot_name: "ResourceName", # required
  instance_name: "ResourceName", # required
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :instance_snapshot_name (required, String)

    The name for your new snapshot.

  • :instance_name (required, String)

    The Lightsail instance on which to base your snapshot.

  • :tags (Array<Types::Tag>)

    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.

Returns:

See Also:



2706
2707
2708
2709
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 2706

def create_instance_snapshot(params = {}, options = {})
  req = build_request(:create_instance_snapshot, params)
  req.send_request(options)
end

#create_instances(params = {}) ⇒ Types::CreateInstancesResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_instances({
  instance_names: ["string"], # required
  availability_zone: "string", # required
  custom_image_name: "ResourceName",
  blueprint_id: "NonEmptyString", # required
  bundle_id: "NonEmptyString", # required
  user_data: "string",
  key_pair_name: "ResourceName",
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
  add_ons: [
    {
      add_on_type: "AutoSnapshot", # required, accepts AutoSnapshot, StopInstanceOnIdle
      auto_snapshot_add_on_request: {
        snapshot_time_of_day: "TimeOfDay",
      },
      stop_instance_on_idle_request: {
        threshold: "string",
        duration: "string",
      },
    },
  ],
  ip_address_type: "dualstack", # accepts dualstack, ipv4, ipv6
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :instance_names (required, Array<String>)

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

  • :availability_zone (required, String)

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

  • :custom_image_name (String) — default: Discontinued

    The name for your custom image.

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

  • :blueprint_id (required, String)

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

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

  • :bundle_id (required, String)

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

  • :user_data (String)

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

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

  • :key_pair_name (String)

    The name of your key pair.

  • :tags (Array<Types::Tag>)

    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.

  • :add_ons (Array<Types::AddOnRequest>)

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

  • :ip_address_type (String)

    The IP address type for the instance.

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

    The default value is dualstack.

Returns:

See Also:



2853
2854
2855
2856
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 2853

def create_instances(params = {}, options = {})
  req = build_request(:create_instances, params)
  req.send_request(options)
end

#create_instances_from_snapshot(params = {}) ⇒ Types::CreateInstancesFromSnapshotResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_instances_from_snapshot({
  instance_names: ["string"], # required
  attached_disk_mapping: {
    "ResourceName" => [
      {
        original_disk_path: "NonEmptyString",
        new_disk_name: "ResourceName",
      },
    ],
  },
  availability_zone: "string", # required
  instance_snapshot_name: "ResourceName",
  bundle_id: "NonEmptyString", # required
  user_data: "string",
  key_pair_name: "ResourceName",
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
  add_ons: [
    {
      add_on_type: "AutoSnapshot", # required, accepts AutoSnapshot, StopInstanceOnIdle
      auto_snapshot_add_on_request: {
        snapshot_time_of_day: "TimeOfDay",
      },
      stop_instance_on_idle_request: {
        threshold: "string",
        duration: "string",
      },
    },
  ],
  ip_address_type: "dualstack", # accepts dualstack, ipv4, ipv6
  source_instance_name: "string",
  restore_date: "string",
  use_latest_restorable_auto_snapshot: false,
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :instance_names (required, Array<String>)

    The names for your new instances.

  • :attached_disk_mapping (Hash<String,Array>)

    An object containing information about one or more disk mappings.

  • :availability_zone (required, String)

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

  • :instance_snapshot_name (String)

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

    Constraint:

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

    ^

  • :bundle_id (required, String)

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

  • :user_data (String)

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

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

  • :key_pair_name (String)

    The name for your key pair.

  • :tags (Array<Types::Tag>)

    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.

  • :add_ons (Array<Types::AddOnRequest>)

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

  • :ip_address_type (String)

    The IP address type for the instance.

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

    The default value is dualstack.

  • :source_instance_name (String)

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

    Constraints:

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

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

  • :restore_date (String)

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

    Constraints:

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

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

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

  • :use_latest_restorable_auto_snapshot (Boolean)

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

    Constraints:

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

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

Returns:

See Also:



3062
3063
3064
3065
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 3062

def create_instances_from_snapshot(params = {}, options = {})
  req = build_request(:create_instances_from_snapshot, params)
  req.send_request(options)
end

#create_key_pair(params = {}) ⇒ Types::CreateKeyPairResult

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

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

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

Examples:

Request syntax with placeholder values


resp = client.create_key_pair({
  key_pair_name: "ResourceName", # required
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Response structure


resp.key_pair.name #=> String
resp.key_pair.arn #=> String
resp.key_pair.support_code #=> String
resp.key_pair.created_at #=> Time
resp.key_pair.location.availability_zone #=> String
resp.key_pair.location.region_name #=> String, one of "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"
resp.key_pair.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.key_pair.tags #=> Array
resp.key_pair.tags[0].key #=> String
resp.key_pair.tags[0].value #=> String
resp.key_pair.fingerprint #=> String
resp.public_key_base_64 #=> String
resp.private_key_base_64 #=> String
resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operation.created_at #=> Time
resp.operation.location.availability_zone #=> String
resp.operation.location.region_name #=> String, one of "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"
resp.operation.is_terminal #=> Boolean
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :key_pair_name (required, String)

    The name for your new key pair.

  • :tags (Array<Types::Tag>)

    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.

Returns:

See Also:



3145
3146
3147
3148
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 3145

def create_key_pair(params = {}, options = {})
  req = build_request(:create_key_pair, params)
  req.send_request(options)
end

#create_load_balancer(params = {}) ⇒ Types::CreateLoadBalancerResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_load_balancer({
  load_balancer_name: "ResourceName", # required
  instance_port: 1, # required
  health_check_path: "string",
  certificate_name: "ResourceName",
  certificate_domain_name: "DomainName",
  certificate_alternative_names: ["DomainName"],
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
  ip_address_type: "dualstack", # accepts dualstack, ipv4, ipv6
  tls_policy_name: "string",
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :load_balancer_name (required, String)

    The name of your load balancer.

  • :instance_port (required, Integer)

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

  • :health_check_path (String)

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

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

  • :certificate_name (String)

    The name of the SSL/TLS certificate.

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

  • :certificate_domain_name (String)

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

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

  • :certificate_alternative_names (Array<String>)

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

  • :tags (Array<Types::Tag>)

    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.

  • :ip_address_type (String)

    The IP address type for the load balancer.

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

    The default value is dualstack.

  • :tls_policy_name (String)

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

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

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

Returns:

See Also:



3273
3274
3275
3276
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 3273

def create_load_balancer(params = {}, options = {})
  req = build_request(:create_load_balancer, params)
  req.send_request(options)
end

#create_load_balancer_tls_certificate(params = {}) ⇒ Types::CreateLoadBalancerTlsCertificateResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_load_balancer_tls_certificate({
  load_balancer_name: "ResourceName", # required
  certificate_name: "ResourceName", # required
  certificate_domain_name: "DomainName", # required
  certificate_alternative_names: ["DomainName"],
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :load_balancer_name (required, String)

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

  • :certificate_name (required, String)

    The SSL/TLS certificate name.

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

  • :certificate_domain_name (required, String)

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

  • :certificate_alternative_names (Array<String>)

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

  • :tags (Array<Types::Tag>)

    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.

Returns:

See Also:



3363
3364
3365
3366
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 3363

def create_load_balancer_tls_certificate(params = {}, options = {})
  req = build_request(:create_load_balancer_tls_certificate, params)
  req.send_request(options)
end

#create_relational_database(params = {}) ⇒ Types::CreateRelationalDatabaseResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_relational_database({
  relational_database_name: "ResourceName", # required
  availability_zone: "string",
  relational_database_blueprint_id: "string", # required
  relational_database_bundle_id: "string", # required
  master_database_name: "string", # required
  master_username: "string", # required
  master_user_password: "SensitiveString",
  preferred_backup_window: "string",
  preferred_maintenance_window: "string",
  publicly_accessible: false,
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :relational_database_name (required, String)

    The name to use for your new Lightsail database resource.

    Constraints:

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

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

  • :availability_zone (String)

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

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

  • :relational_database_blueprint_id (required, String)

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

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

  • :relational_database_bundle_id (required, String)

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

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

  • :master_database_name (required, String)

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

    MySQL

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

    Constraints:

    • Must contain 1 to 64 letters or numbers.

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

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

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

    PostgreSQL

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

    Constraints:

    • Must contain 1 to 63 letters or numbers.

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

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

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

  • :master_username (required, String)

    The name for the master user.

    MySQL

    Constraints:

    • Required for MySQL.

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

    • First character must be a letter.

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

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

    PostgreSQL

    Constraints:

    • Required for PostgreSQL.

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

    • First character must be a letter.

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

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

  • :master_user_password (String)

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

    MySQL

    Constraints: Must contain from 8 to 41 characters.

    PostgreSQL

    Constraints: Must contain from 8 to 128 characters.

  • :preferred_backup_window (String)

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

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

    Constraints:

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

      Example: 16:00-16:30

    • Specified in Coordinated Universal Time (UTC).

    • Must not conflict with the preferred maintenance window.

    • Must be at least 30 minutes.

  • :preferred_maintenance_window (String)

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

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

    Constraints:

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

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

    • Must be at least 30 minutes.

    • Specified in Coordinated Universal Time (UTC).

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

  • :publicly_accessible (Boolean)

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

  • :tags (Array<Types::Tag>)

    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.

Returns:

See Also:



3623
3624
3625
3626
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 3623

def create_relational_database(params = {}, options = {})
  req = build_request(:create_relational_database, params)
  req.send_request(options)
end

#create_relational_database_from_snapshot(params = {}) ⇒ Types::CreateRelationalDatabaseFromSnapshotResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_relational_database_from_snapshot({
  relational_database_name: "ResourceName", # required
  availability_zone: "string",
  publicly_accessible: false,
  relational_database_snapshot_name: "ResourceName",
  relational_database_bundle_id: "string",
  source_relational_database_name: "ResourceName",
  restore_time: Time.now,
  use_latest_restorable_time: false,
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :relational_database_name (required, String)

    The name to use for your new Lightsail database resource.

    Constraints:

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

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

  • :availability_zone (String)

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

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

  • :publicly_accessible (Boolean)

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

  • :relational_database_snapshot_name (String)

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

  • :relational_database_bundle_id (String)

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

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

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

  • :source_relational_database_name (String)

    The name of the source database.

  • :restore_time (Time, DateTime, Date, Integer, String)

    The date and time to restore your database from.

    Constraints:

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

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

    • Specified in Coordinated Universal Time (UTC).

    • Specified in the Unix time format.

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

  • :use_latest_restorable_time (Boolean)

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

    Default: false

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

  • :tags (Array<Types::Tag>)

    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.

Returns:

See Also:



3760
3761
3762
3763
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 3760

def create_relational_database_from_snapshot(params = {}, options = {})
  req = build_request(:create_relational_database_from_snapshot, params)
  req.send_request(options)
end

#create_relational_database_snapshot(params = {}) ⇒ Types::CreateRelationalDatabaseSnapshotResult

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.

Examples:

Request syntax with placeholder values


resp = client.create_relational_database_snapshot({
  relational_database_name: "ResourceName", # required
  relational_database_snapshot_name: "ResourceName", # required
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :relational_database_name (required, String)

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

  • :relational_database_snapshot_name (required, String)

    The name for your new database snapshot.

    Constraints:

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

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

  • :tags (Array<Types::Tag>)

    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.

Returns:

See Also:



3832
3833
3834
3835
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 3832

def create_relational_database_snapshot(params = {}, options = {})
  req = build_request(:create_relational_database_snapshot, params)
  req.send_request(options)
end

#delete_alarm(params = {}) ⇒ Types::DeleteAlarmResult

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.

Examples:

Request syntax with placeholder values


resp = client.delete_alarm({
  alarm_name: "ResourceName", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :alarm_name (required, String)

    The name of the alarm to delete.

Returns:

See Also:



3882
3883
3884
3885
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 3882

def delete_alarm(params = {}, options = {})
  req = build_request(:delete_alarm, params)
  req.send_request(options)
end

#delete_auto_snapshot(params = {}) ⇒ Types::DeleteAutoSnapshotResult

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

Examples:

Request syntax with placeholder values


resp = client.delete_auto_snapshot({
  resource_name: "ResourceName", # required
  date: "AutoSnapshotDate", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource_name (required, String)

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

  • :date (required, String)

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

Returns:

See Also:



3935
3936
3937
3938
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 3935

def delete_auto_snapshot(params = {}, options = {})
  req = build_request(:delete_auto_snapshot, params)
  req.send_request(options)
end

#delete_bucket(params = {}) ⇒ Types::DeleteBucketResult

Deletes a Amazon Lightsail bucket.

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

Examples:

Request syntax with placeholder values


resp = client.delete_bucket({
  bucket_name: "BucketName", # required
  force_delete: false,
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :bucket_name (required, String)

    The name of the bucket to delete.

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

  • :force_delete (Boolean)

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

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

    • The bucket is the origin of a distribution.

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

    • The bucket has objects.

    • The bucket has access keys.

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

Returns:

See Also:



4013
4014
4015
4016
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4013

def delete_bucket(params = {}, options = {})
  req = build_request(:delete_bucket, params)
  req.send_request(options)
end

#delete_bucket_access_key(params = {}) ⇒ Types::DeleteBucketAccessKeyResult

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.

Examples:

Request syntax with placeholder values


resp = client.delete_bucket_access_key({
  bucket_name: "BucketName", # required
  access_key_id: "NonEmptyString", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :bucket_name (required, String)

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

  • :access_key_id (required, String)

    The ID of the access key to delete.

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

Returns:

See Also:



4076
4077
4078
4079
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4076

def delete_bucket_access_key(params = {}, options = {})
  req = build_request(:delete_bucket_access_key, params)
  req.send_request(options)
end

#delete_certificate(params = {}) ⇒ Types::DeleteCertificateResult

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.

Examples:

Request syntax with placeholder values


resp = client.delete_certificate({
  certificate_name: "CertificateName", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :certificate_name (required, String)

    The name of the certificate to delete.

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

Returns:

See Also:



4125
4126
4127
4128
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4125

def delete_certificate(params = {}, options = {})
  req = build_request(:delete_certificate, params)
  req.send_request(options)
end

#delete_contact_method(params = {}) ⇒ Types::DeleteContactMethodResult

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.

Examples:

Request syntax with placeholder values


resp = client.delete_contact_method({
  protocol: "Email", # required, accepts Email, SMS
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :protocol (required, String)

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

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

Returns:

See Also:



4185
4186
4187
4188
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4185

def delete_contact_method(params = {}, options = {})
  req = build_request(:delete_contact_method, params)
  req.send_request(options)
end

#delete_container_image(params = {}) ⇒ Struct

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

Examples:

Request syntax with placeholder values


resp = client.delete_container_image({
  service_name: "ContainerServiceName", # required
  image: "string", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :service_name (required, String)

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

  • :image (required, String)

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

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

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



4224
4225
4226
4227
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4224

def delete_container_image(params = {}, options = {})
  req = build_request(:delete_container_image, params)
  req.send_request(options)
end

#delete_container_service(params = {}) ⇒ Struct

Deletes your Amazon Lightsail container service.

Examples:

Request syntax with placeholder values


resp = client.delete_container_service({
  service_name: "ContainerServiceName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :service_name (required, String)

    The name of the container service to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



4246
4247
4248
4249
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4246

def delete_container_service(params = {}, options = {})
  req = build_request(:delete_container_service, params)
  req.send_request(options)
end

#delete_disk(params = {}) ⇒ Types::DeleteDiskResult

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

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

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

Examples:

Request syntax with placeholder values


resp = client.delete_disk({
  disk_name: "ResourceName", # required
  force_delete_add_ons: false,
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :disk_name (required, String)

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

  • :force_delete_add_ons (Boolean)

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

Returns:

See Also:



4305
4306
4307
4308
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4305

def delete_disk(params = {}, options = {})
  req = build_request(:delete_disk, params)
  req.send_request(options)
end

#delete_disk_snapshot(params = {}) ⇒ Types::DeleteDiskSnapshotResult

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.

Examples:

Request syntax with placeholder values


resp = client.delete_disk_snapshot({
  disk_snapshot_name: "ResourceName", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :disk_snapshot_name (required, String)

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

Returns:

See Also:



4363
4364
4365
4366
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4363

def delete_disk_snapshot(params = {}, options = {})
  req = build_request(:delete_disk_snapshot, params)
  req.send_request(options)
end

#delete_distribution(params = {}) ⇒ Types::DeleteDistributionResult

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

Examples:

Request syntax with placeholder values


resp = client.delete_distribution({
  distribution_name: "ResourceName",
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operation.created_at #=> Time
resp.operation.location.availability_zone #=> String
resp.operation.location.region_name #=> String, one of "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"
resp.operation.is_terminal #=> Boolean
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :distribution_name (String)

    The name of the distribution to delete.

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

Returns:

See Also:



4407
4408
4409
4410
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4407

def delete_distribution(params = {}, options = {})
  req = build_request(:delete_distribution, params)
  req.send_request(options)
end

#delete_domain(params = {}) ⇒ Types::DeleteDomainResult

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

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

Examples:

Request syntax with placeholder values


resp = client.delete_domain({
  domain_name: "DomainName", # required
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operation.created_at #=> Time
resp.operation.location.availability_zone #=> String
resp.operation.location.region_name #=> String, one of "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"
resp.operation.is_terminal #=> Boolean
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :domain_name (required, String)

    The specific domain name to delete.

Returns:

See Also:



4455
4456
4457
4458
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4455

def delete_domain(params = {}, options = {})
  req = build_request(:delete_domain, params)
  req.send_request(options)
end

#delete_domain_entry(params = {}) ⇒ Types::DeleteDomainEntryResult

Deletes a specific domain entry.

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

Examples:

Request syntax with placeholder values


resp = client.delete_domain_entry({
  domain_name: "DomainName", # required
  domain_entry: { # required
    id: "NonEmptyString",
    name: "DomainName",
    target: "string",
    is_alias: false,
    type: "DomainEntryType",
    options: {
      "DomainEntryOptionsKeys" => "string",
    },
  },
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operation.created_at #=> Time
resp.operation.location.availability_zone #=> String
resp.operation.location.region_name #=> String, one of "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"
resp.operation.is_terminal #=> Boolean
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :domain_name (required, String)

    The name of the domain entry to delete.

  • :domain_entry (required, Types::DomainEntry)

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

Returns:

See Also:



4517
4518
4519
4520
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4517

def delete_domain_entry(params = {}, options = {})
  req = build_request(:delete_domain_entry, params)
  req.send_request(options)
end

#delete_instance(params = {}) ⇒ Types::DeleteInstanceResult

Deletes an Amazon Lightsail instance.

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

Examples:

Request syntax with placeholder values


resp = client.delete_instance({
  instance_name: "ResourceName", # required
  force_delete_add_ons: false,
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :instance_name (required, String)

    The name of the instance to delete.

  • :force_delete_add_ons (Boolean)

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

Returns:

See Also:



4571
4572
4573
4574
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4571

def delete_instance(params = {}, options = {})
  req = build_request(:delete_instance, params)
  req.send_request(options)
end

#delete_instance_snapshot(params = {}) ⇒ Types::DeleteInstanceSnapshotResult

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

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

Examples:

Request syntax with placeholder values


resp = client.delete_instance_snapshot({
  instance_snapshot_name: "ResourceName", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :instance_snapshot_name (required, String)

    The name of the snapshot to delete.

Returns:

See Also:



4622
4623
4624
4625
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4622

def delete_instance_snapshot(params = {}, options = {})
  req = build_request(:delete_instance_snapshot, params)
  req.send_request(options)
end

#delete_key_pair(params = {}) ⇒ Types::DeleteKeyPairResult

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

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

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

Examples:

Request syntax with placeholder values


resp = client.delete_key_pair({
  key_pair_name: "ResourceName", # required
  expected_fingerprint: "string",
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operation.created_at #=> Time
resp.operation.location.availability_zone #=> String
resp.operation.location.region_name #=> String, one of "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"
resp.operation.is_terminal #=> Boolean
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :key_pair_name (required, String)

    The name of the key pair to delete.

  • :expected_fingerprint (String)

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

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

Returns:

See Also:



4689
4690
4691
4692
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4689

def delete_key_pair(params = {}, options = {})
  req = build_request(:delete_key_pair, params)
  req.send_request(options)
end

#delete_known_host_keys(params = {}) ⇒ Types::DeleteKnownHostKeysResult

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

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

Examples:

Request syntax with placeholder values


resp = client.delete_known_host_keys({
  instance_name: "ResourceName", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :instance_name (required, String)

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

Returns:

See Also:



4744
4745
4746
4747
# File 'gems/aws-sdk-lightsail/lib/aws-sdk-lightsail/client.rb', line 4744

def delete_known_host_keys(params = {}, options = {})
  req = build_request(:delete_known_host_keys, params)
  req.send_request(options)
end

#delete_load_balancer(params = {}) ⇒ Types::DeleteLoadBalancerResult

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

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

Examples:

Request syntax with placeholder values


resp = client.delete_load_balancer({
  load_balancer_name: "ResourceName", # required
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "ContainerService", "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot", "RelationalDatabase", "RelationalDatabaseSnapshot", "ExportSnapshotRecord", "CloudFormationStackRecord", "Alarm", "ContactMethod", "Distribution", "Certificate", "Bucket"
resp.operations[0].created_at #=> Time
resp.operations[0].location.availability_zone #=> String
resp.operations[0].location.region_name #=> String, one of "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"
resp.operations[0].is_terminal #=> Boolean
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed", "Succeeded"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String