You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::Lightsail::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

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

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

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

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::Lightsail::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

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

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::Lightsail::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :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 and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :simple_json (Boolean) — default: false

    Disables request parameter conversion, validation, and formatting. Also disable response data type conversions. 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.

    When :simple_json is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects. See Plugins::Protocols::JsonRpc for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :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. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#allocate_static_ip(options = {}) ⇒ 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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :static_ip_name (required, String)

    The name of the static IP address.

Returns:

See Also:

#attach_disk(options = {}) ⇒ 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.

Examples:

Request syntax with placeholder values


resp = client.attach_disk({
  disk_name: "ResourceName", # required
  instance_name: "ResourceName", # required
  disk_path: "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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :disk_name (required, String)

    The unique Lightsail disk name (e.g., 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 (e.g., /dev/xvdf).

Returns:

See Also:

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

Attaches one or more Lightsail instances to a load balancer.

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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :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.

Returns:

See Also:

#attach_load_balancer_tls_certificate(options = {}) ⇒ 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).

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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :load_balancer_name (required, String)

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

  • :certificate_name (required, String)

    The name of your TLS/SSL certificate.

Returns:

See Also:

#attach_static_ip(options = {}) ⇒ 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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :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:

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

Closes the public ports on a specific Amazon Lightsail instance.

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
  },
  instance_name: "ResourceName", # required
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Options Hash (options):

  • :port_info (required, Types::PortInfo)

    Information about the public port you are trying to close.

  • :instance_name (required, String)

    The name of the instance on which you\'re attempting to close the public ports.

Returns:

See Also:

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

Creates a block storage disk that can be attached to a Lightsail instance in the same Availability Zone (e.g., us-east-2a). The disk is created in the regional endpoint that you send the HTTP request to. For more information, see Regions and Availability Zones in Lightsail.

Examples:

Request syntax with placeholder values


resp = client.create_disk({
  disk_name: "ResourceName", # required
  availability_zone: "NonEmptyString", # required
  size_in_gb: 1, # 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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :disk_name (required, String)

    The unique Lightsail disk name (e.g., my-disk).

  • :availability_zone (required, String)

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

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

  • :size_in_gb (required, Integer)

    The size of the disk in GB (e.g., 32).

Returns:

See Also:

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

Creates a block storage disk from a disk snapshot that can be attached to a Lightsail instance in the same Availability Zone (e.g., us-east-2a). The disk is created in the regional endpoint that you send the HTTP request to. For more information, see Regions and Availability Zones in Lightsail.

Examples:

Request syntax with placeholder values


resp = client.create_disk_from_snapshot({
  disk_name: "ResourceName", # required
  disk_snapshot_name: "ResourceName", # required
  availability_zone: "NonEmptyString", # required
  size_in_gb: 1, # 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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :disk_name (required, String)

    The unique Lightsail disk name (e.g., my-disk).

  • :disk_snapshot_name (required, String)

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

  • :availability_zone (required, String)

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

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

  • :size_in_gb (required, Integer)

    The size of the disk in GB (e.g., 32).

Returns:

See Also:

#create_disk_snapshot(options = {}) ⇒ 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.

Examples:

Request syntax with placeholder values


resp = client.create_disk_snapshot({
  disk_name: "ResourceName", # required
  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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :disk_name (required, String)

    The unique name of the source disk (e.g., my-source-disk).

  • :disk_snapshot_name (required, String)

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

Returns:

See Also:

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

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

Examples:

Request syntax with placeholder values


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

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Options Hash (options):

  • :domain_name (required, String)

    The domain name to manage (e.g., example.com).

    You cannot register a new domain name using Lightsail. You must register a domain name using Amazon Route 53 or another domain name registrar. If you have already registered your domain, you can enter its name in this parameter to manage the DNS records for that domain.

Returns:

See Also:

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

Creates one of the following entry records associated with the domain: A record, CNAME record, TXT record, or MX record.

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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Options Hash (options):

  • :domain_name (required, String)

    The domain name (e.g., 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:

#create_instance_snapshot(options = {}) ⇒ 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.

Examples:

Request syntax with placeholder values


resp = client.create_instance_snapshot({
  instance_snapshot_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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :instance_snapshot_name (required, String)

    The name for your new snapshot.

  • :instance_name (required, String)

    The Lightsail instance on which to base your snapshot.

Returns:

See Also:

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

Creates one or more Amazon Lightsail virtual private servers, or instances.

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",
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :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: Deprecated

    The name for your custom image.

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

  • :blueprint_id (required, String)

    The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0). Use the get blueprints operation to return a list of available images (or blueprints).

  • :bundle_id (required, String)

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

  • :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 Dev Guide.

  • :key_pair_name (String)

    The name of your key pair.

Returns:

See Also:

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

Uses a specific snapshot as a blueprint for creating one or more new instances that are based on that identical configuration.

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", # required
  bundle_id: "NonEmptyString", # required
  user_data: "string",
  key_pair_name: "ResourceName",
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :instance_names (required, Array<String>)

    The names for your new instances.

  • :attached_disk_mapping (Hash<String,Array<Types::DiskMap>>)

    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 (required, 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.

  • :bundle_id (required, String)

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

  • :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 Dev Guide.

  • :key_pair_name (String)

    The name for your key pair.

Returns:

See Also:

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

Creates sn SSH key pair.

Examples:

Request syntax with placeholder values


resp = client.create_key_pair({
  key_pair_name: "ResourceName", # required
})

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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.key_pair.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Options Hash (options):

  • :key_pair_name (required, String)

    The name for your new key pair.

Returns:

See Also:

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

Creates a Lightsail load balancer.

When you create a load balancer, you can specify certificates and port settings. You can create up to 5 load balancers per AWS Region in your account.

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"],
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :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 (e.g., "/").

  • :certificate_name (String)

    The name of the TLS/SSL 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 (e.g., example.com).

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

  • :certificate_alternative_names (Array<String>)

    The alternative domain names to use with your TLS/SSL certificate (e.g., www.example.com, www.ejemplo.com, ejemplo.com).

Returns:

See Also:

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

Creates a Lightsail load balancer TLS certificate.

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

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"],
})

Response structure


resp.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :load_balancer_name (required, String)

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

  • :certificate_name (required, String)

    The TLS/SSL certificate name.

  • :certificate_domain_name (required, String)

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

  • :certificate_alternative_names (Array<String>)

    An array of strings listing alternative domain names for your TLS/SSL certificate.

Returns:

See Also:

#delete_disk(options = {}) ⇒ 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.

Examples:

Request syntax with placeholder values


resp = client.delete_disk({
  disk_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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :disk_name (required, String)

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

Returns:

See Also:

#delete_disk_snapshot(options = {}) ⇒ 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.

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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :disk_snapshot_name (required, String)

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

Returns:

See Also:

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

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

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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Options Hash (options):

  • :domain_name (required, String)

    The specific domain name to delete.

Returns:

See Also:

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

Deletes a specific domain entry.

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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Options Hash (options):

  • :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:

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

Deletes a specific Amazon Lightsail virtual private server, or instance.

Examples:

Request syntax with placeholder values


resp = client.delete_instance({
  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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :instance_name (required, String)

    The name of the instance to delete.

Returns:

See Also:

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

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

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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :instance_snapshot_name (required, String)

    The name of the snapshot to delete.

Returns:

See Also:

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

Deletes a specific SSH key pair.

Examples:

Request syntax with placeholder values


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

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Options Hash (options):

  • :key_pair_name (required, String)

    The name of the key pair to delete.

Returns:

See Also:

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

Deletes a Lightsail load balancer.

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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :load_balancer_name (required, String)

    The name of the load balancer you want to delete.

Returns:

See Also:

#delete_load_balancer_tls_certificate(options = {}) ⇒ Types::DeleteLoadBalancerTlsCertificateResult

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

Examples:

Request syntax with placeholder values


resp = client.delete_load_balancer_tls_certificate({
  load_balancer_name: "ResourceName", # required
  certificate_name: "ResourceName", # required
  force: 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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :load_balancer_name (required, String)

    The load balancer name.

  • :certificate_name (required, String)

    The TLS/SSL certificate name.

  • :force (Boolean)

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

Returns:

See Also:

#detach_disk(options = {}) ⇒ Types::DetachDiskResult

Detaches a stopped block storage disk from a Lightsail instance. Make sure to unmount any file systems on the device within your operating system before stopping the instance and detaching the disk.

Examples:

Request syntax with placeholder values


resp = client.detach_disk({
  disk_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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :disk_name (required, String)

    The unique name of the disk you want to detach from your instance (e.g., my-disk).

Returns:

See Also:

#detach_instances_from_load_balancer(options = {}) ⇒ Types::DetachInstancesFromLoadBalancerResult

Detaches the specified instances from a Lightsail load balancer.

Examples:

Request syntax with placeholder values


resp = client.detach_instances_from_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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :load_balancer_name (required, String)

    The name of the Lightsail load balancer.

  • :instance_names (required, Array<String>)

    An array of strings containing the names of the instances you want to detach from the load balancer.

Returns:

See Also:

#detach_static_ip(options = {}) ⇒ Types::DetachStaticIpResult

Detaches a static IP from the Amazon Lightsail instance to which it is attached.

Examples:

Request syntax with placeholder values


resp = client.detach_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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :static_ip_name (required, String)

    The name of the static IP to detach from the instance.

Returns:

See Also:

#download_default_key_pair(options = {}) ⇒ Types::DownloadDefaultKeyPairResult

Downloads the default SSH key pair from the user's account.

Examples:

Request syntax with placeholder values


resp = client.download_default_key_pair()

Response structure


resp.public_key_base_64 #=> String
resp.private_key_base_64 #=> String

Returns:

See Also:

#get_active_names(options = {}) ⇒ Types::GetActiveNamesResult

Returns the names of all active (not deleted) resources.

Examples:

Request syntax with placeholder values


resp = client.get_active_names({
  page_token: "string",
})

Response structure


resp.active_names #=> Array
resp.active_names[0] #=> String
resp.next_page_token #=> String

Options Hash (options):

  • :page_token (String)

    A token used for paginating results from your get active names request.

Returns:

See Also:

#get_blueprints(options = {}) ⇒ Types::GetBlueprintsResult

Returns the list of available instance images, or blueprints. You can use a blueprint to create a new virtual private server already running a specific operating system, as well as a preinstalled app or development stack. The software each instance is running depends on the blueprint image you choose.

Examples:

Request syntax with placeholder values


resp = client.get_blueprints({
  include_inactive: false,
  page_token: "string",
})

Response structure


resp.blueprints #=> Array
resp.blueprints[0].blueprint_id #=> String
resp.blueprints[0].name #=> String
resp.blueprints[0].group #=> String
resp.blueprints[0].type #=> String, one of "os", "app"
resp.blueprints[0].description #=> String
resp.blueprints[0].is_active #=> true/false
resp.blueprints[0].min_power #=> Integer
resp.blueprints[0].version #=> String
resp.blueprints[0].version_code #=> String
resp.blueprints[0].product_url #=> String
resp.blueprints[0].license_url #=> String
resp.blueprints[0].platform #=> String, one of "LINUX_UNIX", "WINDOWS"
resp.next_page_token #=> String

Options Hash (options):

  • :include_inactive (Boolean)

    A Boolean value indicating whether to include inactive results in your request.

  • :page_token (String)

    A token used for advancing to the next page of results from your get blueprints request.

Returns:

See Also:

#get_bundles(options = {}) ⇒ Types::GetBundlesResult

Returns the list of bundles that are available for purchase. A bundle describes the specs for your virtual private server (or instance).

Examples:

Request syntax with placeholder values


resp = client.get_bundles({
  include_inactive: false,
  page_token: "string",
})

Response structure


resp.bundles #=> Array
resp.bundles[0].price #=> Float
resp.bundles[0].cpu_count #=> Integer
resp.bundles[0].disk_size_in_gb #=> Integer
resp.bundles[0].bundle_id #=> String
resp.bundles[0].instance_type #=> String
resp.bundles[0].is_active #=> true/false
resp.bundles[0].name #=> String
resp.bundles[0].power #=> Integer
resp.bundles[0].ram_size_in_gb #=> Float
resp.bundles[0].transfer_per_month_in_gb #=> Integer
resp.bundles[0].supported_platforms #=> Array
resp.bundles[0].supported_platforms[0] #=> String, one of "LINUX_UNIX", "WINDOWS"
resp.next_page_token #=> String

Options Hash (options):

  • :include_inactive (Boolean)

    A Boolean value that indicates whether to include inactive bundle results in your request.

  • :page_token (String)

    A token used for advancing to the next page of results from your get bundles request.

Returns:

See Also:

#get_disk(options = {}) ⇒ Types::GetDiskResult

Returns information about a specific block storage disk.

Examples:

Request syntax with placeholder values


resp = client.get_disk({
  disk_name: "ResourceName", # required
})

Response structure


resp.disk.name #=> String
resp.disk.arn #=> String
resp.disk.support_code #=> String
resp.disk.created_at #=> Time
resp.disk.location.availability_zone #=> String
resp.disk.location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.disk.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.disk.size_in_gb #=> Integer
resp.disk.is_system_disk #=> true/false
resp.disk.iops #=> Integer
resp.disk.path #=> String
resp.disk.state #=> String, one of "pending", "error", "available", "in-use", "unknown"
resp.disk.attached_to #=> String
resp.disk.is_attached #=> true/false
resp.disk.attachment_state #=> String
resp.disk.gb_in_use #=> Integer

Options Hash (options):

  • :disk_name (required, String)

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

Returns:

See Also:

#get_disk_snapshot(options = {}) ⇒ Types::GetDiskSnapshotResult

Returns information about a specific block storage disk snapshot.

Examples:

Request syntax with placeholder values


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

Response structure


resp.disk_snapshot.name #=> String
resp.disk_snapshot.arn #=> String
resp.disk_snapshot.support_code #=> String
resp.disk_snapshot.created_at #=> Time
resp.disk_snapshot.location.availability_zone #=> String
resp.disk_snapshot.location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.disk_snapshot.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.disk_snapshot.size_in_gb #=> Integer
resp.disk_snapshot.state #=> String, one of "pending", "completed", "error", "unknown"
resp.disk_snapshot.progress #=> String
resp.disk_snapshot.from_disk_name #=> String
resp.disk_snapshot.from_disk_arn #=> String

Options Hash (options):

  • :disk_snapshot_name (required, String)

    The name of the disk snapshot (e.g., my-disk-snapshot).

Returns:

See Also:

#get_disk_snapshots(options = {}) ⇒ Types::GetDiskSnapshotsResult

Returns information about all block storage disk snapshots in your AWS account and region.

If you are describing a long list of disk snapshots, you can paginate the output to make the list more manageable. You can use the pageToken and nextPageToken values to retrieve the next items in the list.

Examples:

Request syntax with placeholder values


resp = client.get_disk_snapshots({
  page_token: "string",
})

Response structure


resp.disk_snapshots #=> Array
resp.disk_snapshots[0].name #=> String
resp.disk_snapshots[0].arn #=> String
resp.disk_snapshots[0].support_code #=> String
resp.disk_snapshots[0].created_at #=> Time
resp.disk_snapshots[0].location.availability_zone #=> String
resp.disk_snapshots[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.disk_snapshots[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.disk_snapshots[0].size_in_gb #=> Integer
resp.disk_snapshots[0].state #=> String, one of "pending", "completed", "error", "unknown"
resp.disk_snapshots[0].progress #=> String
resp.disk_snapshots[0].from_disk_name #=> String
resp.disk_snapshots[0].from_disk_arn #=> String
resp.next_page_token #=> String

Options Hash (options):

  • :page_token (String)

    A token used for advancing to the next page of results from your GetDiskSnapshots request.

Returns:

See Also:

#get_disks(options = {}) ⇒ Types::GetDisksResult

Returns information about all block storage disks in your AWS account and region.

If you are describing a long list of disks, you can paginate the output to make the list more manageable. You can use the pageToken and nextPageToken values to retrieve the next items in the list.

Examples:

Request syntax with placeholder values


resp = client.get_disks({
  page_token: "string",
})

Response structure


resp.disks #=> Array
resp.disks[0].name #=> String
resp.disks[0].arn #=> String
resp.disks[0].support_code #=> String
resp.disks[0].created_at #=> Time
resp.disks[0].location.availability_zone #=> String
resp.disks[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.disks[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.disks[0].size_in_gb #=> Integer
resp.disks[0].is_system_disk #=> true/false
resp.disks[0].iops #=> Integer
resp.disks[0].path #=> String
resp.disks[0].state #=> String, one of "pending", "error", "available", "in-use", "unknown"
resp.disks[0].attached_to #=> String
resp.disks[0].is_attached #=> true/false
resp.disks[0].attachment_state #=> String
resp.disks[0].gb_in_use #=> Integer
resp.next_page_token #=> String

Options Hash (options):

  • :page_token (String)

    A token used for advancing to the next page of results from your GetDisks request.

Returns:

See Also:

#get_domain(options = {}) ⇒ Types::GetDomainResult

Returns information about a specific domain recordset.

Examples:

Request syntax with placeholder values


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

Response structure


resp.domain.name #=> String
resp.domain.arn #=> String
resp.domain.support_code #=> String
resp.domain.created_at #=> Time
resp.domain.location.availability_zone #=> String
resp.domain.location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.domain.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.domain.domain_entries #=> Array
resp.domain.domain_entries[0].id #=> String
resp.domain.domain_entries[0].name #=> String
resp.domain.domain_entries[0].target #=> String
resp.domain.domain_entries[0].is_alias #=> true/false
resp.domain.domain_entries[0].type #=> String
resp.domain.domain_entries[0].options #=> Hash
resp.domain.domain_entries[0].options["DomainEntryOptionsKeys"] #=> String

Options Hash (options):

  • :domain_name (required, String)

    The domain name for which your want to return information about.

Returns:

See Also:

#get_domains(options = {}) ⇒ Types::GetDomainsResult

Returns a list of all domains in the user's account.

Examples:

Request syntax with placeholder values


resp = client.get_domains({
  page_token: "string",
})

Response structure


resp.domains #=> Array
resp.domains[0].name #=> String
resp.domains[0].arn #=> String
resp.domains[0].support_code #=> String
resp.domains[0].created_at #=> Time
resp.domains[0].location.availability_zone #=> String
resp.domains[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.domains[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.domains[0].domain_entries #=> Array
resp.domains[0].domain_entries[0].id #=> String
resp.domains[0].domain_entries[0].name #=> String
resp.domains[0].domain_entries[0].target #=> String
resp.domains[0].domain_entries[0].is_alias #=> true/false
resp.domains[0].domain_entries[0].type #=> String
resp.domains[0].domain_entries[0].options #=> Hash
resp.domains[0].domain_entries[0].options["DomainEntryOptionsKeys"] #=> String
resp.next_page_token #=> String

Options Hash (options):

  • :page_token (String)

    A token used for advancing to the next page of results from your get domains request.

Returns:

See Also:

#get_instance(options = {}) ⇒ Types::GetInstanceResult

Returns information about a specific Amazon Lightsail instance, which is a virtual private server.

Examples:

Request syntax with placeholder values


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

Response structure


resp.instance.name #=> String
resp.instance.arn #=> String
resp.instance.support_code #=> String
resp.instance.created_at #=> Time
resp.instance.location.availability_zone #=> String
resp.instance.location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.instance.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.instance.blueprint_id #=> String
resp.instance.blueprint_name #=> String
resp.instance.bundle_id #=> String
resp.instance.is_static_ip #=> true/false
resp.instance.private_ip_address #=> String
resp.instance.public_ip_address #=> String
resp.instance.ipv6_address #=> String
resp.instance.hardware.cpu_count #=> Integer
resp.instance.hardware.disks #=> Array
resp.instance.hardware.disks[0].name #=> String
resp.instance.hardware.disks[0].arn #=> String
resp.instance.hardware.disks[0].support_code #=> String
resp.instance.hardware.disks[0].created_at #=> Time
resp.instance.hardware.disks[0].location.availability_zone #=> String
resp.instance.hardware.disks[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.instance.hardware.disks[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.instance.hardware.disks[0].size_in_gb #=> Integer
resp.instance.hardware.disks[0].is_system_disk #=> true/false
resp.instance.hardware.disks[0].iops #=> Integer
resp.instance.hardware.disks[0].path #=> String
resp.instance.hardware.disks[0].state #=> String, one of "pending", "error", "available", "in-use", "unknown"
resp.instance.hardware.disks[0].attached_to #=> String
resp.instance.hardware.disks[0].is_attached #=> true/false
resp.instance.hardware.disks[0].attachment_state #=> String
resp.instance.hardware.disks[0].gb_in_use #=> Integer
resp.instance.hardware.ram_size_in_gb #=> Float
resp.instance.networking.monthly_transfer.gb_per_month_allocated #=> Integer
resp.instance.networking.ports #=> Array
resp.instance.networking.ports[0].from_port #=> Integer
resp.instance.networking.ports[0].to_port #=> Integer
resp.instance.networking.ports[0].protocol #=> String, one of "tcp", "all", "udp"
resp.instance.networking.ports[0].access_from #=> String
resp.instance.networking.ports[0].access_type #=> String, one of "Public", "Private"
resp.instance.networking.ports[0].common_name #=> String
resp.instance.networking.ports[0].access_direction #=> String, one of "inbound", "outbound"
resp.instance.state.code #=> Integer
resp.instance.state.name #=> String
resp.instance.username #=> String
resp.instance.ssh_key_name #=> String

Options Hash (options):

  • :instance_name (required, String)

    The name of the instance.

Returns:

See Also:

#get_instance_access_details(options = {}) ⇒ Types::GetInstanceAccessDetailsResult

Returns temporary SSH keys you can use to connect to a specific virtual private server, or instance.

Examples:

Request syntax with placeholder values


resp = client.get_instance_access_details({
  instance_name: "ResourceName", # required
  protocol: "ssh", # accepts ssh, rdp
})

Response structure


resp.access_details.cert_key #=> String
resp.access_details.expires_at #=> Time
resp.access_details.ip_address #=> String
resp.access_details.password #=> String
resp.access_details.password_data.ciphertext #=> String
resp.access_details.password_data.key_pair_name #=> String
resp.access_details.private_key #=> String
resp.access_details.protocol #=> String, one of "ssh", "rdp"
resp.access_details.instance_name #=> String
resp.access_details.username #=> String

Options Hash (options):

  • :instance_name (required, String)

    The name of the instance to access.

  • :protocol (String)

    The protocol to use to connect to your instance. Defaults to ssh.

Returns:

See Also:

#get_instance_metric_data(options = {}) ⇒ Types::GetInstanceMetricDataResult

Returns the data points for the specified Amazon Lightsail instance metric, given an instance name.

Examples:

Request syntax with placeholder values


resp = client.get_instance_metric_data({
  instance_name: "ResourceName", # required
  metric_name: "CPUUtilization", # required, accepts CPUUtilization, NetworkIn, NetworkOut, StatusCheckFailed, StatusCheckFailed_Instance, StatusCheckFailed_System
  period: 1, # required
  start_time: Time.now, # required
  end_time: Time.now, # required
  unit: "Seconds", # required, accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
  statistics: ["Minimum"], # required, accepts Minimum, Maximum, Sum, Average, SampleCount
})

Response structure


resp.metric_name #=> String, one of "CPUUtilization", "NetworkIn", "NetworkOut", "StatusCheckFailed", "StatusCheckFailed_Instance", "StatusCheckFailed_System"
resp.metric_data #=> Array
resp.metric_data[0].average #=> Float
resp.metric_data[0].maximum #=> Float
resp.metric_data[0].minimum #=> Float
resp.metric_data[0].sample_count #=> Float
resp.metric_data[0].sum #=> Float
resp.metric_data[0].timestamp #=> Time
resp.metric_data[0].unit #=> String, one of "Seconds", "Microseconds", "Milliseconds", "Bytes", "Kilobytes", "Megabytes", "Gigabytes", "Terabytes", "Bits", "Kilobits", "Megabits", "Gigabits", "Terabits", "Percent", "Count", "Bytes/Second", "Kilobytes/Second", "Megabytes/Second", "Gigabytes/Second", "Terabytes/Second", "Bits/Second", "Kilobits/Second", "Megabits/Second", "Gigabits/Second", "Terabits/Second", "Count/Second", "None"

Options Hash (options):

  • :instance_name (required, String)

    The name of the instance for which you want to get metrics data.

  • :metric_name (required, String)

    The metric name to get data about.

  • :period (required, Integer)

    The time period for which you are requesting data.

  • :start_time (required, Time)

    The start time of the time period.

  • :end_time (required, Time)

    The end time of the time period.

  • :unit (required, String)

    The unit. The list of valid values is below.

  • :statistics (required, Array<String>)

    The instance statistics.

Returns:

See Also:

#get_instance_port_states(options = {}) ⇒ Types::GetInstancePortStatesResult

Returns the port states for a specific virtual private server, or instance.

Examples:

Request syntax with placeholder values


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

Response structure


resp.port_states #=> Array
resp.port_states[0].from_port #=> Integer
resp.port_states[0].to_port #=> Integer
resp.port_states[0].protocol #=> String, one of "tcp", "all", "udp"
resp.port_states[0].state #=> String, one of "open", "closed"

Options Hash (options):

  • :instance_name (required, String)

    The name of the instance.

Returns:

See Also:

#get_instance_snapshot(options = {}) ⇒ Types::GetInstanceSnapshotResult

Returns information about a specific instance snapshot.

Examples:

Request syntax with placeholder values


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

Response structure


resp.instance_snapshot.name #=> String
resp.instance_snapshot.arn #=> String
resp.instance_snapshot.support_code #=> String
resp.instance_snapshot.created_at #=> Time
resp.instance_snapshot.location.availability_zone #=> String
resp.instance_snapshot.location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.instance_snapshot.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.instance_snapshot.state #=> String, one of "pending", "error", "available"
resp.instance_snapshot.progress #=> String
resp.instance_snapshot.from_attached_disks #=> Array
resp.instance_snapshot.from_attached_disks[0].name #=> String
resp.instance_snapshot.from_attached_disks[0].arn #=> String
resp.instance_snapshot.from_attached_disks[0].support_code #=> String
resp.instance_snapshot.from_attached_disks[0].created_at #=> Time
resp.instance_snapshot.from_attached_disks[0].location.availability_zone #=> String
resp.instance_snapshot.from_attached_disks[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.instance_snapshot.from_attached_disks[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.instance_snapshot.from_attached_disks[0].size_in_gb #=> Integer
resp.instance_snapshot.from_attached_disks[0].is_system_disk #=> true/false
resp.instance_snapshot.from_attached_disks[0].iops #=> Integer
resp.instance_snapshot.from_attached_disks[0].path #=> String
resp.instance_snapshot.from_attached_disks[0].state #=> String, one of "pending", "error", "available", "in-use", "unknown"
resp.instance_snapshot.from_attached_disks[0].attached_to #=> String
resp.instance_snapshot.from_attached_disks[0].is_attached #=> true/false
resp.instance_snapshot.from_attached_disks[0].attachment_state #=> String
resp.instance_snapshot.from_attached_disks[0].gb_in_use #=> Integer
resp.instance_snapshot.from_instance_name #=> String
resp.instance_snapshot.from_instance_arn #=> String
resp.instance_snapshot.from_blueprint_id #=> String
resp.instance_snapshot.from_bundle_id #=> String
resp.instance_snapshot.size_in_gb #=> Integer

Options Hash (options):

  • :instance_snapshot_name (required, String)

    The name of the snapshot for which you are requesting information.

Returns:

See Also:

#get_instance_snapshots(options = {}) ⇒ Types::GetInstanceSnapshotsResult

Returns all instance snapshots for the user's account.

Examples:

Request syntax with placeholder values


resp = client.get_instance_snapshots({
  page_token: "string",
})

Response structure


resp.instance_snapshots #=> Array
resp.instance_snapshots[0].name #=> String
resp.instance_snapshots[0].arn #=> String
resp.instance_snapshots[0].support_code #=> String
resp.instance_snapshots[0].created_at #=> Time
resp.instance_snapshots[0].location.availability_zone #=> String
resp.instance_snapshots[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.instance_snapshots[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.instance_snapshots[0].state #=> String, one of "pending", "error", "available"
resp.instance_snapshots[0].progress #=> String
resp.instance_snapshots[0].from_attached_disks #=> Array
resp.instance_snapshots[0].from_attached_disks[0].name #=> String
resp.instance_snapshots[0].from_attached_disks[0].arn #=> String
resp.instance_snapshots[0].from_attached_disks[0].support_code #=> String
resp.instance_snapshots[0].from_attached_disks[0].created_at #=> Time
resp.instance_snapshots[0].from_attached_disks[0].location.availability_zone #=> String
resp.instance_snapshots[0].from_attached_disks[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.instance_snapshots[0].from_attached_disks[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.instance_snapshots[0].from_attached_disks[0].size_in_gb #=> Integer
resp.instance_snapshots[0].from_attached_disks[0].is_system_disk #=> true/false
resp.instance_snapshots[0].from_attached_disks[0].iops #=> Integer
resp.instance_snapshots[0].from_attached_disks[0].path #=> String
resp.instance_snapshots[0].from_attached_disks[0].state #=> String, one of "pending", "error", "available", "in-use", "unknown"
resp.instance_snapshots[0].from_attached_disks[0].attached_to #=> String
resp.instance_snapshots[0].from_attached_disks[0].is_attached #=> true/false
resp.instance_snapshots[0].from_attached_disks[0].attachment_state #=> String
resp.instance_snapshots[0].from_attached_disks[0].gb_in_use #=> Integer
resp.instance_snapshots[0].from_instance_name #=> String
resp.instance_snapshots[0].from_instance_arn #=> String
resp.instance_snapshots[0].from_blueprint_id #=> String
resp.instance_snapshots[0].from_bundle_id #=> String
resp.instance_snapshots[0].size_in_gb #=> Integer
resp.next_page_token #=> String

Options Hash (options):

  • :page_token (String)

    A token used for advancing to the next page of results from your get instance snapshots request.

Returns:

See Also:

#get_instance_state(options = {}) ⇒ Types::GetInstanceStateResult

Returns the state of a specific instance. Works on one instance at a time.

Examples:

Request syntax with placeholder values


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

Response structure


resp.state.code #=> Integer
resp.state.name #=> String

Options Hash (options):

  • :instance_name (required, String)

    The name of the instance to get state information about.

Returns:

See Also:

#get_instances(options = {}) ⇒ Types::GetInstancesResult

Returns information about all Amazon Lightsail virtual private servers, or instances.

Examples:

Request syntax with placeholder values


resp = client.get_instances({
  page_token: "string",
})

Response structure


resp.instances #=> Array
resp.instances[0].name #=> String
resp.instances[0].arn #=> String
resp.instances[0].support_code #=> String
resp.instances[0].created_at #=> Time
resp.instances[0].location.availability_zone #=> String
resp.instances[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.instances[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.instances[0].blueprint_id #=> String
resp.instances[0].blueprint_name #=> String
resp.instances[0].bundle_id #=> String
resp.instances[0].is_static_ip #=> true/false
resp.instances[0].private_ip_address #=> String
resp.instances[0].public_ip_address #=> String
resp.instances[0].ipv6_address #=> String
resp.instances[0].hardware.cpu_count #=> Integer
resp.instances[0].hardware.disks #=> Array
resp.instances[0].hardware.disks[0].name #=> String
resp.instances[0].hardware.disks[0].arn #=> String
resp.instances[0].hardware.disks[0].support_code #=> String
resp.instances[0].hardware.disks[0].created_at #=> Time
resp.instances[0].hardware.disks[0].location.availability_zone #=> String
resp.instances[0].hardware.disks[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.instances[0].hardware.disks[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.instances[0].hardware.disks[0].size_in_gb #=> Integer
resp.instances[0].hardware.disks[0].is_system_disk #=> true/false
resp.instances[0].hardware.disks[0].iops #=> Integer
resp.instances[0].hardware.disks[0].path #=> String
resp.instances[0].hardware.disks[0].state #=> String, one of "pending", "error", "available", "in-use", "unknown"
resp.instances[0].hardware.disks[0].attached_to #=> String
resp.instances[0].hardware.disks[0].is_attached #=> true/false
resp.instances[0].hardware.disks[0].attachment_state #=> String
resp.instances[0].hardware.disks[0].gb_in_use #=> Integer
resp.instances[0].hardware.ram_size_in_gb #=> Float
resp.instances[0].networking.monthly_transfer.gb_per_month_allocated #=> Integer
resp.instances[0].networking.ports #=> Array
resp.instances[0].networking.ports[0].from_port #=> Integer
resp.instances[0].networking.ports[0].to_port #=> Integer
resp.instances[0].networking.ports[0].protocol #=> String, one of "tcp", "all", "udp"
resp.instances[0].networking.ports[0].access_from #=> String
resp.instances[0].networking.ports[0].access_type #=> String, one of "Public", "Private"
resp.instances[0].networking.ports[0].common_name #=> String
resp.instances[0].networking.ports[0].access_direction #=> String, one of "inbound", "outbound"
resp.instances[0].state.code #=> Integer
resp.instances[0].state.name #=> String
resp.instances[0].username #=> String
resp.instances[0].ssh_key_name #=> String
resp.next_page_token #=> String

Options Hash (options):

  • :page_token (String)

    A token used for advancing to the next page of results from your get instances request.

Returns:

See Also:

#get_key_pair(options = {}) ⇒ Types::GetKeyPairResult

Returns information about a specific key pair.

Examples:

Request syntax with placeholder values


resp = client.get_key_pair({
  key_pair_name: "ResourceName", # required
})

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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.key_pair.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.key_pair.fingerprint #=> String

Options Hash (options):

  • :key_pair_name (required, String)

    The name of the key pair for which you are requesting information.

Returns:

See Also:

#get_key_pairs(options = {}) ⇒ Types::GetKeyPairsResult

Returns information about all key pairs in the user's account.

Examples:

Request syntax with placeholder values


resp = client.get_key_pairs({
  page_token: "string",
})

Response structure


resp.key_pairs #=> Array
resp.key_pairs[0].name #=> String
resp.key_pairs[0].arn #=> String
resp.key_pairs[0].support_code #=> String
resp.key_pairs[0].created_at #=> Time
resp.key_pairs[0].location.availability_zone #=> String
resp.key_pairs[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.key_pairs[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.key_pairs[0].fingerprint #=> String
resp.next_page_token #=> String

Options Hash (options):

  • :page_token (String)

    A token used for advancing to the next page of results from your get key pairs request.

Returns:

See Also:

#get_load_balancer(options = {}) ⇒ Types::GetLoadBalancerResult

Returns information about the specified Lightsail load balancer.

Examples:

Request syntax with placeholder values


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

Response structure


resp.load_balancer.name #=> String
resp.load_balancer.arn #=> String
resp.load_balancer.support_code #=> String
resp.load_balancer.created_at #=> Time
resp.load_balancer.location.availability_zone #=> String
resp.load_balancer.location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.load_balancer.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.load_balancer.dns_name #=> String
resp.load_balancer.state #=> String, one of "active", "provisioning", "active_impaired", "failed", "unknown"
resp.load_balancer.protocol #=> String, one of "HTTP_HTTPS", "HTTP"
resp.load_balancer.public_ports #=> Array
resp.load_balancer.public_ports[0] #=> Integer
resp.load_balancer.health_check_path #=> String
resp.load_balancer.instance_port #=> Integer
resp.load_balancer.instance_health_summary #=> Array
resp.load_balancer.instance_health_summary[0].instance_name #=> String
resp.load_balancer.instance_health_summary[0].instance_health #=> String, one of "initial", "healthy", "unhealthy", "unused", "draining", "unavailable"
resp.load_balancer.instance_health_summary[0].instance_health_reason #=> String, one of "Lb.RegistrationInProgress", "Lb.InitialHealthChecking", "Lb.InternalError", "Instance.ResponseCodeMismatch", "Instance.Timeout", "Instance.FailedHealthChecks", "Instance.NotRegistered", "Instance.NotInUse", "Instance.DeregistrationInProgress", "Instance.InvalidState", "Instance.IpUnusable"
resp.load_balancer.tls_certificate_summaries #=> Array
resp.load_balancer.tls_certificate_summaries[0].name #=> String
resp.load_balancer.tls_certificate_summaries[0].is_attached #=> true/false
resp.load_balancer.configuration_options #=> Hash
resp.load_balancer.configuration_options["LoadBalancerAttributeName"] #=> String

Options Hash (options):

  • :load_balancer_name (required, String)

    The name of the load balancer.

Returns:

See Also:

#get_load_balancer_metric_data(options = {}) ⇒ Types::GetLoadBalancerMetricDataResult

Returns information about health metrics for your Lightsail load balancer.

Examples:

Request syntax with placeholder values


resp = client.get_load_balancer_metric_data({
  load_balancer_name: "ResourceName", # required
  metric_name: "ClientTLSNegotiationErrorCount", # required, accepts ClientTLSNegotiationErrorCount, HealthyHostCount, UnhealthyHostCount, HTTPCode_LB_4XX_Count, HTTPCode_LB_5XX_Count, HTTPCode_Instance_2XX_Count, HTTPCode_Instance_3XX_Count, HTTPCode_Instance_4XX_Count, HTTPCode_Instance_5XX_Count, InstanceResponseTime, RejectedConnectionCount, RequestCount
  period: 1, # required
  start_time: Time.now, # required
  end_time: Time.now, # required
  unit: "Seconds", # required, accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
  statistics: ["Minimum"], # required, accepts Minimum, Maximum, Sum, Average, SampleCount
})

Response structure


resp.metric_name #=> String, one of "ClientTLSNegotiationErrorCount", "HealthyHostCount", "UnhealthyHostCount", "HTTPCode_LB_4XX_Count", "HTTPCode_LB_5XX_Count", "HTTPCode_Instance_2XX_Count", "HTTPCode_Instance_3XX_Count", "HTTPCode_Instance_4XX_Count", "HTTPCode_Instance_5XX_Count", "InstanceResponseTime", "RejectedConnectionCount", "RequestCount"
resp.metric_data #=> Array
resp.metric_data[0].average #=> Float
resp.metric_data[0].maximum #=> Float
resp.metric_data[0].minimum #=> Float
resp.metric_data[0].sample_count #=> Float
resp.metric_data[0].sum #=> Float
resp.metric_data[0].timestamp #=> Time
resp.metric_data[0].unit #=> String, one of "Seconds", "Microseconds", "Milliseconds", "Bytes", "Kilobytes", "Megabytes", "Gigabytes", "Terabytes", "Bits", "Kilobits", "Megabits", "Gigabits", "Terabits", "Percent", "Count", "Bytes/Second", "Kilobytes/Second", "Megabytes/Second", "Gigabytes/Second", "Terabytes/Second", "Bits/Second", "Kilobits/Second", "Megabits/Second", "Gigabits/Second", "Terabits/Second", "Count/Second", "None"

Options Hash (options):

  • :load_balancer_name (required, String)

    The name of the load balancer.

  • :metric_name (required, String)

    The metric about which you want to return information. Valid values are listed below, along with the most useful statistics to include in your request.

    • ClientTLSNegotiationErrorCount - The number of TLS connections initiated by the client that did not establish a session with the load balancer. Possible causes include a mismatch of ciphers or protocols.

      Statistics: The most useful statistic is Sum.

    • HealthyHostCount - The number of target instances that are considered healthy.

      Statistics: The most useful statistic are Average, Minimum, and Maximum.

    • UnhealthyHostCount - The number of target instances that are considered unhealthy.

      Statistics: The most useful statistic are Average, Minimum, and Maximum.

    • HTTPCode_LB_4XX_Count - The number of HTTP 4XX client error codes that originate from the load balancer. Client errors are generated when requests are malformed or incomplete. These requests have not been received by the target instance. This count does not include any response codes generated by the target instances.

      Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    • HTTPCode_LB_5XX_Count - The number of HTTP 5XX server error codes that originate from the load balancer. This count does not include any response codes generated by the target instances.

      Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1. Note that Minimum, Maximum, and Average all return 1.

    • HTTPCode_Instance_2XX_Count - The number of HTTP response codes generated by the target instances. This does not include any response codes generated by the load balancer.

      Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    • HTTPCode_Instance_3XX_Count - The number of HTTP response codes generated by the target instances. This does not include any response codes generated by the load balancer.

      Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    • HTTPCode_Instance_4XX_Count - The number of HTTP response codes generated by the target instances. This does not include any response codes generated by the load balancer.

      Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    • HTTPCode_Instance_5XX_Count - The number of HTTP response codes generated by the target instances. This does not include any response codes generated by the load balancer.

      Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

    • InstanceResponseTime - The time elapsed, in seconds, after the request leaves the load balancer until a response from the target instance is received.

      Statistics: The most useful statistic is Average.

    • RejectedConnectionCount - The number of connections that were rejected because the load balancer had reached its maximum number of connections.

      Statistics: The most useful statistic is Sum.

    • RequestCount - The number of requests processed over IPv4. This count includes only the requests with a response generated by a target instance of the load balancer.

      Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, and Average all return 1.

  • :period (required, Integer)

    The time period duration for your health data request.

  • :start_time (required, Time)

    The start time of the period.

  • :end_time (required, Time)

    The end time of the period.

  • :unit (required, String)

    The unit for the time period request. Valid values are listed below.

  • :statistics (required, Array<String>)

    An array of statistics that you want to request metrics for. Valid values are listed below.

Returns:

See Also:

#get_load_balancer_tls_certificates(options = {}) ⇒ Types::GetLoadBalancerTlsCertificatesResult

Returns information about the TLS certificates that are associated with the specified Lightsail load balancer.

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

Examples:

Request syntax with placeholder values


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

Response structure


resp.tls_certificates #=> Array
resp.tls_certificates[0].name #=> String
resp.tls_certificates[0].arn #=> String
resp.tls_certificates[0].support_code #=> String
resp.tls_certificates[0].created_at #=> Time
resp.tls_certificates[0].location.availability_zone #=> String
resp.tls_certificates[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.tls_certificates[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.tls_certificates[0].load_balancer_name #=> String
resp.tls_certificates[0].is_attached #=> true/false
resp.tls_certificates[0].status #=> String, one of "PENDING_VALIDATION", "ISSUED", "INACTIVE", "EXPIRED", "VALIDATION_TIMED_OUT", "REVOKED", "FAILED", "UNKNOWN"
resp.tls_certificates[0].domain_name #=> String
resp.tls_certificates[0].domain_validation_records #=> Array
resp.tls_certificates[0].domain_validation_records[0].name #=> String
resp.tls_certificates[0].domain_validation_records[0].type #=> String
resp.tls_certificates[0].domain_validation_records[0].value #=> String
resp.tls_certificates[0].domain_validation_records[0].validation_status #=> String, one of "PENDING_VALIDATION", "FAILED", "SUCCESS"
resp.tls_certificates[0].domain_validation_records[0].domain_name #=> String
resp.tls_certificates[0].failure_reason #=> String, one of "NO_AVAILABLE_CONTACTS", "ADDITIONAL_VERIFICATION_REQUIRED", "DOMAIN_NOT_ALLOWED", "INVALID_PUBLIC_DOMAIN", "OTHER"
resp.tls_certificates[0].issued_at #=> Time
resp.tls_certificates[0].issuer #=> String
resp.tls_certificates[0].key_algorithm #=> String
resp.tls_certificates[0].not_after #=> Time
resp.tls_certificates[0].not_before #=> Time
resp.tls_certificates[0].renewal_summary.renewal_status #=> String, one of "PENDING_AUTO_RENEWAL", "PENDING_VALIDATION", "SUCCESS", "FAILED"
resp.tls_certificates[0].renewal_summary.domain_validation_options #=> Array
resp.tls_certificates[0].renewal_summary.domain_validation_options[0].domain_name #=> String
resp.tls_certificates[0].renewal_summary.domain_validation_options[0].validation_status #=> String, one of "PENDING_VALIDATION", "FAILED", "SUCCESS"
resp.tls_certificates[0].revocation_reason #=> String, one of "UNSPECIFIED", "KEY_COMPROMISE", "CA_COMPROMISE", "AFFILIATION_CHANGED", "SUPERCEDED", "CESSATION_OF_OPERATION", "CERTIFICATE_HOLD", "REMOVE_FROM_CRL", "PRIVILEGE_WITHDRAWN", "A_A_COMPROMISE"
resp.tls_certificates[0].revoked_at #=> Time
resp.tls_certificates[0].serial #=> String
resp.tls_certificates[0].signature_algorithm #=> String
resp.tls_certificates[0].subject #=> String
resp.tls_certificates[0].subject_alternative_names #=> Array
resp.tls_certificates[0].subject_alternative_names[0] #=> String

Options Hash (options):

  • :load_balancer_name (required, String)

    The name of the load balancer where you stored your TLS/SSL certificate.

Returns:

See Also:

#get_load_balancers(options = {}) ⇒ Types::GetLoadBalancersResult

Returns information about all load balancers in an account.

If you are describing a long list of load balancers, you can paginate the output to make the list more manageable. You can use the pageToken and nextPageToken values to retrieve the next items in the list.

Examples:

Request syntax with placeholder values


resp = client.get_load_balancers({
  page_token: "string",
})

Response structure


resp.load_balancers #=> Array
resp.load_balancers[0].name #=> String
resp.load_balancers[0].arn #=> String
resp.load_balancers[0].support_code #=> String
resp.load_balancers[0].created_at #=> Time
resp.load_balancers[0].location.availability_zone #=> String
resp.load_balancers[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.load_balancers[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.load_balancers[0].dns_name #=> String
resp.load_balancers[0].state #=> String, one of "active", "provisioning", "active_impaired", "failed", "unknown"
resp.load_balancers[0].protocol #=> String, one of "HTTP_HTTPS", "HTTP"
resp.load_balancers[0].public_ports #=> Array
resp.load_balancers[0].public_ports[0] #=> Integer
resp.load_balancers[0].health_check_path #=> String
resp.load_balancers[0].instance_port #=> Integer
resp.load_balancers[0].instance_health_summary #=> Array
resp.load_balancers[0].instance_health_summary[0].instance_name #=> String
resp.load_balancers[0].instance_health_summary[0].instance_health #=> String, one of "initial", "healthy", "unhealthy", "unused", "draining", "unavailable"
resp.load_balancers[0].instance_health_summary[0].instance_health_reason #=> String, one of "Lb.RegistrationInProgress", "Lb.InitialHealthChecking", "Lb.InternalError", "Instance.ResponseCodeMismatch", "Instance.Timeout", "Instance.FailedHealthChecks", "Instance.NotRegistered", "Instance.NotInUse", "Instance.DeregistrationInProgress", "Instance.InvalidState", "Instance.IpUnusable"
resp.load_balancers[0].tls_certificate_summaries #=> Array
resp.load_balancers[0].tls_certificate_summaries[0].name #=> String
resp.load_balancers[0].tls_certificate_summaries[0].is_attached #=> true/false
resp.load_balancers[0].configuration_options #=> Hash
resp.load_balancers[0].configuration_options["LoadBalancerAttributeName"] #=> String
resp.next_page_token #=> String

Options Hash (options):

  • :page_token (String)

    A token used for paginating the results from your GetLoadBalancers request.

Returns:

See Also:

#get_operation(options = {}) ⇒ Types::GetOperationResult

Returns information about a specific operation. Operations include events such as when you create an instance, allocate a static IP, attach a static IP, and so on.

Examples:

Request syntax with placeholder values


resp = client.get_operation({
  operation_id: "NonEmptyString", # required
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Options Hash (options):

  • :operation_id (required, String)

    A GUID used to identify the operation.

Returns:

See Also:

#get_operations(options = {}) ⇒ Types::GetOperationsResult

Returns information about all operations.

Results are returned from oldest to newest, up to a maximum of 200. Results can be paged by making each subsequent call to GetOperations use the maximum (last) statusChangedAt value from the previous request.

Examples:

Request syntax with placeholder values


resp = client.get_operations({
  page_token: "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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String
resp.next_page_token #=> String

Options Hash (options):

  • :page_token (String)

    A token used for advancing to the next page of results from your get operations request.

Returns:

See Also:

#get_operations_for_resource(options = {}) ⇒ Types::GetOperationsForResourceResult

Gets operations for a specific resource (e.g., an instance or a static IP).

Examples:

Request syntax with placeholder values


resp = client.get_operations_for_resource({
  resource_name: "ResourceName", # required
  page_token: "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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String
resp.next_page_count #=> String
resp.next_page_token #=> String

Options Hash (options):

  • :resource_name (required, String)

    The name of the resource for which you are requesting information.

  • :page_token (String)

    A token used for advancing to the next page of results from your get operations for resource request.

Returns:

See Also:

#get_regions(options = {}) ⇒ Types::GetRegionsResult

Returns a list of all valid regions for Amazon Lightsail. Use the include availability zones parameter to also return the availability zones in a region.

Examples:

Request syntax with placeholder values


resp = client.get_regions({
  include_availability_zones: false,
})

Response structure


resp.regions #=> Array
resp.regions[0].continent_code #=> String
resp.regions[0].description #=> String
resp.regions[0].display_name #=> String
resp.regions[0].name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.regions[0].availability_zones #=> Array
resp.regions[0].availability_zones[0].zone_name #=> String
resp.regions[0].availability_zones[0].state #=> String

Options Hash (options):

  • :include_availability_zones (Boolean)

    A Boolean value indicating whether to also include Availability Zones in your get regions request. Availability Zones are indicated with a letter: e.g., us-east-2a.

Returns:

See Also:

#get_static_ip(options = {}) ⇒ Types::GetStaticIpResult

Returns information about a specific static IP.

Examples:

Request syntax with placeholder values


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

Response structure


resp.static_ip.name #=> String
resp.static_ip.arn #=> String
resp.static_ip.support_code #=> String
resp.static_ip.created_at #=> Time
resp.static_ip.location.availability_zone #=> String
resp.static_ip.location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.static_ip.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.static_ip.ip_address #=> String
resp.static_ip.attached_to #=> String
resp.static_ip.is_attached #=> true/false

Options Hash (options):

  • :static_ip_name (required, String)

    The name of the static IP in Lightsail.

Returns:

See Also:

#get_static_ips(options = {}) ⇒ Types::GetStaticIpsResult

Returns information about all static IPs in the user's account.

Examples:

Request syntax with placeholder values


resp = client.get_static_ips({
  page_token: "string",
})

Response structure


resp.static_ips #=> Array
resp.static_ips[0].name #=> String
resp.static_ips[0].arn #=> String
resp.static_ips[0].support_code #=> String
resp.static_ips[0].created_at #=> Time
resp.static_ips[0].location.availability_zone #=> String
resp.static_ips[0].location.region_name #=> String, one of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.static_ips[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
resp.static_ips[0].ip_address #=> String
resp.static_ips[0].attached_to #=> String
resp.static_ips[0].is_attached #=> true/false
resp.next_page_token #=> String

Options Hash (options):

  • :page_token (String)

    A token used for advancing to the next page of results from your get static IPs request.

Returns:

See Also:

#import_key_pair(options = {}) ⇒ Types::ImportKeyPairResult

Imports a public SSH key from a specific key pair.

Examples:

Request syntax with placeholder values


resp = client.import_key_pair({
  key_pair_name: "ResourceName", # required
  public_key_base_64: "Base64", # required
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Options Hash (options):

  • :key_pair_name (required, String)

    The name of the key pair for which you want to import the public key.

  • :public_key_base_64 (required, String)

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

Returns:

See Also:

#is_vpc_peered(options = {}) ⇒ Types::IsVpcPeeredResult

Returns a Boolean value indicating whether your Lightsail VPC is peered.

Examples:

Request syntax with placeholder values


resp = client.is_vpc_peered()

Response structure


resp.is_peered #=> true/false

Returns:

See Also:

#open_instance_public_ports(options = {}) ⇒ Types::OpenInstancePublicPortsResult

Adds public ports to an Amazon Lightsail instance.

Examples:

Request syntax with placeholder values


resp = client.open_instance_public_ports({
  port_info: { # required
    from_port: 1,
    to_port: 1,
    protocol: "tcp", # accepts tcp, all, udp
  },
  instance_name: "ResourceName", # required
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Options Hash (options):

  • :port_info (required, Types::PortInfo)

    An array of key-value pairs containing information about the port mappings.

  • :instance_name (required, String)

    The name of the instance for which you want to open the public ports.

Returns:

See Also:

#peer_vpc(options = {}) ⇒ Types::PeerVpcResult

Tries to peer the Lightsail VPC with the user's default VPC.

Examples:

Request syntax with placeholder values


resp = client.peer_vpc()

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Returns:

See Also:

#put_instance_public_ports(options = {}) ⇒ Types::PutInstancePublicPortsResult

Sets the specified open ports for an Amazon Lightsail instance, and closes all ports for every protocol not included in the current request.

Examples:

Request syntax with placeholder values


resp = client.put_instance_public_ports({
  port_infos: [ # required
    {
      from_port: 1,
      to_port: 1,
      protocol: "tcp", # accepts tcp, all, udp
    },
  ],
  instance_name: "ResourceName", # required
})

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Options Hash (options):

  • :port_infos (required, Array<Types::PortInfo>)

    Specifies information about the public port(s).

  • :instance_name (required, String)

    The Lightsail instance name of the public port(s) you are setting.

Returns:

See Also:

#reboot_instance(options = {}) ⇒ Types::RebootInstanceResult

Restarts a specific instance. When your Amazon Lightsail instance is finished rebooting, Lightsail assigns a new public IP address. To use the same IP address after restarting, create a static IP address and attach it to the instance.

Examples:

Request syntax with placeholder values


resp = client.reboot_instance({
  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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :instance_name (required, String)

    The name of the instance to reboot.

Returns:

See Also:

#release_static_ip(options = {}) ⇒ Types::ReleaseStaticIpResult

Deletes a specific static IP from your account.

Examples:

Request syntax with placeholder values


resp = client.release_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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :static_ip_name (required, String)

    The name of the static IP to delete.

Returns:

See Also:

#start_instance(options = {}) ⇒ Types::StartInstanceResult

Starts a specific Amazon Lightsail instance from a stopped state. To restart an instance, use the reboot instance operation.

Examples:

Request syntax with placeholder values


resp = client.start_instance({
  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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :instance_name (required, String)

    The name of the instance (a virtual private server) to start.

Returns:

See Also:

#stop_instance(options = {}) ⇒ Types::StopInstanceResult

Stops a specific Amazon Lightsail instance that is currently running.

Examples:

Request syntax with placeholder values


resp = client.stop_instance({
  instance_name: "ResourceName", # required
  force: 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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :instance_name (required, String)

    The name of the instance (a virtual private server) to stop.

  • :force (Boolean)

    When set to True, forces a Lightsail instance that is stuck in a stopping state to stop.

    Only use the force parameter if your instance is stuck in the stopping state. In any other state, your instance should stop normally without adding this parameter to your API request.

Returns:

See Also:

#unpeer_vpc(options = {}) ⇒ Types::UnpeerVpcResult

Attempts to unpeer the Lightsail VPC from the user's default VPC.

Examples:

Request syntax with placeholder values


resp = client.unpeer_vpc()

Response structure


resp.operation.id #=> String
resp.operation.resource_name #=> String
resp.operation.resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operation.is_terminal #=> true/false
resp.operation.operation_details #=> String
resp.operation.operation_type #=> String, one of "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"
resp.operation.status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operation.status_changed_at #=> Time
resp.operation.error_code #=> String
resp.operation.error_details #=> String

Returns:

See Also:

#update_domain_entry(options = {}) ⇒ Types::UpdateDomainEntryResult

Updates a domain recordset after it is created.

Examples:

Request syntax with placeholder values


resp = client.update_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.operations #=> Array
resp.operations[0].id #=> String
resp.operations[0].resource_name #=> String
resp.operations[0].resource_type #=> String, one of "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :domain_name (required, String)

    The name of the domain recordset to update.

  • :domain_entry (required, Types::DomainEntry)

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

Returns:

See Also:

#update_load_balancer_attribute(options = {}) ⇒ Types::UpdateLoadBalancerAttributeResult

Updates the specified attribute for a load balancer.

Examples:

Request syntax with placeholder values


resp = client.update_load_balancer_attribute({
  load_balancer_name: "ResourceName", # required
  attribute_name: "HealthCheckPath", # required, accepts HealthCheckPath, SessionStickinessEnabled, SessionStickiness_LB_CookieDurationSeconds
  attribute_value: "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 "Instance", "StaticIp", "KeyPair", "InstanceSnapshot", "Domain", "PeeredVpc", "LoadBalancer", "LoadBalancerTlsCertificate", "Disk", "DiskSnapshot"
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-central-1", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"
resp.operations[0].is_terminal #=> true/false
resp.operations[0].operation_details #=> String
resp.operations[0].operation_type #=> String, one of "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"
resp.operations[0].status #=> String, one of "NotStarted", "Started", "Failed", "Completed"
resp.operations[0].status_changed_at #=> Time
resp.operations[0].error_code #=> String
resp.operations[0].error_details #=> String

Options Hash (options):

  • :load_balancer_name (required, String)

    The name of the load balancer that you want to modify.

  • :attribute_name (required, String)

    The name of the attribute you want to update. Valid values are below.

  • :attribute_value (required, String)

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

Returns:

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

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

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.