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

Class: Aws::EC2::Client

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

Overview

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

ec2 = Aws::EC2::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::EC2::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::EC2::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.

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

#accept_reserved_instances_exchange_quote(options = {}) ⇒ Types::AcceptReservedInstancesExchangeQuoteResult

Accepts the Convertible Reserved Instance exchange quote described in the GetReservedInstancesExchangeQuote call.

Examples:

Request syntax with placeholder values


resp = client.accept_reserved_instances_exchange_quote({
  dry_run: false,
  reserved_instance_ids: ["String"], # required
  target_configurations: [
    {
      instance_count: 1,
      offering_id: "String", # required
    },
  ],
})

Response structure


resp.exchange_id #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :reserved_instance_ids (required, Array<String>)

    The IDs of the Convertible Reserved Instances to exchange for another Convertible Reserved Instance of the same or higher value.

  • :target_configurations (Array<Types::TargetConfigurationRequest>)

    The configuration of the target Convertible Reserved Instance to exchange for your current Convertible Reserved Instances.

Returns:

See Also:

#accept_vpc_peering_connection(options = {}) ⇒ Types::AcceptVpcPeeringConnectionResult

Accept a VPC peering connection request. To accept a request, the VPC peering connection must be in the pending-acceptance state, and you must be the owner of the peer VPC. Use DescribeVpcPeeringConnections to view your outstanding VPC peering connection requests.

Examples:

Request syntax with placeholder values


resp = client.accept_vpc_peering_connection({
  dry_run: false,
  vpc_peering_connection_id: "String",
})

Response structure


resp.vpc_peering_connection.accepter_vpc_info.cidr_block #=> String
resp.vpc_peering_connection.accepter_vpc_info.ipv_6_cidr_block_set #=> Array
resp.vpc_peering_connection.accepter_vpc_info.ipv_6_cidr_block_set[0].ipv_6_cidr_block #=> String
resp.vpc_peering_connection.accepter_vpc_info.cidr_block_set #=> Array
resp.vpc_peering_connection.accepter_vpc_info.cidr_block_set[0].cidr_block #=> String
resp.vpc_peering_connection.accepter_vpc_info.owner_id #=> String
resp.vpc_peering_connection.accepter_vpc_info.peering_options.allow_dns_resolution_from_remote_vpc #=> true/false
resp.vpc_peering_connection.accepter_vpc_info.peering_options.allow_egress_from_local_classic_link_to_remote_vpc #=> true/false
resp.vpc_peering_connection.accepter_vpc_info.peering_options.allow_egress_from_local_vpc_to_remote_classic_link #=> true/false
resp.vpc_peering_connection.accepter_vpc_info.vpc_id #=> String
resp.vpc_peering_connection.expiration_time #=> Time
resp.vpc_peering_connection.requester_vpc_info.cidr_block #=> String
resp.vpc_peering_connection.requester_vpc_info.ipv_6_cidr_block_set #=> Array
resp.vpc_peering_connection.requester_vpc_info.ipv_6_cidr_block_set[0].ipv_6_cidr_block #=> String
resp.vpc_peering_connection.requester_vpc_info.cidr_block_set #=> Array
resp.vpc_peering_connection.requester_vpc_info.cidr_block_set[0].cidr_block #=> String
resp.vpc_peering_connection.requester_vpc_info.owner_id #=> String
resp.vpc_peering_connection.requester_vpc_info.peering_options.allow_dns_resolution_from_remote_vpc #=> true/false
resp.vpc_peering_connection.requester_vpc_info.peering_options.allow_egress_from_local_classic_link_to_remote_vpc #=> true/false
resp.vpc_peering_connection.requester_vpc_info.peering_options.allow_egress_from_local_vpc_to_remote_classic_link #=> true/false
resp.vpc_peering_connection.requester_vpc_info.vpc_id #=> String
resp.vpc_peering_connection.status.code #=> String, one of "initiating-request", "pending-acceptance", "active", "deleted", "rejected", "failed", "expired", "provisioning", "deleting"
resp.vpc_peering_connection.status.message #=> String
resp.vpc_peering_connection.tags #=> Array
resp.vpc_peering_connection.tags[0].key #=> String
resp.vpc_peering_connection.tags[0].value #=> String
resp.vpc_peering_connection.vpc_peering_connection_id #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :vpc_peering_connection_id (String)

    The ID of the VPC peering connection.

Returns:

See Also:

#allocate_address(options = {}) ⇒ Types::AllocateAddressResult

Allocates an Elastic IP address.

An Elastic IP address is for use either in the EC2-Classic platform or in a VPC. By default, you can allocate 5 Elastic IP addresses for EC2-Classic per region and 5 Elastic IP addresses for EC2-VPC per region.

If you release an Elastic IP address for use in a VPC, you might be able to recover it. To recover an Elastic IP address that you released, specify it in the Address parameter. Note that you cannot recover an Elastic IP address that you released after it is allocated to another AWS account.

For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To allocate an Elastic IP address for EC2-VPC


# This example allocates an Elastic IP address to use with an instance in a VPC.

resp = client.allocate_address({
  domain: "vpc", 
})

# resp.to_h outputs the following:
{
  allocation_id: "eipalloc-64d5890a", 
  domain: "vpc", 
  public_ip: "203.0.113.0", 
}

Example: To allocate an Elastic IP address for EC2-Classic


# This example allocates an Elastic IP address to use with an instance in EC2-Classic.

resp = client.allocate_address({
})

# resp.to_h outputs the following:
{
  domain: "standard", 
  public_ip: "198.51.100.0", 
}

Request syntax with placeholder values


resp = client.allocate_address({
  domain: "vpc", # accepts vpc, standard
  address: "String",
  dry_run: false,
})

Response structure


resp.public_ip #=> String
resp.allocation_id #=> String
resp.domain #=> String, one of "vpc", "standard"

Options Hash (options):

  • :domain (String)

    Set to vpc to allocate the address for use with instances in a VPC.

    Default: The address is for use with instances in EC2-Classic.

  • :address (String)

    [EC2-VPC] The Elastic IP address to recover.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#allocate_hosts(options = {}) ⇒ Types::AllocateHostsResult

Allocates a Dedicated Host to your account. At minimum you need to specify the instance size type, Availability Zone, and quantity of hosts you want to allocate.

Examples:

Request syntax with placeholder values


resp = client.allocate_hosts({
  auto_placement: "on", # accepts on, off
  availability_zone: "String", # required
  client_token: "String",
  instance_type: "String", # required
  quantity: 1, # required
})

Response structure


resp.host_ids #=> Array
resp.host_ids[0] #=> String

Options Hash (options):

  • :auto_placement (String)

    This is enabled by default. This property allows instances to be automatically placed onto available Dedicated Hosts, when you are launching instances without specifying a host ID.

    Default: Enabled

  • :availability_zone (required, String)

    The Availability Zone for the Dedicated Hosts.

  • :client_token (String)

    Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.

  • :instance_type (required, String)

    Specify the instance type that you want your Dedicated Hosts to be configured for. When you specify the instance type, that is the only instance type that you can launch onto that host.

  • :quantity (required, Integer)

    The number of Dedicated Hosts you want to allocate to your account with these parameters.

Returns:

See Also:

#assign_ipv_6_addresses(options = {}) ⇒ Types::AssignIpv6AddressesResult

Assigns one or more IPv6 addresses to the specified network interface. You can specify one or more specific IPv6 addresses, or you can specify the number of IPv6 addresses to be automatically assigned from within the subnet's IPv6 CIDR block range. You can assign as many IPv6 addresses to a network interface as you can assign private IPv4 addresses, and the limit varies per instance type. For information, see IP Addresses Per Network Interface Per Instance Type in the Amazon Elastic Compute Cloud User Guide.

Examples:

Request syntax with placeholder values


resp = client.assign_ipv_6_addresses({
  ipv_6_address_count: 1,
  ipv_6_addresses: ["String"],
  network_interface_id: "String", # required
})

Response structure


resp.assigned_ipv_6_addresses #=> Array
resp.assigned_ipv_6_addresses[0] #=> String
resp.network_interface_id #=> String

Options Hash (options):

  • :ipv_6_address_count (Integer)

    The number of IPv6 addresses to assign to the network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can\'t use this option if specifying specific IPv6 addresses.

  • :ipv_6_addresses (Array<String>)

    One or more specific IPv6 addresses to be assigned to the network interface. You can\'t use this option if you\'re specifying a number of IPv6 addresses.

  • :network_interface_id (required, String)

    The ID of the network interface.

Returns:

See Also:

#assign_private_ip_addresses(options = {}) ⇒ Struct

Assigns one or more secondary private IP addresses to the specified network interface. You can specify one or more specific secondary IP addresses, or you can specify the number of secondary IP addresses to be automatically assigned within the subnet's CIDR block range. The number of secondary IP addresses that you can assign to an instance varies by instance type. For information about instance types, see Instance Types in the Amazon Elastic Compute Cloud User Guide. For more information about Elastic IP addresses, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.

AssignPrivateIpAddresses is available only in EC2-VPC.

Examples:

Example: To assign a specific secondary private IP address to an interface


# This example assigns the specified secondary private IP address to the specified network interface.

resp = client.assign_private_ip_addresses({
  network_interface_id: "eni-e5aa89a3", 
  private_ip_addresses: [
    "10.0.0.82", 
  ], 
})

Example: To assign secondary private IP addresses that Amazon EC2 selects to an interface


# This example assigns two secondary private IP addresses to the specified network interface. Amazon EC2 automatically assigns these IP addresses from the available IP addresses in the CIDR block range of the subnet the network interface is associated with.

resp = client.assign_private_ip_addresses({
  network_interface_id: "eni-e5aa89a3", 
  secondary_private_ip_address_count: 2, 
})

Request syntax with placeholder values


resp = client.assign_private_ip_addresses({
  allow_reassignment: false,
  network_interface_id: "String", # required
  private_ip_addresses: ["String"],
  secondary_private_ip_address_count: 1,
})

Options Hash (options):

  • :allow_reassignment (Boolean)

    Indicates whether to allow an IP address that is already assigned to another network interface or instance to be reassigned to the specified network interface.

  • :network_interface_id (required, String)

    The ID of the network interface.

  • :private_ip_addresses (Array<String>)

    One or more IP addresses to be assigned as a secondary private IP address to the network interface. You can\'t specify this parameter when also specifying a number of secondary IP addresses.

    If you don\'t specify an IP address, Amazon EC2 automatically selects an IP address within the subnet range.

  • :secondary_private_ip_address_count (Integer)

    The number of secondary IP addresses to assign to the network interface. You can\'t specify this parameter when also specifying private IP addresses.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#associate_address(options = {}) ⇒ Types::AssociateAddressResult

Associates an Elastic IP address with an instance or a network interface.

An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.

[EC2-Classic, VPC in an EC2-VPC-only account] If the Elastic IP address is already associated with a different instance, it is disassociated from that instance and associated with the specified instance. If you associate an Elastic IP address with an instance that has an existing Elastic IP address, the existing address is disassociated from the instance, but remains allocated to your account.

[VPC in an EC2-Classic account] If you don't specify a private IP address, the Elastic IP address is associated with the primary IP address. If the Elastic IP address is already associated with a different instance or a network interface, you get an error unless you allow reassociation. You cannot associate an Elastic IP address with an instance or network interface that has an existing Elastic IP address.

This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error, and you may be charged for each time the Elastic IP address is remapped to the same instance. For more information, see the Elastic IP Addresses section of Amazon EC2 Pricing.

Examples:

Example: To associate an Elastic IP address in EC2-VPC


# This example associates the specified Elastic IP address with the specified instance in a VPC.

resp = client.associate_address({
  allocation_id: "eipalloc-64d5890a", 
  instance_id: "i-0b263919b6498b123", 
})

# resp.to_h outputs the following:
{
  association_id: "eipassoc-2bebb745", 
}

Example: To associate an Elastic IP address with a network interface


# This example associates the specified Elastic IP address with the specified network interface.

resp = client.associate_address({
  allocation_id: "eipalloc-64d5890a", 
  network_interface_id: "eni-1a2b3c4d", 
})

# resp.to_h outputs the following:
{
  association_id: "eipassoc-2bebb745", 
}

Example: To associate an Elastic IP address in EC2-Classic


# This example associates an Elastic IP address with an instance in EC2-Classic.

resp = client.associate_address({
  instance_id: "i-07ffe74c7330ebf53", 
  public_ip: "198.51.100.0", 
})

Request syntax with placeholder values


resp = client.associate_address({
  allocation_id: "String",
  instance_id: "String",
  public_ip: "String",
  allow_reassociation: false,
  dry_run: false,
  network_interface_id: "String",
  private_ip_address: "String",
})

Response structure


resp.association_id #=> String

Options Hash (options):

  • :allocation_id (String)

    [EC2-VPC] The allocation ID. This is required for EC2-VPC.

  • :instance_id (String)

    The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.

  • :public_ip (String)

    The Elastic IP address. This is required for EC2-Classic.

  • :allow_reassociation (Boolean)

    [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :network_interface_id (String)

    [EC2-VPC] The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.

  • :private_ip_address (String)

    [EC2-VPC] The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.

Returns:

See Also:

#associate_dhcp_options(options = {}) ⇒ Struct

Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.

After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly renew the lease using the operating system on the instance.

For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To associate a DHCP options set with a VPC


# This example associates the specified DHCP options set with the specified VPC.

resp = client.associate_dhcp_options({
  dhcp_options_id: "dopt-d9070ebb", 
  vpc_id: "vpc-a01106c2", 
})

Example: To associate the default DHCP options set with a VPC


# This example associates the default DHCP options set with the specified VPC.

resp = client.associate_dhcp_options({
  dhcp_options_id: "default", 
  vpc_id: "vpc-a01106c2", 
})

Request syntax with placeholder values


resp = client.associate_dhcp_options({
  dhcp_options_id: "String", # required
  vpc_id: "String", # required
  dry_run: false,
})

Options Hash (options):

  • :dhcp_options_id (required, String)

    The ID of the DHCP options set, or default to associate no DHCP options with the VPC.

  • :vpc_id (required, String)

    The ID of the VPC.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#associate_iam_instance_profile(options = {}) ⇒ Types::AssociateIamInstanceProfileResult

Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM instance profile with an instance.

Examples:

Request syntax with placeholder values


resp = client.associate_iam_instance_profile({
  iam_instance_profile: { # required
    arn: "String",
    name: "String",
  },
  instance_id: "String", # required
})

Response structure


resp.iam_instance_profile_association.association_id #=> String
resp.iam_instance_profile_association.instance_id #=> String
resp.iam_instance_profile_association.iam_instance_profile.arn #=> String
resp.iam_instance_profile_association.iam_instance_profile.id #=> String
resp.iam_instance_profile_association.state #=> String, one of "associating", "associated", "disassociating", "disassociated"
resp.iam_instance_profile_association.timestamp #=> Time

Options Hash (options):

Returns:

See Also:

#associate_route_table(options = {}) ⇒ Types::AssociateRouteTableResult

Associates a subnet with a route table. The subnet and route table must be in the same VPC. This association causes traffic originating from the subnet to be routed according to the routes in the route table. The action returns an association ID, which you need in order to disassociate the route table from the subnet later. A route table can be associated with multiple subnets.

For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To associate a route table with a subnet


# This example associates the specified route table with the specified subnet.

resp = client.associate_route_table({
  route_table_id: "rtb-22574640", 
  subnet_id: "subnet-9d4a7b6", 
})

# resp.to_h outputs the following:
{
  association_id: "rtbassoc-781d0d1a", 
}

Request syntax with placeholder values


resp = client.associate_route_table({
  dry_run: false,
  route_table_id: "String", # required
  subnet_id: "String", # required
})

Response structure


resp.association_id #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :route_table_id (required, String)

    The ID of the route table.

  • :subnet_id (required, String)

    The ID of the subnet.

Returns:

See Also:

#associate_subnet_cidr_block(options = {}) ⇒ Types::AssociateSubnetCidrBlockResult

Associates a CIDR block with your subnet. You can only associate a single IPv6 CIDR block with your subnet. An IPv6 CIDR block must have a prefix length of /64.

Examples:

Request syntax with placeholder values


resp = client.associate_subnet_cidr_block({
  ipv_6_cidr_block: "String", # required
  subnet_id: "String", # required
})

Response structure


resp.ipv_6_cidr_block_association.association_id #=> String
resp.ipv_6_cidr_block_association.ipv_6_cidr_block #=> String
resp.ipv_6_cidr_block_association.ipv_6_cidr_block_state.state #=> String, one of "associating", "associated", "disassociating", "disassociated", "failing", "failed"
resp.ipv_6_cidr_block_association.ipv_6_cidr_block_state.status_message #=> String
resp.subnet_id #=> String

Options Hash (options):

  • :ipv_6_cidr_block (required, String)

    The IPv6 CIDR block for your subnet. The subnet must have a /64 prefix length.

  • :subnet_id (required, String)

    The ID of your subnet.

Returns:

See Also:

#associate_vpc_cidr_block(options = {}) ⇒ Types::AssociateVpcCidrBlockResult

Associates a CIDR block with your VPC. You can associate a secondary IPv4 CIDR block, or you can associate an Amazon-provided IPv6 CIDR block. The IPv6 CIDR block size is fixed at /56.

For more information about associating CIDR blocks with your VPC and applicable restrictions, see VPC and Subnet Sizing in the Amazon Virtual Private Cloud User Guide.

Examples:

Request syntax with placeholder values


resp = client.associate_vpc_cidr_block({
  amazon_provided_ipv_6_cidr_block: false,
  cidr_block: "String",
  vpc_id: "String", # required
})

Response structure


resp.ipv_6_cidr_block_association.association_id #=> String
resp.ipv_6_cidr_block_association.ipv_6_cidr_block #=> String
resp.ipv_6_cidr_block_association.ipv_6_cidr_block_state.state #=> String, one of "associating", "associated", "disassociating", "disassociated", "failing", "failed"
resp.ipv_6_cidr_block_association.ipv_6_cidr_block_state.status_message #=> String
resp.cidr_block_association.association_id #=> String
resp.cidr_block_association.cidr_block #=> String
resp.cidr_block_association.cidr_block_state.state #=> String, one of "associating", "associated", "disassociating", "disassociated", "failing", "failed"
resp.cidr_block_association.cidr_block_state.status_message #=> String
resp.vpc_id #=> String

Options Hash (options):

  • :amazon_provided_ipv_6_cidr_block (Boolean)

    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IPv6 addresses, or the size of the CIDR block.

  • :cidr_block (String)

    An IPv4 CIDR block to associate with the VPC.

  • :vpc_id (required, String)

    The ID of the VPC.

Returns:

See Also:

Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's security groups. You cannot link an EC2-Classic instance to more than one VPC at a time. You can only link an instance that's in the running state. An instance is automatically unlinked from a VPC when it's stopped - you can link it to the VPC again when you restart it.

After you've linked an instance, you cannot change the VPC security groups that are associated with it. To change the security groups, you must first unlink the instance, and then link it again.

Linking your instance to a VPC is sometimes referred to as attaching your instance.

Examples:

Request syntax with placeholder values


resp = client.attach_classic_link_vpc({
  dry_run: false,
  groups: ["String"], # required
  instance_id: "String", # required
  vpc_id: "String", # required
})

Response structure


resp.return #=> true/false

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :groups (required, Array<String>)

    The ID of one or more of the VPC\'s security groups. You cannot specify security groups from a different VPC.

  • :instance_id (required, String)

    The ID of an EC2-Classic instance to link to the ClassicLink-enabled VPC.

  • :vpc_id (required, String)

    The ID of a ClassicLink-enabled VPC.

Returns:

See Also:

#attach_internet_gateway(options = {}) ⇒ Struct

Attaches an Internet gateway to a VPC, enabling connectivity between the Internet and the VPC. For more information about your VPC and Internet gateway, see the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To attach an Internet gateway to a VPC


# This example attaches the specified Internet gateway to the specified VPC.

resp = client.attach_internet_gateway({
  internet_gateway_id: "igw-c0a643a9", 
  vpc_id: "vpc-a01106c2", 
})

Request syntax with placeholder values


resp = client.attach_internet_gateway({
  dry_run: false,
  internet_gateway_id: "String", # required
  vpc_id: "String", # required
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :internet_gateway_id (required, String)

    The ID of the Internet gateway.

  • :vpc_id (required, String)

    The ID of the VPC.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#attach_network_interface(options = {}) ⇒ Types::AttachNetworkInterfaceResult

Attaches a network interface to an instance.

Examples:

Example: To attach a network interface to an instance


# This example attaches the specified network interface to the specified instance.

resp = client.attach_network_interface({
  device_index: 1, 
  instance_id: "i-1234567890abcdef0", 
  network_interface_id: "eni-e5aa89a3", 
})

# resp.to_h outputs the following:
{
  attachment_id: "eni-attach-66c4350a", 
}

Request syntax with placeholder values


resp = client.attach_network_interface({
  device_index: 1, # required
  dry_run: false,
  instance_id: "String", # required
  network_interface_id: "String", # required
})

Response structure


resp.attachment_id #=> String

Options Hash (options):

  • :device_index (required, Integer)

    The index of the device for the network interface attachment.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :instance_id (required, String)

    The ID of the instance.

  • :network_interface_id (required, String)

    The ID of the network interface.

Returns:

See Also:

#attach_volume(options = {}) ⇒ Types::VolumeAttachment

Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.

Encrypted EBS volumes may only be attached to instances that support Amazon EBS encryption. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

For a list of supported device names, see Attaching an EBS Volume to an Instance. Any device names that aren't reserved for instance store volumes can be used for EBS volumes. For more information, see Amazon EC2 Instance Store in the Amazon Elastic Compute Cloud User Guide.

If a volume has an AWS Marketplace product code:

  • The volume can be attached only to a stopped instance.

  • AWS Marketplace product codes are copied from the volume to the instance.

  • You must be subscribed to the product.

  • The instance type and operating system of the instance must support the product. For example, you can't detach a volume from a Windows instance and attach it to a Linux instance.

For an overview of the AWS Marketplace, see Introducing AWS Marketplace.

For more information about EBS volumes, see Attaching Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To attach a volume to an instance


# This example attaches a volume (``vol-1234567890abcdef0``) to an instance (``i-01474ef662b89480``) as ``/dev/sdf``.

resp = client.attach_volume({
  device: "/dev/sdf", 
  instance_id: "i-01474ef662b89480", 
  volume_id: "vol-1234567890abcdef0", 
})

# resp.to_h outputs the following:
{
  attach_time: Time.parse("2016-08-29T18:52:32.724Z"), 
  device: "/dev/sdf", 
  instance_id: "i-01474ef662b89480", 
  state: "attaching", 
  volume_id: "vol-1234567890abcdef0", 
}

Request syntax with placeholder values


resp = client.attach_volume({
  device: "String", # required
  instance_id: "String", # required
  volume_id: "String", # required
  dry_run: false,
})

Response structure


resp.attach_time #=> Time
resp.device #=> String
resp.instance_id #=> String
resp.state #=> String, one of "attaching", "attached", "detaching", "detached"
resp.volume_id #=> String
resp.delete_on_termination #=> true/false

Options Hash (options):

  • :device (required, String)

    The device name to expose to the instance (for example, /dev/sdh or xvdh).

  • :instance_id (required, String)

    The ID of the instance.

  • :volume_id (required, String)

    The ID of the EBS volume. The volume and instance must be within the same Availability Zone.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#attach_vpn_gateway(options = {}) ⇒ Types::AttachVpnGatewayResult

Attaches a virtual private gateway to a VPC. You can attach one virtual private gateway to one VPC at a time.

For more information, see AWS Managed VPN Connections in the Amazon Virtual Private Cloud User Guide.

Examples:

Request syntax with placeholder values


resp = client.attach_vpn_gateway({
  vpc_id: "String", # required
  vpn_gateway_id: "String", # required
  dry_run: false,
})

Response structure


resp.vpc_attachment.state #=> String, one of "attaching", "attached", "detaching", "detached"
resp.vpc_attachment.vpc_id #=> String

Options Hash (options):

  • :vpc_id (required, String)

    The ID of the VPC.

  • :vpn_gateway_id (required, String)

    The ID of the virtual private gateway.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#authorize_security_group_egress(options = {}) ⇒ Struct

[EC2-VPC only] Adds one or more egress rules to a security group for use with a VPC. Specifically, this action permits instances to send traffic to one or more destination IPv4 or IPv6 CIDR address ranges, or to one or more destination security groups for the same VPC. This action doesn't apply to security groups for use in EC2-Classic. For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide. For more information about security group limits, see Amazon VPC Limits.

Each rule consists of the protocol (for example, TCP), plus either a CIDR range or a source group. For the TCP and UDP protocols, you must also specify the destination port or port range. For the ICMP protocol, you must also specify the ICMP type and code. You can use -1 for the type or code to mean all types or all codes. You can optionally specify a description for the rule.

Rule changes are propagated to affected instances as quickly as possible. However, a small delay might occur.

Examples:

Request syntax with placeholder values


resp = client.authorize_security_group_egress({
  dry_run: false,
  group_id: "String", # required
  ip_permissions: [
    {
      from_port: 1,
      ip_protocol: "String",
      ip_ranges: [
        {
          cidr_ip: "String",
          description: "String",
        },
      ],
      ipv_6_ranges: [
        {
          cidr_ipv_6: "String",
          description: "String",
        },
      ],
      prefix_list_ids: [
        {
          description: "String",
          prefix_list_id: "String",
        },
      ],
      to_port: 1,
      user_id_group_pairs: [
        {
          description: "String",
          group_id: "String",
          group_name: "String",
          peering_status: "String",
          user_id: "String",
          vpc_id: "String",
          vpc_peering_connection_id: "String",
        },
      ],
    },
  ],
  cidr_ip: "String",
  from_port: 1,
  ip_protocol: "String",
  to_port: 1,
  source_security_group_name: "String",
  source_security_group_owner_id: "String",
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :group_id (required, String)

    The ID of the security group.

  • :ip_permissions (Array<Types::IpPermission>)

    One or more sets of IP permissions. You can\'t specify a destination security group and a CIDR IP address range in the same set of permissions.

  • :cidr_ip (String)

    Not supported. Use a set of IP permissions to specify the CIDR.

  • :from_port (Integer)

    Not supported. Use a set of IP permissions to specify the port.

  • :ip_protocol (String)

    Not supported. Use a set of IP permissions to specify the protocol name or number.

  • :to_port (Integer)

    Not supported. Use a set of IP permissions to specify the port.

  • :source_security_group_name (String)

    Not supported. Use a set of IP permissions to specify a destination security group.

  • :source_security_group_owner_id (String)

    Not supported. Use a set of IP permissions to specify a destination security group.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#authorize_security_group_ingress(options = {}) ⇒ Struct

Adds one or more ingress rules to a security group.

Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.

[EC2-Classic] This action gives one or more IPv4 CIDR address ranges permission to access a security group in your account, or gives one or more security groups (called the source groups) permission to access a security group for your account. A source group can be for your own AWS account, or another. You can have up to 100 rules per group.

[EC2-VPC] This action gives one or more IPv4 or IPv6 CIDR address ranges permission to access a security group in your VPC, or gives one or more other security groups (called the source groups) permission to access a security group for your VPC. The security groups must all be for the same VPC or a peer VPC in a VPC peering connection. For more information about VPC security group limits, see Amazon VPC Limits.

You can optionally specify a description for the security group rule.

Examples:

Request syntax with placeholder values


resp = client.authorize_security_group_ingress({
  cidr_ip: "String",
  from_port: 1,
  group_id: "String",
  group_name: "String",
  ip_permissions: [
    {
      from_port: 1,
      ip_protocol: "String",
      ip_ranges: [
        {
          cidr_ip: "String",
          description: "String",
        },
      ],
      ipv_6_ranges: [
        {
          cidr_ipv_6: "String",
          description: "String",
        },
      ],
      prefix_list_ids: [
        {
          description: "String",
          prefix_list_id: "String",
        },
      ],
      to_port: 1,
      user_id_group_pairs: [
        {
          description: "String",
          group_id: "String",
          group_name: "String",
          peering_status: "String",
          user_id: "String",
          vpc_id: "String",
          vpc_peering_connection_id: "String",
        },
      ],
    },
  ],
  ip_protocol: "String",
  source_security_group_name: "String",
  source_security_group_owner_id: "String",
  to_port: 1,
  dry_run: false,
})

Options Hash (options):

  • :cidr_ip (String)

    The CIDR IPv4 address range. You can\'t specify this parameter when specifying a source security group.

  • :from_port (Integer)

    The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. For the ICMP/ICMPv6 type number, use -1 to specify all types. If you specify all ICMP/ICMPv6 types, you must specify all codes.

  • :group_id (String)

    The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.

  • :group_name (String)

    [EC2-Classic, default VPC] The name of the security group. You must specify either the security group ID or the security group name in the request.

  • :ip_permissions (Array<Types::IpPermission>)

    One or more sets of IP permissions. Can be used to specify multiple rules in a single command.

  • :ip_protocol (String)

    The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). (VPC only) Use -1 to specify all protocols. If you specify -1, or a protocol number other than tcp, udp, icmp, or 58 (ICMPv6), traffic on all ports is allowed, regardless of any ports you specify. For tcp, udp, and icmp, you must specify a port range. For protocol 58 (ICMPv6), you can optionally specify a port range; if you don\'t, traffic for all types and codes is allowed.

  • :source_security_group_name (String)

    [EC2-Classic, default VPC] The name of the source security group. You can\'t specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, the IP protocol, and the end of the port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol and port range, use a set of IP permissions instead. For EC2-VPC, the source security group must be in the same VPC.

  • :source_security_group_owner_id (String)

    [EC2-Classic] The AWS account ID for the source security group, if the source security group is in a different account. You can\'t specify this parameter in combination with the following parameters: the CIDR IP address range, the IP protocol, the start of the port range, and the end of the port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol and port range, use a set of IP permissions instead.

  • :to_port (Integer)

    The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code number. For the ICMP/ICMPv6 code number, use -1 to specify all codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#bundle_instance(options = {}) ⇒ Types::BundleInstanceResult

Bundles an Amazon instance store-backed Windows instance.

During bundling, only the root device volume (C:) is bundled. Data on other instance store volumes is not preserved.

This action is not applicable for Linux/Unix instances or Windows instances that are backed by Amazon EBS.

For more information, see Creating an Instance Store-Backed Windows AMI.

Examples:

Request syntax with placeholder values


resp = client.bundle_instance({
  instance_id: "String", # required
  storage: { # required
    s3: {
      aws_access_key_id: "String",
      bucket: "String",
      prefix: "String",
      upload_policy: "data",
      upload_policy_signature: "String",
    },
  },
  dry_run: false,
})

Response structure


resp.bundle_task.bundle_id #=> String
resp.bundle_task.bundle_task_error.code #=> String
resp.bundle_task.bundle_task_error.message #=> String
resp.bundle_task.instance_id #=> String
resp.bundle_task.progress #=> String
resp.bundle_task.start_time #=> Time
resp.bundle_task.state #=> String, one of "pending", "waiting-for-shutdown", "bundling", "storing", "cancelling", "complete", "failed"
resp.bundle_task.storage.s3.aws_access_key_id #=> String
resp.bundle_task.storage.s3.bucket #=> String
resp.bundle_task.storage.s3.prefix #=> String
resp.bundle_task.storage.s3.upload_policy #=> IO
resp.bundle_task.storage.s3.upload_policy_signature #=> String
resp.bundle_task.update_time #=> Time

Options Hash (options):

  • :instance_id (required, String)

    The ID of the instance to bundle.

    Type: String

    Default: None

    Required: Yes

  • :storage (required, Types::Storage)

    The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#cancel_bundle_task(options = {}) ⇒ Types::CancelBundleTaskResult

Cancels a bundling operation for an instance store-backed Windows instance.

Examples:

Request syntax with placeholder values


resp = client.cancel_bundle_task({
  bundle_id: "String", # required
  dry_run: false,
})

Response structure


resp.bundle_task.bundle_id #=> String
resp.bundle_task.bundle_task_error.code #=> String
resp.bundle_task.bundle_task_error.message #=> String
resp.bundle_task.instance_id #=> String
resp.bundle_task.progress #=> String
resp.bundle_task.start_time #=> Time
resp.bundle_task.state #=> String, one of "pending", "waiting-for-shutdown", "bundling", "storing", "cancelling", "complete", "failed"
resp.bundle_task.storage.s3.aws_access_key_id #=> String
resp.bundle_task.storage.s3.bucket #=> String
resp.bundle_task.storage.s3.prefix #=> String
resp.bundle_task.storage.s3.upload_policy #=> IO
resp.bundle_task.storage.s3.upload_policy_signature #=> String
resp.bundle_task.update_time #=> Time

Options Hash (options):

  • :bundle_id (required, String)

    The ID of the bundle task.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#cancel_conversion_task(options = {}) ⇒ Struct

Cancels an active conversion task. The task can be the import of an instance or volume. The action removes all artifacts of the conversion, including a partially uploaded volume or instance. If the conversion is complete or is in the process of transferring the final disk image, the command fails and returns an exception.

For more information, see Importing a Virtual Machine Using the Amazon EC2 CLI.

Examples:

Request syntax with placeholder values


resp = client.cancel_conversion_task({
  conversion_task_id: "String", # required
  dry_run: false,
  reason_message: "String",
})

Options Hash (options):

  • :conversion_task_id (required, String)

    The ID of the conversion task.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :reason_message (String)

    The reason for canceling the conversion task.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#cancel_export_task(options = {}) ⇒ Struct

Cancels an active export task. The request removes all artifacts of the export, including any partially-created Amazon S3 objects. If the export task is complete or is in the process of transferring the final disk image, the command fails and returns an error.

Examples:

Request syntax with placeholder values


resp = client.cancel_export_task({
  export_task_id: "String", # required
})

Options Hash (options):

  • :export_task_id (required, String)

    The ID of the export task. This is the ID returned by CreateInstanceExportTask.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#cancel_import_task(options = {}) ⇒ Types::CancelImportTaskResult

Cancels an in-process import virtual machine or import snapshot task.

Examples:

Request syntax with placeholder values


resp = client.cancel_import_task({
  cancel_reason: "String",
  dry_run: false,
  import_task_id: "String",
})

Response structure


resp.import_task_id #=> String
resp.previous_state #=> String
resp.state #=> String

Options Hash (options):

  • :cancel_reason (String)

    The reason for canceling the task.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :import_task_id (String)

    The ID of the import image or import snapshot task to be canceled.

Returns:

See Also:

#cancel_reserved_instances_listing(options = {}) ⇒ Types::CancelReservedInstancesListingResult

Cancels the specified Reserved Instance listing in the Reserved Instance Marketplace.

For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide.

Examples:

Request syntax with placeholder values


resp = client.cancel_reserved_instances_listing({
  reserved_instances_listing_id: "String", # required
})

Response structure


resp.reserved_instances_listings #=> Array
resp.reserved_instances_listings[0].client_token #=> String
resp.reserved_instances_listings[0].create_date #=> Time
resp.reserved_instances_listings[0].instance_counts #=> Array
resp.reserved_instances_listings[0].instance_counts[0].instance_count #=> Integer
resp.reserved_instances_listings[0].instance_counts[0].state #=> String, one of "available", "sold", "cancelled", "pending"
resp.reserved_instances_listings[0].price_schedules #=> Array
resp.reserved_instances_listings[0].price_schedules[0].active #=> true/false
resp.reserved_instances_listings[0].price_schedules[0].currency_code #=> String, one of "USD"
resp.reserved_instances_listings[0].price_schedules[0].price #=> Float
resp.reserved_instances_listings[0].price_schedules[0].term #=> Integer
resp.reserved_instances_listings[0].reserved_instances_id #=> String
resp.reserved_instances_listings[0].reserved_instances_listing_id #=> String
resp.reserved_instances_listings[0].status #=> String, one of "active", "pending", "cancelled", "closed"
resp.reserved_instances_listings[0].status_message #=> String
resp.reserved_instances_listings[0].tags #=> Array
resp.reserved_instances_listings[0].tags[0].key #=> String
resp.reserved_instances_listings[0].tags[0].value #=> String
resp.reserved_instances_listings[0].update_date #=> Time

Options Hash (options):

  • :reserved_instances_listing_id (required, String)

    The ID of the Reserved Instance listing.

Returns:

See Also:

#cancel_spot_fleet_requests(options = {}) ⇒ Types::CancelSpotFleetRequestsResponse

Cancels the specified Spot fleet requests.

After you cancel a Spot fleet request, the Spot fleet launches no new Spot instances. You must specify whether the Spot fleet should also terminate its Spot instances. If you terminate the instances, the Spot fleet request enters the cancelled_terminating state. Otherwise, the Spot fleet request enters the cancelled_running state and the instances continue to run until they are interrupted or you terminate them manually.

Examples:

Example: To cancel a Spot fleet request


# This example cancels the specified Spot fleet request and terminates its associated Spot Instances.

resp = client.cancel_spot_fleet_requests({
  spot_fleet_request_ids: [
    "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", 
  ], 
  terminate_instances: true, 
})

# resp.to_h outputs the following:
{
  successful_fleet_requests: [
    {
      current_spot_fleet_request_state: "cancelled_running", 
      previous_spot_fleet_request_state: "active", 
      spot_fleet_request_id: "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", 
    }, 
  ], 
}

Example: To cancel a Spot fleet request without terminating its Spot Instances


# This example cancels the specified Spot fleet request without terminating its associated Spot Instances.

resp = client.cancel_spot_fleet_requests({
  spot_fleet_request_ids: [
    "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", 
  ], 
  terminate_instances: false, 
})

# resp.to_h outputs the following:
{
  successful_fleet_requests: [
    {
      current_spot_fleet_request_state: "cancelled_terminating", 
      previous_spot_fleet_request_state: "active", 
      spot_fleet_request_id: "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.cancel_spot_fleet_requests({
  dry_run: false,
  spot_fleet_request_ids: ["String"], # required
  terminate_instances: false, # required
})

Response structure


resp.successful_fleet_requests #=> Array
resp.successful_fleet_requests[0].current_spot_fleet_request_state #=> String, one of "submitted", "active", "cancelled", "failed", "cancelled_running", "cancelled_terminating", "modifying"
resp.successful_fleet_requests[0].previous_spot_fleet_request_state #=> String, one of "submitted", "active", "cancelled", "failed", "cancelled_running", "cancelled_terminating", "modifying"
resp.successful_fleet_requests[0].spot_fleet_request_id #=> String
resp.unsuccessful_fleet_requests #=> Array
resp.unsuccessful_fleet_requests[0].error.code #=> String, one of "fleetRequestIdDoesNotExist", "fleetRequestIdMalformed", "fleetRequestNotInCancellableState", "unexpectedError"
resp.unsuccessful_fleet_requests[0].error.message #=> String
resp.unsuccessful_fleet_requests[0].spot_fleet_request_id #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :spot_fleet_request_ids (required, Array<String>)

    The IDs of the Spot fleet requests.

  • :terminate_instances (required, Boolean)

    Indicates whether to terminate instances for a Spot fleet request if it is canceled successfully.

Returns:

See Also:

#cancel_spot_instance_requests(options = {}) ⇒ Types::CancelSpotInstanceRequestsResult

Cancels one or more Spot instance requests. Spot instances are instances that Amazon EC2 starts on your behalf when the bid price that you specify exceeds the current Spot price. Amazon EC2 periodically sets the Spot price based on available Spot instance capacity and current Spot instance requests. For more information, see Spot Instance Requests in the Amazon Elastic Compute Cloud User Guide.

Canceling a Spot instance request does not terminate running Spot instances associated with the request.

Examples:

Example: To cancel Spot Instance requests


# This example cancels a Spot Instance request.

resp = client.cancel_spot_instance_requests({
  spot_instance_request_ids: [
    "sir-08b93456", 
  ], 
})

# resp.to_h outputs the following:
{
  cancelled_spot_instance_requests: [
    {
      spot_instance_request_id: "sir-08b93456", 
      state: "cancelled", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.cancel_spot_instance_requests({
  dry_run: false,
  spot_instance_request_ids: ["String"], # required
})

Response structure


resp.cancelled_spot_instance_requests #=> Array
resp.cancelled_spot_instance_requests[0].spot_instance_request_id #=> String
resp.cancelled_spot_instance_requests[0].state #=> String, one of "active", "open", "closed", "cancelled", "completed"

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :spot_instance_request_ids (required, Array<String>)

    One or more Spot instance request IDs.

Returns:

See Also:

#confirm_product_instance(options = {}) ⇒ Types::ConfirmProductInstanceResult

Determines whether a product code is associated with an instance. This action can only be used by the owner of the product code. It is useful when a product code owner must verify whether another user's instance is eligible for support.

Examples:

Example: To confirm the product instance


# This example determines whether the specified product code is associated with the specified instance.

resp = client.confirm_product_instance({
  instance_id: "i-1234567890abcdef0", 
  product_code: "774F4FF8", 
})

# resp.to_h outputs the following:
{
  owner_id: "123456789012", 
}

Request syntax with placeholder values


resp = client.confirm_product_instance({
  instance_id: "String", # required
  product_code: "String", # required
  dry_run: false,
})

Response structure


resp.owner_id #=> String
resp.return #=> true/false

Options Hash (options):

  • :instance_id (required, String)

    The ID of the instance.

  • :product_code (required, String)

    The product code. This must be a product code that you own.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#copy_fpga_image(options = {}) ⇒ Types::CopyFpgaImageResult

Copies the specified Amazon FPGA Image (AFI) to the current region.

Examples:

Request syntax with placeholder values


resp = client.copy_fpga_image({
  dry_run: false,
  source_fpga_image_id: "String", # required
  description: "String",
  name: "String",
  source_region: "String", # required
  client_token: "String",
})

Response structure


resp.fpga_image_id #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :source_fpga_image_id (required, String)

    The ID of the source AFI.

  • :description (String)

    The description for the new AFI.

  • :name (String)

    The name for the new AFI. The default is the name of the source AFI.

  • :source_region (required, String)

    The region that contains the source AFI.

  • :client_token (String)

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

Returns:

See Also:

#copy_image(options = {}) ⇒ Types::CopyImageResult

Initiates the copy of an AMI from the specified source region to the current region. You specify the destination region by using its endpoint when making the request.

For more information about the prerequisites and limits when copying an AMI, see Copying an AMI in the Amazon Elastic Compute Cloud User Guide.

Examples:

Request syntax with placeholder values


resp = client.copy_image({
  client_token: "String",
  description: "String",
  encrypted: false,
  kms_key_id: "String",
  name: "String", # required
  source_image_id: "String", # required
  source_region: "String", # required
  dry_run: false,
})

Response structure


resp.image_id #=> String

Options Hash (options):

  • :client_token (String)

    Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.

  • :description (String)

    A description for the new AMI in the destination region.

  • :encrypted (Boolean)

    Specifies whether the destination snapshots of the copied image should be encrypted. The default CMK for EBS is used unless a non-default AWS Key Management Service (AWS KMS) CMK is specified with KmsKeyId. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

  • :kms_key_id (String)

    The full ARN of the AWS Key Management Service (AWS KMS) CMK to use when encrypting the snapshots of an image during a copy operation. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. The ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. The specified CMK must exist in the region that the snapshot is being copied to. If a KmsKeyId is specified, the Encrypted flag must also be set.

  • :name (required, String)

    The name of the new AMI in the destination region.

  • :source_image_id (required, String)

    The ID of the AMI to copy.

  • :source_region (required, String)

    The name of the region that contains the AMI to copy.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

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

Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3. You can copy the snapshot within the same region or from one region to another. You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs). The snapshot is copied to the regional endpoint that you send the HTTP request to.

Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted snapshots remain unencrypted, unless the Encrypted flag is specified during the snapshot copy operation. By default, encrypted snapshot copies use the default AWS Key Management Service (AWS KMS) customer master key (CMK); however, you can specify a non-default CMK with the KmsKeyId parameter.

To copy an encrypted snapshot that has been shared from another account, you must have permissions for the CMK used to encrypt the snapshot.

Snapshots created by the CopySnapshot action have an arbitrary volume ID that should not be used for any purpose.

For more information, see Copying an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide.

Examples:

Copy an encrypted snapshot


# same as above, expect you must pass `encrypted: true`
resp = ec2.copy_snapshot({
    source_region: source_region,
    source_snapshot_id: source_snapshot_id,
    encrypted: true, # required for encrypted snapshots
})

Copy snapshot example


source_snapshot_id = 'snapshot-id'
source_region = 'us-east-1'
target_region = 'us-west-2'

# You must configure your EC2 client for the destination region to copy
ec2 = Aws::EC2::Client(region: target_region)

resp = ec2.copy_snapshot({
    source_region: source_region,
    source_snapshot_id: source_snapshot_id,
})

snapshot_id = resp.snapshot_id

ec2.wait_until(:snapshot_completed, snapshot_ids: [snapshot_id])

Request syntax with placeholder values


resp = client.copy_snapshot({
  description: "String",
  encrypted: false,
  kms_key_id: "String",
  source_region: "String", # required
  source_snapshot_id: "String", # required
  dry_run: false,
})

Response structure


resp.snapshot_id #=> String

Options Hash (options):

  • :description (String)

    A description for the EBS snapshot.

  • :encrypted (Boolean)

    Specifies whether the destination snapshot should be encrypted. You can encrypt a copy of an unencrypted snapshot using this flag, but you cannot use it to create an unencrypted copy from an encrypted snapshot. Your default CMK for EBS is used unless a non-default AWS Key Management Service (AWS KMS) CMK is specified with KmsKeyId. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

  • :kms_key_id (String)

    The full ARN of the AWS Key Management Service (AWS KMS) CMK to use when creating the snapshot copy. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. The ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. The specified CMK must exist in the region that the snapshot is being copied to. If a KmsKeyId is specified, the Encrypted flag must also be set.

  • :source_region (required, String)

    The ID of the region that contains the snapshot to be copied.

  • :source_snapshot_id (required, String)

    The ID of the EBS snapshot to copy.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#create_customer_gateway(options = {}) ⇒ Types::CreateCustomerGatewayResult

Provides information to AWS about your VPN customer gateway device. The customer gateway is the appliance at your end of the VPN connection. (The device on the AWS side of the VPN connection is the virtual private gateway.) You must provide the Internet-routable IP address of the customer gateway's external interface. The IP address must be static and may be behind a device performing network address translation (NAT).

For devices that use Border Gateway Protocol (BGP), you can also provide the device's BGP Autonomous System Number (ASN). You can use an existing ASN assigned to your network. If you don't have an ASN already, you can use a private ASN (in the 64512 - 65534 range).

Amazon EC2 supports all 2-byte ASN numbers in the range of 1 - 65534, with the exception of 7224, which is reserved in the us-east-1 region, and 9059, which is reserved in the eu-west-1 region.

For more information about VPN customer gateways, see AWS Managed VPN Connections in the Amazon Virtual Private Cloud User Guide.

You cannot create more than one customer gateway with the same VPN type, IP address, and BGP ASN parameter values. If you run an identical request more than one time, the first request creates the customer gateway, and subsequent requests return information about the existing customer gateway. The subsequent requests do not create new customer gateway resources.

Examples:

Example: To create a customer gateway


# This example creates a customer gateway with the specified IP address for its outside interface.

resp = client.create_customer_gateway({
  bgp_asn: 65534, 
  public_ip: "12.1.2.3", 
  type: "ipsec.1", 
})

# resp.to_h outputs the following:
{
  customer_gateway: {
    bgp_asn: "65534", 
    customer_gateway_id: "cgw-0e11f167", 
    ip_address: "12.1.2.3", 
    state: "available", 
    type: "ipsec.1", 
  }, 
}

Request syntax with placeholder values


resp = client.create_customer_gateway({
  bgp_asn: 1, # required
  public_ip: "String", # required
  type: "ipsec.1", # required, accepts ipsec.1
  dry_run: false,
})

Response structure


resp.customer_gateway.bgp_asn #=> String
resp.customer_gateway.customer_gateway_id #=> String
resp.customer_gateway.ip_address #=> String
resp.customer_gateway.state #=> String
resp.customer_gateway.type #=> String
resp.customer_gateway.tags #=> Array
resp.customer_gateway.tags[0].key #=> String
resp.customer_gateway.tags[0].value #=> String

Options Hash (options):

  • :bgp_asn (required, Integer)

    For devices that support BGP, the customer gateway\'s BGP ASN.

    Default: 65000

  • :public_ip (required, String)

    The Internet-routable IP address for the customer gateway\'s outside interface. The address must be static.

  • :type (required, String)

    The type of VPN connection that this customer gateway supports (ipsec.1).

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#create_default_vpc(options = {}) ⇒ Types::CreateDefaultVpcResult

Creates a default VPC with a size /16 IPv4 CIDR block and a default subnet in each Availability Zone. For more information about the components of a default VPC, see Default VPC and Default Subnets in the Amazon Virtual Private Cloud User Guide. You cannot specify the components of the default VPC yourself.

You can create a default VPC if you deleted your previous default VPC. You cannot have more than one default VPC per region.

If your account supports EC2-Classic, you cannot use this action to create a default VPC in a region that supports EC2-Classic. If you want a default VPC in a region that supports EC2-Classic, see "I really want a default VPC for my existing EC2 account. Is that possible?" in the Default VPCs FAQ.

Examples:

Request syntax with placeholder values


resp = client.create_default_vpc({
  dry_run: false,
})

Response structure


resp.vpc.cidr_block #=> String
resp.vpc.dhcp_options_id #=> String
resp.vpc.state #=> String, one of "pending", "available"
resp.vpc.vpc_id #=> String
resp.vpc.instance_tenancy #=> String, one of "default", "dedicated", "host"
resp.vpc.ipv_6_cidr_block_association_set #=> Array
resp.vpc.ipv_6_cidr_block_association_set[0].association_id #=> String
resp.vpc.ipv_6_cidr_block_association_set[0].ipv_6_cidr_block #=> String
resp.vpc.ipv_6_cidr_block_association_set[0].ipv_6_cidr_block_state.state #=> String, one of "associating", "associated", "disassociating", "disassociated", "failing", "failed"
resp.vpc.ipv_6_cidr_block_association_set[0].ipv_6_cidr_block_state.status_message #=> String
resp.vpc.cidr_block_association_set #=> Array
resp.vpc.cidr_block_association_set[0].association_id #=> String
resp.vpc.cidr_block_association_set[0].cidr_block #=> String
resp.vpc.cidr_block_association_set[0].cidr_block_state.state #=> String, one of "associating", "associated", "disassociating", "disassociated", "failing", "failed"
resp.vpc.cidr_block_association_set[0].cidr_block_state.status_message #=> String
resp.vpc.is_default #=> true/false
resp.vpc.tags #=> Array
resp.vpc.tags[0].key #=> String
resp.vpc.tags[0].value #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#create_dhcp_options(options = {}) ⇒ Types::CreateDhcpOptionsResult

Creates a set of DHCP options for your VPC. After creating the set, you must associate it with the VPC, causing all existing and new instances that you launch in the VPC to use this set of DHCP options. The following are the individual DHCP options you can specify. For more information about the options, see RFC 2132.

  • domain-name-servers - The IP addresses of up to four domain name servers, or AmazonProvidedDNS. The default DHCP option set specifies AmazonProvidedDNS. If specifying more than one domain name server, specify the IP addresses in a single parameter, separated by commas. If you want your instance to receive a custom DNS hostname as specified in domain-name, you must set domain-name-servers to a custom DNS server.

  • domain-name - If you're using AmazonProvidedDNS in us-east-1, specify ec2.internal. If you're using AmazonProvidedDNS in another region, specify region.compute.internal (for example, ap-northeast-1.compute.internal). Otherwise, specify a domain name (for example, MyCompany.com). This value is used to complete unqualified DNS hostnames. Important: Some Linux operating systems accept multiple domain names separated by spaces. However, Windows and other Linux operating systems treat the value as a single domain, which results in unexpected behavior. If your DHCP options set is associated with a VPC that has instances with multiple operating systems, specify only one domain name.

  • ntp-servers - The IP addresses of up to four Network Time Protocol (NTP) servers.

  • netbios-name-servers - The IP addresses of up to four NetBIOS name servers.

  • netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend that you specify 2 (broadcast and multicast are not currently supported). For more information about these node types, see RFC 2132.

Your VPC automatically starts out with a set of DHCP options that includes only a DNS server that we provide (AmazonProvidedDNS). If you create a set of options, and if your VPC has an Internet gateway, make sure to set the domain-name-servers option either to AmazonProvidedDNS or to a domain name server of your choice. For more information about DHCP options, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To create a DHCP options set


# This example creates a DHCP options set.

resp = client.create_dhcp_options({
  dhcp_configurations: [
    {
      key: "domain-name-servers", 
      values: [
        "10.2.5.1", 
        "10.2.5.2", 
      ], 
    }, 
  ], 
})

# resp.to_h outputs the following:
{
  dhcp_options: {
    dhcp_configurations: [
      {
        key: "domain-name-servers", 
        values: [
          {
            value: "10.2.5.2", 
          }, 
          {
            value: "10.2.5.1", 
          }, 
        ], 
      }, 
    ], 
    dhcp_options_id: "dopt-d9070ebb", 
  }, 
}

Request syntax with placeholder values


resp = client.create_dhcp_options({
  dhcp_configurations: [ # required
    {
      key: "String",
      values: ["String"],
    },
  ],
  dry_run: false,
})

Response structure


resp.dhcp_options.dhcp_configurations #=> Array
resp.dhcp_options.dhcp_configurations[0].key #=> String
resp.dhcp_options.dhcp_configurations[0].values #=> Array
resp.dhcp_options.dhcp_configurations[0].values[0] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.dhcp_options.dhcp_options_id #=> String
resp.dhcp_options.tags #=> Array
resp.dhcp_options.tags[0].key #=> String
resp.dhcp_options.tags[0].value #=> String

Options Hash (options):

  • :dhcp_configurations (required, Array<Types::NewDhcpConfiguration>)

    A DHCP configuration option.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#create_egress_only_internet_gateway(options = {}) ⇒ Types::CreateEgressOnlyInternetGatewayResult

[IPv6 only] Creates an egress-only Internet gateway for your VPC. An egress-only Internet gateway is used to enable outbound communication over IPv6 from instances in your VPC to the Internet, and prevents hosts outside of your VPC from initiating an IPv6 connection with your instance.

Examples:

Request syntax with placeholder values


resp = client.create_egress_only_internet_gateway({
  client_token: "String",
  dry_run: false,
  vpc_id: "String", # required
})

Response structure


resp.client_token #=> String
resp.egress_only_internet_gateway.attachments #=> Array
resp.egress_only_internet_gateway.attachments[0].state #=> String, one of "attaching", "attached", "detaching", "detached"
resp.egress_only_internet_gateway.attachments[0].vpc_id #=> String
resp.egress_only_internet_gateway.egress_only_internet_gateway_id #=> String

Options Hash (options):

  • :client_token (String)

    Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :vpc_id (required, String)

    The ID of the VPC for which to create the egress-only Internet gateway.

Returns:

See Also:

#create_flow_logs(options = {}) ⇒ Types::CreateFlowLogsResult

Creates one or more flow logs to capture IP traffic for a specific network interface, subnet, or VPC. Flow logs are delivered to a specified log group in Amazon CloudWatch Logs. If you specify a VPC or subnet in the request, a log stream is created in CloudWatch Logs for each network interface in the subnet or VPC. Log streams can include information about accepted and rejected traffic to a network interface. You can view the data in your log streams using Amazon CloudWatch Logs.

In your request, you must also specify an IAM role that has permission to publish logs to CloudWatch Logs.

Examples:

Request syntax with placeholder values


resp = client.create_flow_logs({
  client_token: "String",
  deliver_logs_permission_arn: "String", # required
  log_group_name: "String", # required
  resource_ids: ["String"], # required
  resource_type: "VPC", # required, accepts VPC, Subnet, NetworkInterface
  traffic_type: "ACCEPT", # required, accepts ACCEPT, REJECT, ALL
})

Response structure


resp.client_token #=> String
resp.flow_log_ids #=> Array
resp.flow_log_ids[0] #=> String
resp.unsuccessful #=> Array
resp.unsuccessful[0].error.code #=> String
resp.unsuccessful[0].error.message #=> String
resp.unsuccessful[0].resource_id #=> String

Options Hash (options):

  • :client_token (String)

    Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

  • :deliver_logs_permission_arn (required, String)

    The ARN for the IAM role that\'s used to post flow logs to a CloudWatch Logs log group.

  • :log_group_name (required, String)

    The name of the CloudWatch log group.

  • :resource_ids (required, Array<String>)

    One or more subnet, network interface, or VPC IDs.

    Constraints: Maximum of 1000 resources

  • :resource_type (required, String)

    The type of resource on which to create the flow log.

  • :traffic_type (required, String)

    The type of traffic to log.

Returns:

See Also:

#create_fpga_image(options = {}) ⇒ Types::CreateFpgaImageResult

Creates an Amazon FPGA Image (AFI) from the specified design checkpoint (DCP).

The create operation is asynchronous. To verify that the AFI is ready for use, check the output logs.

An AFI contains the FPGA bitstream that is ready to download to an FPGA. You can securely deploy an AFI on one or more FPGA-accelerated instances. For more information, see the AWS FPGA Hardware Development Kit.

Examples:

Request syntax with placeholder values


resp = client.create_fpga_image({
  dry_run: false,
  input_storage_location: { # required
    bucket: "String",
    key: "String",
  },
  logs_storage_location: {
    bucket: "String",
    key: "String",
  },
  description: "String",
  name: "String",
  client_token: "String",
})

Response structure


resp.fpga_image_id #=> String
resp.fpga_image_global_id #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :input_storage_location (required, Types::StorageLocation)

    The location of the encrypted design checkpoint in Amazon S3. The input must be a tarball.

  • :logs_storage_location (Types::StorageLocation)

    The location in Amazon S3 for the output logs.

  • :description (String)

    A description for the AFI.

  • :name (String)

    A name for the AFI.

  • :client_token (String)

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

Returns:

See Also:

#create_image(options = {}) ⇒ Types::CreateImageResult

Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.

If you customized your instance with instance store volumes or EBS volumes in addition to the root device volume, the new AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional volumes.

For more information, see Creating Amazon EBS-Backed Linux AMIs in the Amazon Elastic Compute Cloud User Guide.

Examples:

Request syntax with placeholder values


resp = client.create_image({
  block_device_mappings: [
    {
      device_name: "String",
      virtual_name: "String",
      ebs: {
        encrypted: false,
        delete_on_termination: false,
        iops: 1,
        snapshot_id: "String",
        volume_size: 1,
        volume_type: "standard", # accepts standard, io1, gp2, sc1, st1
      },
      no_device: "String",
    },
  ],
  description: "String",
  dry_run: false,
  instance_id: "String", # required
  name: "String", # required
  no_reboot: false,
})

Response structure


resp.image_id #=> String

Options Hash (options):

  • :block_device_mappings (Array<Types::BlockDeviceMapping>)

    Information about one or more block device mappings.

  • :description (String)

    A description for the new image.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :instance_id (required, String)

    The ID of the instance.

  • :name (required, String)

    A name for the new image.

    Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes (\'), at-signs (@), or underscores(_)

  • :no_reboot (Boolean)

    By default, Amazon EC2 attempts to shut down and reboot the instance before creating the image. If the \'No Reboot\' option is set, Amazon EC2 doesn\'t shut down the instance before creating the image. When this option is used, file system integrity on the created image can\'t be guaranteed.

Returns:

See Also:

#create_instance_export_task(options = {}) ⇒ Types::CreateInstanceExportTaskResult

Exports a running or stopped instance to an S3 bucket.

For information about the supported operating systems, image formats, and known limitations for the types of instances you can export, see Exporting an Instance as a VM Using VM Import/Export in the VM Import/Export User Guide.

Examples:

Request syntax with placeholder values


resp = client.create_instance_export_task({
  description: "String",
  export_to_s3_task: {
    container_format: "ova", # accepts ova
    disk_image_format: "VMDK", # accepts VMDK, RAW, VHD
    s3_bucket: "String",
    s3_prefix: "String",
  },
  instance_id: "String", # required
  target_environment: "citrix", # accepts citrix, vmware, microsoft
})

Response structure


resp.export_task.description #=> String
resp.export_task.export_task_id #=> String
resp.export_task.export_to_s3_task.container_format #=> String, one of "ova"
resp.export_task.export_to_s3_task.disk_image_format #=> String, one of "VMDK", "RAW", "VHD"
resp.export_task.export_to_s3_task.s3_bucket #=> String
resp.export_task.export_to_s3_task.s3_key #=> String
resp.export_task.instance_export_details.instance_id #=> String
resp.export_task.instance_export_details.target_environment #=> String, one of "citrix", "vmware", "microsoft"
resp.export_task.state #=> String, one of "active", "cancelling", "cancelled", "completed"
resp.export_task.status_message #=> String

Options Hash (options):

  • :description (String)

    A description for the conversion task or the resource being exported. The maximum length is 255 bytes.

  • :export_to_s3_task (Types::ExportToS3TaskSpecification)

    The format and location for an instance export task.

  • :instance_id (required, String)

    The ID of the instance.

  • :target_environment (String)

    The target virtualization environment.

Returns:

See Also:

#create_internet_gateway(options = {}) ⇒ Types::CreateInternetGatewayResult

Creates an Internet gateway for use with a VPC. After creating the Internet gateway, you attach it to a VPC using AttachInternetGateway.

For more information about your VPC and Internet gateway, see the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To create an Internet gateway


# This example creates an Internet gateway.

resp = client.create_internet_gateway({
})

# resp.to_h outputs the following:
{
  internet_gateway: {
    attachments: [
    ], 
    internet_gateway_id: "igw-c0a643a9", 
    tags: [
    ], 
  }, 
}

Request syntax with placeholder values


resp = client.create_internet_gateway({
  dry_run: false,
})

Response structure


resp.internet_gateway.attachments #=> Array
resp.internet_gateway.attachments[0].state #=> String, one of "attaching", "attached", "detaching", "detached"
resp.internet_gateway.attachments[0].vpc_id #=> String
resp.internet_gateway.internet_gateway_id #=> String
resp.internet_gateway.tags #=> Array
resp.internet_gateway.tags[0].key #=> String
resp.internet_gateway.tags[0].value #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

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

Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public key and displays the private key for you to save to a file. The private key is returned as an unencrypted PEM encoded PKCS#8 private key. If a key with the specified name already exists, Amazon EC2 returns an error.

You can have up to five thousand key pairs per region.

The key pair returned to you is available only in the region in which you create it. To create a key pair that is available in all regions, use ImportKeyPair.

For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To create a key pair


# This example creates a key pair named my-key-pair.

resp = client.create_key_pair({
  key_name: "my-key-pair", 
})

Request syntax with placeholder values


resp = client.create_key_pair({
  key_name: "String", # required
  dry_run: false,
})

Response structure


resp.key_fingerprint #=> String
resp.key_material #=> String
resp.key_name #=> String

Options Hash (options):

  • :key_name (required, String)

    A unique name for the key pair.

    Constraints: Up to 255 ASCII characters

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#create_nat_gateway(options = {}) ⇒ Types::CreateNatGatewayResult

Creates a NAT gateway in the specified subnet. A NAT gateway can be used to enable instances in a private subnet to connect to the Internet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. For more information, see NAT Gateways in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To create a NAT gateway


# This example creates a NAT gateway in subnet subnet-1a2b3c4d and associates an Elastic IP address with the allocation ID eipalloc-37fc1a52 with the NAT gateway.

resp = client.create_nat_gateway({
  allocation_id: "eipalloc-37fc1a52", 
  subnet_id: "subnet-1a2b3c4d", 
})

# resp.to_h outputs the following:
{
  nat_gateway: {
    create_time: Time.parse("2015-12-17T12:45:26.732Z"), 
    nat_gateway_addresses: [
      {
        allocation_id: "eipalloc-37fc1a52", 
      }, 
    ], 
    nat_gateway_id: "nat-08d48af2a8e83edfd", 
    state: "pending", 
    subnet_id: "subnet-1a2b3c4d", 
    vpc_id: "vpc-1122aabb", 
  }, 
}

Request syntax with placeholder values


resp = client.create_nat_gateway({
  allocation_id: "String", # required
  client_token: "String",
  subnet_id: "String", # required
})

Response structure


resp.client_token #=> String
resp.nat_gateway.create_time #=> Time
resp.nat_gateway.delete_time #=> Time
resp.nat_gateway.failure_code #=> String
resp.nat_gateway.failure_message #=> String
resp.nat_gateway.nat_gateway_addresses #=> Array
resp.nat_gateway.nat_gateway_addresses[0].allocation_id #=> String
resp.nat_gateway.nat_gateway_addresses[0].network_interface_id #=> String
resp.nat_gateway.nat_gateway_addresses[0].private_ip #=> String
resp.nat_gateway.nat_gateway_addresses[0].public_ip #=> String
resp.nat_gateway.nat_gateway_id #=> String
resp.nat_gateway.provisioned_bandwidth.provision_time #=> Time
resp.nat_gateway.provisioned_bandwidth.provisioned #=> String
resp.nat_gateway.provisioned_bandwidth.request_time #=> Time
resp.nat_gateway.provisioned_bandwidth.requested #=> String
resp.nat_gateway.provisioned_bandwidth.status #=> String
resp.nat_gateway.state #=> String, one of "pending", "failed", "available", "deleting", "deleted"
resp.nat_gateway.subnet_id #=> String
resp.nat_gateway.vpc_id #=> String
resp.nat_gateway.tags #=> Array
resp.nat_gateway.tags[0].key #=> String
resp.nat_gateway.tags[0].value #=> String

Options Hash (options):

  • :allocation_id (required, String)

    The allocation ID of an Elastic IP address to associate with the NAT gateway. If the Elastic IP address is associated with another resource, you must first disassociate it.

  • :client_token (String)

    Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

    Constraint: Maximum 64 ASCII characters.

  • :subnet_id (required, String)

    The subnet in which to create the NAT gateway.

Returns:

See Also:

#create_network_acl(options = {}) ⇒ Types::CreateNetworkAclResult

Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC.

For more information about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To create a network ACL


# This example creates a network ACL for the specified VPC.

resp = client.create_network_acl({
  vpc_id: "vpc-a01106c2", 
})

# resp.to_h outputs the following:
{
  network_acl: {
    associations: [
    ], 
    entries: [
      {
        cidr_block: "0.0.0.0/0", 
        egress: true, 
        protocol: "-1", 
        rule_action: "deny", 
        rule_number: 32767, 
      }, 
      {
        cidr_block: "0.0.0.0/0", 
        egress: false, 
        protocol: "-1", 
        rule_action: "deny", 
        rule_number: 32767, 
      }, 
    ], 
    is_default: false, 
    network_acl_id: "acl-5fb85d36", 
    tags: [
    ], 
    vpc_id: "vpc-a01106c2", 
  }, 
}

Request syntax with placeholder values


resp = client.create_network_acl({
  dry_run: false,
  vpc_id: "String", # required
})

Response structure


resp.network_acl.associations #=> Array
resp.network_acl.associations[0].network_acl_association_id #=> String
resp.network_acl.associations[0].network_acl_id #=> String
resp.network_acl.associations[0].subnet_id #=> String
resp.network_acl.entries #=> Array
resp.network_acl.entries[0].cidr_block #=> String
resp.network_acl.entries[0].egress #=> true/false
resp.network_acl.entries[0].icmp_type_code.code #=> Integer
resp.network_acl.entries[0].icmp_type_code.type #=> Integer
resp.network_acl.entries[0].ipv_6_cidr_block #=> String
resp.network_acl.entries[0].port_range.from #=> Integer
resp.network_acl.entries[0].port_range.to #=> Integer
resp.network_acl.entries[0].protocol #=> String
resp.network_acl.entries[0].rule_action #=> String, one of "allow", "deny"
resp.network_acl.entries[0].rule_number #=> Integer
resp.network_acl.is_default #=> true/false
resp.network_acl.network_acl_id #=> String
resp.network_acl.tags #=> Array
resp.network_acl.tags[0].key #=> String
resp.network_acl.tags[0].value #=> String
resp.network_acl.vpc_id #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :vpc_id (required, String)

    The ID of the VPC.

Returns:

See Also:

#create_network_acl_entry(options = {}) ⇒ Struct

Creates an entry (a rule) in a network ACL with the specified rule number. Each network ACL has a set of numbered ingress rules and a separate set of numbered egress rules. When determining whether a packet should be allowed in or out of a subnet associated with the ACL, we process the entries in the ACL according to the rule numbers, in ascending order. Each network ACL has a set of ingress rules and a separate set of egress rules.

We recommend that you leave room between the rule numbers (for example, 100, 110, 120, ...), and not number them one right after the other (for example, 101, 102, 103, ...). This makes it easier to add a rule between existing ones without having to renumber the rules.

After you add an entry, you can't modify it; you must either replace it, or create an entry and delete the old one.

For more information about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To create a network ACL entry


# This example creates an entry for the specified network ACL. The rule allows ingress traffic from anywhere (0.0.0.0/0) on UDP port 53 (DNS) into any associated subnet.

resp = client.create_network_acl_entry({
  cidr_block: "0.0.0.0/0", 
  egress: false, 
  network_acl_id: "acl-5fb85d36", 
  port_range: {
    from: 53, 
    to: 53, 
  }, 
  protocol: "udp", 
  rule_action: "allow", 
  rule_number: 100, 
})

Request syntax with placeholder values


resp = client.create_network_acl_entry({
  cidr_block: "String",
  dry_run: false,
  egress: false, # required
  icmp_type_code: {
    code: 1,
    type: 1,
  },
  ipv_6_cidr_block: "String",
  network_acl_id: "String", # required
  port_range: {
    from: 1,
    to: 1,
  },
  protocol: "String", # required
  rule_action: "allow", # required, accepts allow, deny
  rule_number: 1, # required
})

Options Hash (options):

  • :cidr_block (String)

    The IPv4 network range to allow or deny, in CIDR notation (for example 172.16.0.0/24).

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :egress (required, Boolean)

    Indicates whether this is an egress rule (rule is applied to traffic leaving the subnet).

  • :icmp_type_code (Types::IcmpTypeCode)

    ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying the ICMP protocol, or protocol 58 (ICMPv6) with an IPv6 CIDR block.

  • :ipv_6_cidr_block (String)

    The IPv6 network range to allow or deny, in CIDR notation (for example 2001:db8:1234:1a00::/64).

  • :network_acl_id (required, String)

    The ID of the network ACL.

  • :port_range (Types::PortRange)

    TCP or UDP protocols: The range of ports the rule applies to.

  • :protocol (required, String)

    The protocol. A value of -1 or all means all protocols. If you specify all, -1, or a protocol number other than tcp, udp, or icmp, traffic on all ports is allowed, regardless of any ports or ICMP types or codes you specify. If you specify protocol 58 (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol 58 (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.

  • :rule_action (required, String)

    Indicates whether to allow or deny the traffic that matches the rule.

  • :rule_number (required, Integer)

    The rule number for the entry (for example, 100). ACL entries are processed in ascending order by rule number.

    Constraints: Positive integer from 1 to 32766. The range 32767 to 65535 is reserved for internal use.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_network_interface(options = {}) ⇒ Types::CreateNetworkInterfaceResult

Creates a network interface in the specified subnet.

For more information about network interfaces, see Elastic Network Interfaces in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To create a network interface


# This example creates a network interface for the specified subnet.

resp = client.create_network_interface({
  description: "my network interface", 
  groups: [
    "sg-903004f8", 
  ], 
  private_ip_address: "10.0.2.17", 
  subnet_id: "subnet-9d4a7b6c", 
})

# resp.to_h outputs the following:
{
  network_interface: {
    availability_zone: "us-east-1d", 
    description: "my network interface", 
    groups: [
      {
        group_id: "sg-903004f8", 
        group_name: "default", 
      }, 
    ], 
    mac_address: "02:1a:80:41:52:9c", 
    network_interface_id: "eni-e5aa89a3", 
    owner_id: "123456789012", 
    private_ip_address: "10.0.2.17", 
    private_ip_addresses: [
      {
        primary: true, 
        private_ip_address: "10.0.2.17", 
      }, 
    ], 
    requester_managed: false, 
    source_dest_check: true, 
    status: "pending", 
    subnet_id: "subnet-9d4a7b6c", 
    tag_set: [
    ], 
    vpc_id: "vpc-a01106c2", 
  }, 
}

Request syntax with placeholder values


resp = client.create_network_interface({
  description: "String",
  dry_run: false,
  groups: ["String"],
  ipv_6_address_count: 1,
  ipv_6_addresses: [
    {
      ipv_6_address: "String",
    },
  ],
  private_ip_address: "String",
  private_ip_addresses: [
    {
      primary: false,
      private_ip_address: "String", # required
    },
  ],
  secondary_private_ip_address_count: 1,
  subnet_id: "String", # required
})

Response structure


resp.network_interface.association.allocation_id #=> String
resp.network_interface.association.association_id #=> String
resp.network_interface.association.ip_owner_id #=> String
resp.network_interface.association.public_dns_name #=> String
resp.network_interface.association.public_ip #=> String
resp.network_interface.attachment.attach_time #=> Time
resp.network_interface.attachment.attachment_id #=> String
resp.network_interface.attachment.delete_on_termination #=> true/false
resp.network_interface.attachment.device_index #=> Integer
resp.network_interface.attachment.instance_id #=> String
resp.network_interface.attachment.instance_owner_id #=> String
resp.network_interface.attachment.status #=> String, one of "attaching", "attached", "detaching", "detached"
resp.network_interface.availability_zone #=> String
resp.network_interface.description #=> String
resp.network_interface.groups #=> Array
resp.network_interface.groups[0].group_name #=> String
resp.network_interface.groups[0].group_id #=> String
resp.network_interface.interface_type #=> String, one of "interface", "natGateway"
resp.network_interface.ipv_6_addresses #=> Array
resp.network_interface.ipv_6_addresses[0].ipv_6_address #=> String
resp.network_interface.mac_address #=> String
resp.network_interface.network_interface_id #=> String
resp.network_interface.owner_id #=> String
resp.network_interface.private_dns_name #=> String
resp.network_interface.private_ip_address #=> String
resp.network_interface.private_ip_addresses #=> Array
resp.network_interface.private_ip_addresses[0].association.allocation_id #=> String
resp.network_interface.private_ip_addresses[0].association.association_id #=> String
resp.network_interface.private_ip_addresses[0].association.ip_owner_id #=> String
resp.network_interface.private_ip_addresses[0].association.public_dns_name #=> String
resp.network_interface.private_ip_addresses[0].association.public_ip #=> String
resp.network_interface.private_ip_addresses[0].primary #=> true/false
resp.network_interface.private_ip_addresses[0].private_dns_name #=> String
resp.network_interface.private_ip_addresses[0].private_ip_address #=> String
resp.network_interface.requester_id #=> String
resp.network_interface.requester_managed #=> true/false
resp.network_interface.source_dest_check #=> true/false
resp.network_interface.status #=> String, one of "available", "attaching", "in-use", "detaching"
resp.network_interface.subnet_id #=> String
resp.network_interface.tag_set #=> Array
resp.network_interface.tag_set[0].key #=> String
resp.network_interface.tag_set[0].value #=> String
resp.network_interface.vpc_id #=> String

Options Hash (options):

  • :description (String)

    A description for the network interface.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :groups (Array<String>)

    The IDs of one or more security groups.

  • :ipv_6_address_count (Integer)

    The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can\'t use this option if specifying specific IPv6 addresses. If your subnet has the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 to override this setting.

  • :ipv_6_addresses (Array<Types::InstanceIpv6Address>)

    One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can\'t use this option if you\'re specifying a number of IPv6 addresses.

  • :private_ip_address (String)

    The primary private IPv4 address of the network interface. If you don\'t specify an IPv4 address, Amazon EC2 selects one for you from the subnet\'s IPv4 CIDR range. If you specify an IP address, you cannot indicate any IP addresses specified in privateIpAddresses as primary (only one IP address can be designated as primary).

  • :private_ip_addresses (Array<Types::PrivateIpAddressSpecification>)

    One or more private IPv4 addresses.

  • :secondary_private_ip_address_count (Integer)

    The number of secondary private IPv4 addresses to assign to a network interface. When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet\'s IPv4 CIDR range. You can\'t specify this option and specify more than one private IP address using privateIpAddresses.

    The number of IP addresses you can assign to a network interface varies by instance type. For more information, see IP Addresses Per ENI Per Instance Type in the Amazon Virtual Private Cloud User Guide.

  • :subnet_id (required, String)

    The ID of the subnet to associate with the network interface.

Returns:

See Also:

#create_network_interface_permission(options = {}) ⇒ Types::CreateNetworkInterfacePermissionResult

Grants an AWS authorized partner account permission to attach the specified network interface to an instance in their account.

You can grant permission to a single AWS account only, and only one account at a time.

Examples:

Request syntax with placeholder values


resp = client.create_network_interface_permission({
  network_interface_id: "String", # required
  aws_account_id: "String",
  aws_service: "String",
  permission: "INSTANCE-ATTACH", # required, accepts INSTANCE-ATTACH, EIP-ASSOCIATE
  dry_run: false,
})

Response structure


resp.interface_permission.network_interface_permission_id #=> String
resp.interface_permission.network_interface_id #=> String
resp.interface_permission. #=> String
resp.interface_permission.aws_service #=> String
resp.interface_permission.permission #=> String, one of "INSTANCE-ATTACH", "EIP-ASSOCIATE"
resp.interface_permission.permission_state.state #=> String, one of "pending", "granted", "revoking", "revoked"
resp.interface_permission.permission_state.status_message #=> String

Options Hash (options):

  • :network_interface_id (required, String)

    The ID of the network interface.

  • :aws_account_id (String)

    The AWS account ID.

  • :aws_service (String)

    The AWS service. Currently not supported.

  • :permission (required, String)

    The type of permission to grant.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#create_placement_group(options = {}) ⇒ Struct

Creates a placement group that you launch cluster instances into. Give the group a name that's unique within the scope of your account.

For more information about placement groups and cluster instances, see Cluster Instances in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To create a placement group


# This example creates a placement group with the specified name.

resp = client.create_placement_group({
  group_name: "my-cluster", 
  strategy: "cluster", 
})

# resp.to_h outputs the following:
{
}

Request syntax with placeholder values


resp = client.create_placement_group({
  dry_run: false,
  group_name: "String", # required
  strategy: "cluster", # required, accepts cluster
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :group_name (required, String)

    A name for the placement group.

    Constraints: Up to 255 ASCII characters

  • :strategy (required, String)

    The placement strategy.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_reserved_instances_listing(options = {}) ⇒ Types::CreateReservedInstancesListingResult

Creates a listing for Amazon EC2 Standard Reserved Instances to be sold in the Reserved Instance Marketplace. You can submit one Standard Reserved Instance listing at a time. To get a list of your Standard Reserved Instances, you can use the DescribeReservedInstances operation.

Only Standard Reserved Instances with a capacity reservation can be sold in the Reserved Instance Marketplace. Convertible Reserved Instances and Standard Reserved Instances with a regional benefit cannot be sold.

The Reserved Instance Marketplace matches sellers who want to resell Standard Reserved Instance capacity that they no longer need with buyers who want to purchase additional capacity. Reserved Instances bought and sold through the Reserved Instance Marketplace work like any other Reserved Instances.

To sell your Standard Reserved Instances, you must first register as a seller in the Reserved Instance Marketplace. After completing the registration process, you can create a Reserved Instance Marketplace listing of some or all of your Standard Reserved Instances, and specify the upfront price to receive for them. Your Standard Reserved Instance listings then become available for purchase. To view the details of your Standard Reserved Instance listing, you can use the DescribeReservedInstancesListings operation.

For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide.

Examples:

Request syntax with placeholder values


resp = client.create_reserved_instances_listing({
  client_token: "String", # required
  instance_count: 1, # required
  price_schedules: [ # required
    {
      currency_code: "USD", # accepts USD
      price: 1.0,
      term: 1,
    },
  ],
  reserved_instances_id: "String", # required
})

Response structure


resp.reserved_instances_listings #=> Array
resp.reserved_instances_listings[0].client_token #=> String
resp.reserved_instances_listings[0].create_date #=> Time
resp.reserved_instances_listings[0].instance_counts #=> Array
resp.reserved_instances_listings[0].instance_counts[0].instance_count #=> Integer
resp.reserved_instances_listings[0].instance_counts[0].state #=> String, one of "available", "sold", "cancelled", "pending"
resp.reserved_instances_listings[0].price_schedules #=> Array
resp.reserved_instances_listings[0].price_schedules[0].active #=> true/false
resp.reserved_instances_listings[0].price_schedules[0].currency_code #=> String, one of "USD"
resp.reserved_instances_listings[0].price_schedules[0].price #=> Float
resp.reserved_instances_listings[0].price_schedules[0].term #=> Integer
resp.reserved_instances_listings[0].reserved_instances_id #=> String
resp.reserved_instances_listings[0].reserved_instances_listing_id #=> String
resp.reserved_instances_listings[0].status #=> String, one of "active", "pending", "cancelled", "closed"
resp.reserved_instances_listings[0].status_message #=> String
resp.reserved_instances_listings[0].tags #=> Array
resp.reserved_instances_listings[0].tags[0].key #=> String
resp.reserved_instances_listings[0].tags[0].value #=> String
resp.reserved_instances_listings[0].update_date #=> Time

Options Hash (options):

  • :client_token (required, String)

    Unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.

  • :instance_count (required, Integer)

    The number of instances that are a part of a Reserved Instance account to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified in this call.

  • :price_schedules (required, Array<Types::PriceScheduleSpecification>)

    A list specifying the price of the Standard Reserved Instance for each month remaining in the Reserved Instance term.

  • :reserved_instances_id (required, String)

    The ID of the active Standard Reserved Instance.

Returns:

See Also:

#create_route(options = {}) ⇒ Types::CreateRouteResult

Creates a route in a route table within a VPC.

You must specify one of the following targets: Internet gateway or virtual private gateway, NAT instance, NAT gateway, VPC peering connection, network interface, or egress-only Internet gateway.

When determining how to route traffic, we use the route with the most specific match. For example, traffic is destined for the IPv4 address 192.0.2.3, and the route table includes the following two IPv4 routes:

  • 192.0.2.0/24 (goes to some target A)

  • 192.0.2.0/28 (goes to some target B)

Both routes apply to the traffic destined for 192.0.2.3. However, the second route in the list covers a smaller number of IP addresses and is therefore more specific, so we use that route to determine where to target the traffic.

For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To create a route


# This example creates a route for the specified route table. The route matches all traffic (0.0.0.0/0) and routes it to the specified Internet gateway.

resp = client.create_route({
  destination_cidr_block: "0.0.0.0/0", 
  gateway_id: "igw-c0a643a9", 
  route_table_id: "rtb-22574640", 
})

Request syntax with placeholder values


resp = client.create_route({
  destination_cidr_block: "String",
  destination_ipv_6_cidr_block: "String",
  dry_run: false,
  egress_only_internet_gateway_id: "String",
  gateway_id: "String",
  instance_id: "String",
  nat_gateway_id: "String",
  network_interface_id: "String",
  route_table_id: "String", # required
  vpc_peering_connection_id: "String",
})

Response structure


resp.return #=> true/false

Options Hash (options):

  • :destination_cidr_block (String)

    The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match.

  • :destination_ipv_6_cidr_block (String)

    The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :egress_only_internet_gateway_id (String)

    [IPv6 traffic only] The ID of an egress-only Internet gateway.

  • :gateway_id (String)

    The ID of an Internet gateway or virtual private gateway attached to your VPC.

  • :instance_id (String)

    The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.

  • :nat_gateway_id (String)

    [IPv4 traffic only] The ID of a NAT gateway.

  • :network_interface_id (String)

    The ID of a network interface.

  • :route_table_id (required, String)

    The ID of the route table for the route.

  • :vpc_peering_connection_id (String)

    The ID of a VPC peering connection.

Returns:

See Also:

#create_route_table(options = {}) ⇒ Types::CreateRouteTableResult

Creates a route table for the specified VPC. After you create a route table, you can add routes and associate the table with a subnet.

For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To create a route table


# This example creates a route table for the specified VPC.

resp = client.create_route_table({
  vpc_id: "vpc-a01106c2", 
})

# resp.to_h outputs the following:
{
  route_table: {
    associations: [
    ], 
    propagating_vgws: [
    ], 
    route_table_id: "rtb-22574640", 
    routes: [
      {
        destination_cidr_block: "10.0.0.0/16", 
        gateway_id: "local", 
        state: "active", 
      }, 
    ], 
    tags: [
    ], 
    vpc_id: "vpc-a01106c2", 
  }, 
}

Request syntax with placeholder values


resp = client.create_route_table({
  dry_run: false,
  vpc_id: "String", # required
})

Response structure


resp.route_table.associations #=> Array
resp.route_table.associations[0].main #=> true/false
resp.route_table.associations[0].route_table_association_id #=> String
resp.route_table.associations[0].route_table_id #=> String
resp.route_table.associations[0].subnet_id #=> String
resp.route_table.propagating_vgws #=> Array
resp.route_table.propagating_vgws[0].gateway_id #=> String
resp.route_table.route_table_id #=> String
resp.route_table.routes #=> Array
resp.route_table.routes[0].destination_cidr_block #=> String
resp.route_table.routes[0].destination_ipv_6_cidr_block #=> String
resp.route_table.routes[0].destination_prefix_list_id #=> String
resp.route_table.routes[0].egress_only_internet_gateway_id #=> String
resp.route_table.routes[0].gateway_id #=> String
resp.route_table.routes[0].instance_id #=> String
resp.route_table.routes[0].instance_owner_id #=> String
resp.route_table.routes[0].nat_gateway_id #=> String
resp.route_table.routes[0].network_interface_id #=> String
resp.route_table.routes[0].origin #=> String, one of "CreateRouteTable", "CreateRoute", "EnableVgwRoutePropagation"
resp.route_table.routes[0].state #=> String, one of "active", "blackhole"
resp.route_table.routes[0].vpc_peering_connection_id #=> String
resp.route_table.tags #=> Array
resp.route_table.tags[0].key #=> String
resp.route_table.tags[0].value #=> String
resp.route_table.vpc_id #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :vpc_id (required, String)

    The ID of the VPC.

Returns:

See Also:

#create_security_group(options = {}) ⇒ Types::CreateSecurityGroupResult

Creates a security group.

A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. For more information, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide.

EC2-Classic: You can have up to 500 security groups.

EC2-VPC: You can create up to 500 security groups per VPC.

When you create a security group, you specify a friendly name of your choice. You can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. However, you can't have two security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name.

You have a default security group for use in EC2-Classic and a default security group for use in your VPC. If you don't specify a security group when you launch an instance, the instance is launched into the appropriate default security group. A default security group includes a default rule that grants instances unrestricted network access to each other.

You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress.

Examples:

Request syntax with placeholder values


resp = client.create_security_group({
  description: "String", # required
  group_name: "String", # required
  vpc_id: "String",
  dry_run: false,
})

Response structure


resp.group_id #=> String

Options Hash (options):

  • :description (required, String)

    A description for the security group. This is informational only.

    Constraints: Up to 255 characters in length

    Constraints for EC2-Classic: ASCII characters

    Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

  • :group_name (required, String)

    The name of the security group.

    Constraints: Up to 255 characters in length

    Constraints for EC2-Classic: ASCII characters

    Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

  • :vpc_id (String)

    [EC2-VPC] The ID of the VPC. Required for EC2-VPC.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#create_snapshot(options = {}) ⇒ Types::Snapshot

Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make copies of EBS volumes, and to save data before shutting down an instance.

When a snapshot is created, any AWS Marketplace product codes that are associated with the source volume are propagated to the snapshot.

You can take a snapshot of an attached volume that is in use. However, snapshots only capture data that has been written to your EBS volume 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 volume long enough to take a snapshot, your snapshot should be complete. However, if you cannot pause all file writes to the volume, you should unmount the volume from within the instance, issue the snapshot command, and then remount the volume to ensure a consistent and complete snapshot. You may remount and use your volume while the snapshot status is pending.

To create a snapshot for EBS volumes that serve as root devices, you should stop the instance before taking the snapshot.

Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes and any associated snapshots always remain protected.

For more information, see Amazon Elastic Block Store and Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To create a snapshot


# This example creates a snapshot of the volume with a volume ID of ``vol-1234567890abcdef0`` and a short description to identify the snapshot.

resp = client.create_snapshot({
  description: "This is my root volume snapshot.", 
  volume_id: "vol-1234567890abcdef0", 
})

# resp.to_h outputs the following:
{
  description: "This is my root volume snapshot.", 
  owner_id: "012345678910", 
  snapshot_id: "snap-066877671789bd71b", 
  start_time: Time.parse("2014-02-28T21:06:01.000Z"), 
  state: "pending", 
  tags: [
  ], 
  volume_id: "vol-1234567890abcdef0", 
  volume_size: 8, 
}

Request syntax with placeholder values


resp = client.create_snapshot({
  description: "String",
  volume_id: "String", # required
  dry_run: false,
})

Response structure


resp.data_encryption_key_id #=> String
resp.description #=> String
resp.encrypted #=> true/false
resp.kms_key_id #=> String
resp.owner_id #=> String
resp.progress #=> String
resp.snapshot_id #=> String
resp.start_time #=> Time
resp.state #=> String, one of "pending", "completed", "error"
resp.state_message #=> String
resp.volume_id #=> String
resp.volume_size #=> Integer
resp.owner_alias #=> String
resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String

Options Hash (options):

  • :description (String)

    A description for the snapshot.

  • :volume_id (required, String)

    The ID of the EBS volume.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#create_spot_datafeed_subscription(options = {}) ⇒ Types::CreateSpotDatafeedSubscriptionResult

Creates a data feed for Spot instances, enabling you to view Spot instance usage logs. You can create one data feed per AWS account. For more information, see Spot Instance Data Feed in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To create a Spot Instance datafeed


# This example creates a Spot Instance data feed for your AWS account.

resp = client.create_spot_datafeed_subscription({
  bucket: "my-s3-bucket", 
  prefix: "spotdata", 
})

# resp.to_h outputs the following:
{
  spot_datafeed_subscription: {
    bucket: "my-s3-bucket", 
    owner_id: "123456789012", 
    prefix: "spotdata", 
    state: "Active", 
  }, 
}

Request syntax with placeholder values


resp = client.create_spot_datafeed_subscription({
  bucket: "String", # required
  dry_run: false,
  prefix: "String",
})

Response structure


resp.spot_datafeed_subscription.bucket #=> String
resp.spot_datafeed_subscription.fault.code #=> String
resp.spot_datafeed_subscription.fault.message #=> String
resp.spot_datafeed_subscription.owner_id #=> String
resp.spot_datafeed_subscription.prefix #=> String
resp.spot_datafeed_subscription.state #=> String, one of "Active", "Inactive"

Options Hash (options):

  • :bucket (required, String)

    The Amazon S3 bucket in which to store the Spot instance data feed.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :prefix (String)

    A prefix for the data feed file names.

Returns:

See Also:

#create_subnet(options = {}) ⇒ Types::CreateSubnetResult

Creates a subnet in an existing VPC.

When you create each subnet, you provide the VPC ID and the IPv4 CIDR block you want for the subnet. After you create a subnet, you can't change its CIDR block. The size of the subnet's IPv4 CIDR block can be the same as a VPC's IPv4 CIDR block, or a subset of a VPC's IPv4 CIDR block. If you create more than one subnet in a VPC, the subnets' CIDR blocks must not overlap. The smallest IPv4 subnet (and VPC) you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses).

If you've associated an IPv6 CIDR block with your VPC, you can create a subnet with an IPv6 CIDR block that uses a /64 prefix length.

AWS reserves both the first four and the last IPv4 address in each subnet's CIDR block. They're not available for use.

If you add more than one subnet to a VPC, they're set up in a star topology with a logical router in the middle.

If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP address doesn't change if you stop and restart the instance (unlike a similar instance launched outside a VPC, which gets a new IP address when restarted). It's therefore possible to have a subnet with no running instances (they're all stopped), but no remaining IP addresses available.

For more information about subnets, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To create a subnet


# This example creates a subnet in the specified VPC with the specified CIDR block. We recommend that you let us select an Availability Zone for you.

resp = client.create_subnet({
  cidr_block: "10.0.1.0/24", 
  vpc_id: "vpc-a01106c2", 
})

# resp.to_h outputs the following:
{
  subnet: {
    availability_zone: "us-west-2c", 
    available_ip_address_count: 251, 
    cidr_block: "10.0.1.0/24", 
    state: "pending", 
    subnet_id: "subnet-9d4a7b6c", 
    vpc_id: "vpc-a01106c2", 
  }, 
}

Request syntax with placeholder values


resp = client.create_subnet({
  availability_zone: "String",
  cidr_block: "String", # required
  ipv_6_cidr_block: "String",
  vpc_id: "String", # required
  dry_run: false,
})

Response structure


resp.subnet.availability_zone #=> String
resp.subnet.available_ip_address_count #=> Integer
resp.subnet.cidr_block #=> String
resp.subnet.default_for_az #=> true/false
resp.subnet.map_public_ip_on_launch #=> true/false
resp.subnet.state #=> String, one of "pending", "available"
resp.subnet.subnet_id #=> String
resp.subnet.vpc_id #=> String
resp.subnet.assign_ipv_6_address_on_creation #=> true/false
resp.subnet.ipv_6_cidr_block_association_set #=> Array
resp.subnet.ipv_6_cidr_block_association_set[0].association_id #=> String
resp.subnet.ipv_6_cidr_block_association_set[0].ipv_6_cidr_block #=> String
resp.subnet.ipv_6_cidr_block_association_set[0].ipv_6_cidr_block_state.state #=> String, one of "associating", "associated", "disassociating", "disassociated", "failing", "failed"
resp.subnet.ipv_6_cidr_block_association_set[0].ipv_6_cidr_block_state.status_message #=> String
resp.subnet.tags #=> Array
resp.subnet.tags[0].key #=> String
resp.subnet.tags[0].value #=> String

Options Hash (options):

  • :availability_zone (String)

    The Availability Zone for the subnet.

    Default: AWS selects one for you. If you create more than one subnet in your VPC, we may not necessarily select a different zone for each subnet.

  • :cidr_block (required, String)

    The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24.

  • :ipv_6_cidr_block (String)

    The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.

  • :vpc_id (required, String)

    The ID of the VPC.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#create_tags(options = {}) ⇒ Struct

Adds or overwrites one or more tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.

For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide. For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To add a tag to a resource


# This example adds the tag Stack=production to the specified image, or overwrites an existing tag for the AMI where the tag key is Stack.

resp = client.create_tags({
  resources: [
    "ami-78a54011", 
  ], 
  tags: [
    {
      key: "Stack", 
      value: "production", 
    }, 
  ], 
})

Request syntax with placeholder values


resp = client.create_tags({
  dry_run: false,
  resources: ["String"], # required
  tags: [ # required
    {
      key: "String",
      value: "String",
    },
  ],
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :resources (required, Array<String>)

    The IDs of one or more resources to tag. For example, ami-1a2b3c4d.

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

    One or more tags. The value parameter is required, but if you don\'t want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_volume(options = {}) ⇒ Types::Volume

Creates an EBS volume that can be attached to an instance in the same Availability Zone. The volume is created in the regional endpoint that you send the HTTP request to. For more information see Regions and Endpoints.

You can create a new empty volume or restore a volume from an EBS snapshot. Any AWS Marketplace product codes from the snapshot are propagated to the volume.

You can create encrypted volumes with the Encrypted parameter. Encrypted volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are also automatically encrypted. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

You can tag your volumes during creation. For more information, see Tagging Your Amazon EC2 Resources.

For more information, see Creating an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To create a new volume


# This example creates an 80 GiB General Purpose (SSD) volume in the Availability Zone ``us-east-1a``.

resp = client.create_volume({
  availability_zone: "us-east-1a", 
  size: 80, 
  volume_type: "gp2", 
})

# resp.to_h outputs the following:
{
  availability_zone: "us-east-1a", 
  create_time: Time.parse("2016-08-29T18:52:32.724Z"), 
  encrypted: false, 
  iops: 240, 
  size: 80, 
  snapshot_id: "", 
  state: "creating", 
  volume_id: "vol-6b60b7c7", 
  volume_type: "gp2", 
}

Example: To create a new Provisioned IOPS (SSD) volume from a snapshot


# This example creates a new Provisioned IOPS (SSD) volume with 1000 provisioned IOPS from a snapshot in the Availability Zone ``us-east-1a``.

resp = client.create_volume({
  availability_zone: "us-east-1a", 
  iops: 1000, 
  snapshot_id: "snap-066877671789bd71b", 
  volume_type: "io1", 
})

# resp.to_h outputs the following:
{
  attachments: [
  ], 
  availability_zone: "us-east-1a", 
  create_time: Time.parse("2016-08-29T18:52:32.724Z"), 
  iops: 1000, 
  size: 500, 
  snapshot_id: "snap-066877671789bd71b", 
  state: "creating", 
  tags: [
  ], 
  volume_id: "vol-1234567890abcdef0", 
  volume_type: "io1", 
}

Request syntax with placeholder values


resp = client.create_volume({
  availability_zone: "String", # required
  encrypted: false,
  iops: 1,
  kms_key_id: "String",
  size: 1,
  snapshot_id: "String",
  volume_type: "standard", # accepts standard, io1, gp2, sc1, st1
  dry_run: false,
  tag_specifications: [
    {
      resource_type: "customer-gateway", # accepts customer-gateway, dhcp-options, image, instance, internet-gateway, network-acl, network-interface, reserved-instances, route-table, snapshot, spot-instances-request, subnet, security-group, volume, vpc, vpn-connection, vpn-gateway
      tags: [
        {
          key: "String",
          value: "String",
        },
      ],
    },
  ],
})

Response structure


resp.attachments #=> Array
resp.attachments[0].attach_time #=> Time
resp.attachments[0].device #=> String
resp.attachments[0].instance_id #=> String
resp.attachments[0].state #=> String, one of "attaching", "attached", "detaching", "detached"
resp.attachments[0].volume_id #=> String
resp.attachments[0].delete_on_termination #=> true/false
resp.availability_zone #=> String
resp.create_time #=> Time
resp.encrypted #=> true/false
resp.kms_key_id #=> String
resp.size #=> Integer
resp.snapshot_id #=> String
resp.state #=> String, one of "creating", "available", "in-use", "deleting", "deleted", "error"
resp.volume_id #=> String
resp.iops #=> Integer
resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String
resp.volume_type #=> String, one of "standard", "io1", "gp2", "sc1", "st1"

Options Hash (options):

  • :availability_zone (required, String)

    The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

  • :encrypted (Boolean)

    Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. If your AMI uses encrypted volumes, you can only launch it on supported instance types. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

  • :iops (Integer)

    Only valid for Provisioned IOPS SSD volumes. The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 50 IOPS/GiB.

    Constraint: Range is 100 to 20000 for Provisioned IOPS SSD volumes

  • :kms_key_id (String)

    The full ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. The ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. If a KmsKeyId is specified, the Encrypted flag must also be set.

  • :size (Integer)

    The size of the volume, in GiBs.

    Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384 for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

    Default: If you\'re creating the volume from a snapshot and don\'t specify a volume size, the default is the snapshot size.

  • :snapshot_id (String)

    The snapshot from which to create the volume.

  • :volume_type (String)

    The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

    Default: standard

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :tag_specifications (Array<Types::TagSpecification>)

    The tags to apply to the volume during creation.

Returns:

See Also:

#create_vpc(options = {}) ⇒ Types::CreateVpcResult

Creates a VPC with the specified IPv4 CIDR block. The smallest VPC you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses). To help you decide how big to make your VPC, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide.

You can optionally request an Amazon-provided IPv6 CIDR block for the VPC. The IPv6 CIDR block uses a /56 prefix length, and is allocated from Amazon's pool of IPv6 addresses. You cannot choose the IPv6 range for your VPC.

By default, each instance you launch in the VPC has the default DHCP options, which includes only a default DNS server that we provide (AmazonProvidedDNS). For more information about DHCP options, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide.

You can specify the instance tenancy value for the VPC when you create it. You can't change this value for the VPC after you create it. For more information, see Dedicated Instances in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To create a VPC


# This example creates a VPC with the specified CIDR block.

resp = client.create_vpc({
  cidr_block: "10.0.0.0/16", 
})

# resp.to_h outputs the following:
{
  vpc: {
    cidr_block: "10.0.0.0/16", 
    dhcp_options_id: "dopt-7a8b9c2d", 
    instance_tenancy: "default", 
    state: "pending", 
    vpc_id: "vpc-a01106c2", 
  }, 
}

Request syntax with placeholder values


resp = client.create_vpc({
  cidr_block: "String", # required
  amazon_provided_ipv_6_cidr_block: false,
  dry_run: false,
  instance_tenancy: "default", # accepts default, dedicated, host
})

Response structure


resp.vpc.cidr_block #=> String
resp.vpc.dhcp_options_id #=> String
resp.vpc.state #=> String, one of "pending", "available"
resp.vpc.vpc_id #=> String
resp.vpc.instance_tenancy #=> String, one of "default", "dedicated", "host"
resp.vpc.ipv_6_cidr_block_association_set #=> Array
resp.vpc.ipv_6_cidr_block_association_set[0].association_id #=> String
resp.vpc.ipv_6_cidr_block_association_set[0].ipv_6_cidr_block #=> String
resp.vpc.ipv_6_cidr_block_association_set[0].ipv_6_cidr_block_state.state #=> String, one of "associating", "associated", "disassociating", "disassociated", "failing", "failed"
resp.vpc.ipv_6_cidr_block_association_set[0].ipv_6_cidr_block_state.status_message #=> String
resp.vpc.cidr_block_association_set #=> Array
resp.vpc.cidr_block_association_set[0].association_id #=> String
resp.vpc.cidr_block_association_set[0].cidr_block #=> String
resp.vpc.cidr_block_association_set[0].cidr_block_state.state #=> String, one of "associating", "associated", "disassociating", "disassociated", "failing", "failed"
resp.vpc.cidr_block_association_set[0].cidr_block_state.status_message #=> String
resp.vpc.is_default #=> true/false
resp.vpc.tags #=> Array
resp.vpc.tags[0].key #=> String
resp.vpc.tags[0].value #=> String

Options Hash (options):

  • :cidr_block (required, String)

    The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16.

  • :amazon_provided_ipv_6_cidr_block (Boolean)

    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :instance_tenancy (String)

    The tenancy options for instances launched into the VPC. For default, instances are launched with shared tenancy by default. You can launch instances with any tenancy into a shared tenancy VPC. For dedicated, instances are launched as dedicated tenancy instances by default. You can only launch instances with a tenancy of dedicated or host into a dedicated tenancy VPC.

    Important: The host value cannot be used with this parameter. Use the default or dedicated values only.

    Default: default

Returns:

See Also:

#create_vpc_endpoint(options = {}) ⇒ Types::CreateVpcEndpointResult

Creates a VPC endpoint for a specified AWS service. An endpoint enables you to create a private connection between your VPC and another AWS service in your account. You can specify an endpoint policy to attach to the endpoint that will control access to the service from your VPC. You can also specify the VPC route tables that use the endpoint.

Use DescribeVpcEndpointServices to get a list of supported AWS services.

Examples:

Request syntax with placeholder values


resp = client.create_vpc_endpoint({
  client_token: "String",
  dry_run: false,
  policy_document: "String",
  route_table_ids: ["String"],
  service_name: "String", # required
  vpc_id: "String", # required
})

Response structure


resp.client_token #=> String
resp.vpc_endpoint.creation_timestamp #=> Time
resp.vpc_endpoint.policy_document #=> String
resp.vpc_endpoint.route_table_ids #=> Array
resp.vpc_endpoint.route_table_ids[0] #=> String
resp.vpc_endpoint.service_name #=> String
resp.vpc_endpoint.state #=> String, one of "Pending", "Available", "Deleting", "Deleted"
resp.vpc_endpoint.vpc_endpoint_id #=> String
resp.vpc_endpoint.vpc_id #=> String

Options Hash (options):

  • :client_token (String)

    Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :policy_document (String)

    A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.

  • :route_table_ids (Array<String>)

    One or more route table IDs.

  • :service_name (required, String)

    The AWS service name, in the form com.amazonaws.region.service. To get a list of available services, use the DescribeVpcEndpointServices request.

  • :vpc_id (required, String)

    The ID of the VPC in which the endpoint will be used.

Returns:

See Also:

#create_vpc_peering_connection(options = {}) ⇒ Types::CreateVpcPeeringConnectionResult

Requests a VPC peering connection between two VPCs: a requester VPC that you own and a peer VPC with which to create the connection. The peer VPC can belong to another AWS account. The requester VPC and peer VPC cannot have overlapping CIDR blocks.

The owner of the peer VPC must accept the peering request to activate the peering connection. The VPC peering connection request expires after 7 days, after which it cannot be accepted or rejected.

If you try to create a VPC peering connection between VPCs that have overlapping CIDR blocks, the VPC peering connection status goes to failed.

Examples:

Request syntax with placeholder values


resp = client.create_vpc_peering_connection({
  dry_run: false,
  peer_owner_id: "String",
  peer_vpc_id: "String",
  vpc_id: "String",
})

Response structure


resp.vpc_peering_connection.accepter_vpc_info.cidr_block #=> String
resp.vpc_peering_connection.accepter_vpc_info.ipv_6_cidr_block_set #=> Array
resp.vpc_peering_connection.accepter_vpc_info.ipv_6_cidr_block_set[0].ipv_6_cidr_block #=> String
resp.vpc_peering_connection.accepter_vpc_info.cidr_block_set #=> Array
resp.vpc_peering_connection.accepter_vpc_info.cidr_block_set[0].cidr_block #=> String
resp.vpc_peering_connection.accepter_vpc_info.owner_id #=> String
resp.vpc_peering_connection.accepter_vpc_info.peering_options.allow_dns_resolution_from_remote_vpc #=> true/false
resp.vpc_peering_connection.accepter_vpc_info.peering_options.allow_egress_from_local_classic_link_to_remote_vpc #=> true/false
resp.vpc_peering_connection.accepter_vpc_info.peering_options.allow_egress_from_local_vpc_to_remote_classic_link #=> true/false
resp.vpc_peering_connection.accepter_vpc_info.vpc_id #=> String
resp.vpc_peering_connection.expiration_time #=> Time
resp.vpc_peering_connection.requester_vpc_info.cidr_block #=> String
resp.vpc_peering_connection.requester_vpc_info.ipv_6_cidr_block_set #=> Array
resp.vpc_peering_connection.requester_vpc_info.ipv_6_cidr_block_set[0].ipv_6_cidr_block #=> String
resp.vpc_peering_connection.requester_vpc_info.cidr_block_set #=> Array
resp.vpc_peering_connection.requester_vpc_info.cidr_block_set[0].cidr_block #=> String
resp.vpc_peering_connection.requester_vpc_info.owner_id #=> String
resp.vpc_peering_connection.requester_vpc_info.peering_options.allow_dns_resolution_from_remote_vpc #=> true/false
resp.vpc_peering_connection.requester_vpc_info.peering_options.allow_egress_from_local_classic_link_to_remote_vpc #=> true/false
resp.vpc_peering_connection.requester_vpc_info.peering_options.allow_egress_from_local_vpc_to_remote_classic_link #=> true/false
resp.vpc_peering_connection.requester_vpc_info.vpc_id #=> String
resp.vpc_peering_connection.status.code #=> String, one of "initiating-request", "pending-acceptance", "active", "deleted", "rejected", "failed", "expired", "provisioning", "deleting"
resp.vpc_peering_connection.status.message #=> String
resp.vpc_peering_connection.tags #=> Array
resp.vpc_peering_connection.tags[0].key #=> String
resp.vpc_peering_connection.tags[0].value #=> String
resp.vpc_peering_connection.vpc_peering_connection_id #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :peer_owner_id (String)

    The AWS account ID of the owner of the peer VPC.

    Default: Your AWS account ID

  • :peer_vpc_id (String)

    The ID of the VPC with which you are creating the VPC peering connection.

  • :vpc_id (String)

    The ID of the requester VPC.

Returns:

See Also:

#create_vpn_connection(options = {}) ⇒ Types::CreateVpnConnectionResult

Creates a VPN connection between an existing virtual private gateway and a VPN customer gateway. The only supported connection type is ipsec.1.

The response includes information that you need to give to your network administrator to configure your customer gateway.

We strongly recommend that you use HTTPS when calling this operation because the response contains sensitive cryptographic information for configuring your customer gateway.

If you decide to shut down your VPN connection for any reason and later create a new VPN connection, you must reconfigure your customer gateway with the new information returned from this call.

This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.

For more information, see AWS Managed VPN Connections in the Amazon Virtual Private Cloud User Guide.

Examples:

Request syntax with placeholder values


resp = client.create_vpn_connection({
  customer_gateway_id: "String", # required
  type: "String", # required
  vpn_gateway_id: "String", # required
  dry_run: false,
  options: {
    static_routes_only: false,
    tunnel_options: [
      {
        tunnel_inside_cidr: "String",
        pre_shared_key: "String",
      },
    ],
  },
})

Response structure


resp.vpn_connection.customer_gateway_configuration #=> String
resp.vpn_connection.customer_gateway_id #=> String
resp.vpn_connection.category #=> String
resp.vpn_connection.state #=> String, one of "pending", "available", "deleting", "deleted"
resp.vpn_connection.type #=> String, one of "ipsec.1"
resp.vpn_connection.vpn_connection_id #=> String
resp.vpn_connection.vpn_gateway_id #=> String
resp.vpn_connection.options.static_routes_only #=> true/false
resp.vpn_connection.routes #=> Array
resp.vpn_connection.routes[0].destination_cidr_block #=> String
resp.vpn_connection.routes[0].source #=> String, one of "Static"
resp.vpn_connection.routes[0].state #=> String, one of "pending", "available", "deleting", "deleted"
resp.vpn_connection.tags #=> Array
resp.vpn_connection.tags[0].key #=> String
resp.vpn_connection.tags[0].value #=> String
resp.vpn_connection.vgw_telemetry #=> Array
resp.vpn_connection.vgw_telemetry[0].accepted_route_count #=> Integer
resp.vpn_connection.vgw_telemetry[0].last_status_change #=> Time
resp.vpn_connection.vgw_telemetry[0].outside_ip_address #=> String
resp.vpn_connection.vgw_telemetry[0].status #=> String, one of "UP", "DOWN"
resp.vpn_connection.vgw_telemetry[0].status_message #=> String

Options Hash (options):

  • :customer_gateway_id (required, String)

    The ID of the customer gateway.

  • :type (required, String)

    The type of VPN connection (ipsec.1).

  • :vpn_gateway_id (required, String)

    The ID of the virtual private gateway.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :options (Types::VpnConnectionOptionsSpecification)

    The options for the VPN connection.

Returns:

See Also:

#create_vpn_connection_route(options = {}) ⇒ Struct

Creates a static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway.

For more information about VPN connections, see AWS Managed VPN Connections in the Amazon Virtual Private Cloud User Guide.

Examples:

Request syntax with placeholder values


resp = client.create_vpn_connection_route({
  destination_cidr_block: "String", # required
  vpn_connection_id: "String", # required
})

Options Hash (options):

  • :destination_cidr_block (required, String)

    The CIDR block associated with the local subnet of the customer network.

  • :vpn_connection_id (required, String)

    The ID of the VPN connection.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_vpn_gateway(options = {}) ⇒ Types::CreateVpnGatewayResult

Creates a virtual private gateway. A virtual private gateway is the endpoint on the VPC side of your VPN connection. You can create a virtual private gateway before creating the VPC itself.

For more information about virtual private gateways, see AWS Managed VPN Connections in the Amazon Virtual Private Cloud User Guide.

Examples:

Request syntax with placeholder values


resp = client.create_vpn_gateway({
  availability_zone: "String",
  type: "ipsec.1", # required, accepts ipsec.1
  amazon_side_asn: 1,
  dry_run: false,
})

Response structure


resp.vpn_gateway.availability_zone #=> String
resp.vpn_gateway.state #=> String, one of "pending", "available", "deleting", "deleted"
resp.vpn_gateway.type #=> String, one of "ipsec.1"
resp.vpn_gateway.vpc_attachments #=> Array
resp.vpn_gateway.vpc_attachments[0].state #=> String, one of "attaching", "attached", "detaching", "detached"
resp.vpn_gateway.vpc_attachments[0].vpc_id #=> String
resp.vpn_gateway.vpn_gateway_id #=> String
resp.vpn_gateway.amazon_side_asn #=> Integer
resp.vpn_gateway.tags #=> Array
resp.vpn_gateway.tags[0].key #=> String
resp.vpn_gateway.tags[0].value #=> String

Options Hash (options):

  • :availability_zone (String)

    The Availability Zone for the virtual private gateway.

  • :type (required, String)

    The type of VPN connection this virtual private gateway supports.

  • :amazon_side_asn (Integer)

    A private Autonomous System Number (ASN) for the Amazon side of a BGP session. If you\'re using a 16-bit ASN, it must be in the 64512 to 65534 range. If you\'re using a 32-bit ASN, it must be in the 4200000000 to 4294967294 range.

    Default: 64512

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#delete_customer_gateway(options = {}) ⇒ Struct

Deletes the specified customer gateway. You must delete the VPN connection before you can delete the customer gateway.

Examples:

Example: To delete a customer gateway


# This example deletes the specified customer gateway.

resp = client.delete_customer_gateway({
  customer_gateway_id: "cgw-0e11f167", 
})

Request syntax with placeholder values


resp = client.delete_customer_gateway({
  customer_gateway_id: "String", # required
  dry_run: false,
})

Options Hash (options):

  • :customer_gateway_id (required, String)

    The ID of the customer gateway.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_dhcp_options(options = {}) ⇒ Struct

Deletes the specified set of DHCP options. You must disassociate the set of DHCP options before you can delete it. You can disassociate the set of DHCP options by associating either a new set of options or the default set of options with the VPC.

Examples:

Example: To delete a DHCP options set


# This example deletes the specified DHCP options set.

resp = client.delete_dhcp_options({
  dhcp_options_id: "dopt-d9070ebb", 
})

Request syntax with placeholder values


resp = client.delete_dhcp_options({
  dhcp_options_id: "String", # required
  dry_run: false,
})

Options Hash (options):

  • :dhcp_options_id (required, String)

    The ID of the DHCP options set.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_egress_only_internet_gateway(options = {}) ⇒ Types::DeleteEgressOnlyInternetGatewayResult

Deletes an egress-only Internet gateway.

Examples:

Request syntax with placeholder values


resp = client.delete_egress_only_internet_gateway({
  dry_run: false,
  egress_only_internet_gateway_id: "EgressOnlyInternetGatewayId", # required
})

Response structure


resp.return_code #=> true/false

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :egress_only_internet_gateway_id (required, String)

    The ID of the egress-only Internet gateway.

Returns:

See Also:

#delete_flow_logs(options = {}) ⇒ Types::DeleteFlowLogsResult

Deletes one or more flow logs.

Examples:

Request syntax with placeholder values


resp = client.delete_flow_logs({
  flow_log_ids: ["String"], # required
})

Response structure


resp.unsuccessful #=> Array
resp.unsuccessful[0].error.code #=> String
resp.unsuccessful[0].error.message #=> String
resp.unsuccessful[0].resource_id #=> String

Options Hash (options):

  • :flow_log_ids (required, Array<String>)

    One or more flow log IDs.

Returns:

See Also:

#delete_fpga_image(options = {}) ⇒ Types::DeleteFpgaImageResult

Deletes the specified Amazon FPGA Image (AFI).

Examples:

Request syntax with placeholder values


resp = client.delete_fpga_image({
  dry_run: false,
  fpga_image_id: "String", # required
})

Response structure


resp.return #=> true/false

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :fpga_image_id (required, String)

    The ID of the AFI.

Returns:

See Also:

#delete_internet_gateway(options = {}) ⇒ Struct

Deletes the specified Internet gateway. You must detach the Internet gateway from the VPC before you can delete it.

Examples:

Example: To delete an Internet gateway


# This example deletes the specified Internet gateway.

resp = client.delete_internet_gateway({
  internet_gateway_id: "igw-c0a643a9", 
})

Request syntax with placeholder values


resp = client.delete_internet_gateway({
  dry_run: false,
  internet_gateway_id: "String", # required
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :internet_gateway_id (required, String)

    The ID of the Internet gateway.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_key_pair(options = {}) ⇒ Struct

Deletes the specified key pair, by removing the public key from Amazon EC2.

Examples:

Example: To delete a key pair


# This example deletes the specified key pair.

resp = client.delete_key_pair({
  key_name: "my-key-pair", 
})

Request syntax with placeholder values


resp = client.delete_key_pair({
  key_name: "String", # required
  dry_run: false,
})

Options Hash (options):

  • :key_name (required, String)

    The name of the key pair.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_nat_gateway(options = {}) ⇒ Types::DeleteNatGatewayResult

Deletes the specified NAT gateway. Deleting a NAT gateway disassociates its Elastic IP address, but does not release the address from your account. Deleting a NAT gateway does not delete any NAT gateway routes in your route tables.

Examples:

Example: To delete a NAT gateway


# This example deletes the specified NAT gateway.

resp = client.delete_nat_gateway({
  nat_gateway_id: "nat-04ae55e711cec5680", 
})

# resp.to_h outputs the following:
{
  nat_gateway_id: "nat-04ae55e711cec5680", 
}

Request syntax with placeholder values


resp = client.delete_nat_gateway({
  nat_gateway_id: "String", # required
})

Response structure


resp.nat_gateway_id #=> String

Options Hash (options):

  • :nat_gateway_id (required, String)

    The ID of the NAT gateway.

Returns:

See Also:

#delete_network_acl(options = {}) ⇒ Struct

Deletes the specified network ACL. You can't delete the ACL if it's associated with any subnets. You can't delete the default network ACL.

Examples:

Example: To delete a network ACL


# This example deletes the specified network ACL.

resp = client.delete_network_acl({
  network_acl_id: "acl-5fb85d36", 
})

Request syntax with placeholder values


resp = client.delete_network_acl({
  dry_run: false,
  network_acl_id: "String", # required
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :network_acl_id (required, String)

    The ID of the network ACL.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_network_acl_entry(options = {}) ⇒ Struct

Deletes the specified ingress or egress entry (rule) from the specified network ACL.

Examples:

Example: To delete a network ACL entry


# This example deletes ingress rule number 100 from the specified network ACL.

resp = client.delete_network_acl_entry({
  egress: true, 
  network_acl_id: "acl-5fb85d36", 
  rule_number: 100, 
})

Request syntax with placeholder values


resp = client.delete_network_acl_entry({
  dry_run: false,
  egress: false, # required
  network_acl_id: "String", # required
  rule_number: 1, # required
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :egress (required, Boolean)

    Indicates whether the rule is an egress rule.

  • :network_acl_id (required, String)

    The ID of the network ACL.

  • :rule_number (required, Integer)

    The rule number of the entry to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_network_interface(options = {}) ⇒ Struct

Deletes the specified network interface. You must detach the network interface before you can delete it.

Examples:

Example: To delete a network interface


# This example deletes the specified network interface.

resp = client.delete_network_interface({
  network_interface_id: "eni-e5aa89a3", 
})

Request syntax with placeholder values


resp = client.delete_network_interface({
  dry_run: false,
  network_interface_id: "String", # required
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :network_interface_id (required, String)

    The ID of the network interface.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_network_interface_permission(options = {}) ⇒ Types::DeleteNetworkInterfacePermissionResult

Deletes a permission for a network interface. By default, you cannot delete the permission if the account for which you're removing the permission has attached the network interface to an instance. However, you can force delete the permission, regardless of any attachment.

Examples:

Request syntax with placeholder values


resp = client.delete_network_interface_permission({
  network_interface_permission_id: "String", # required
  force: false,
  dry_run: false,
})

Response structure


resp.return #=> true/false

Options Hash (options):

  • :network_interface_permission_id (required, String)

    The ID of the network interface permission.

  • :force (Boolean)

    Specify true to remove the permission even if the network interface is attached to an instance.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#delete_placement_group(options = {}) ⇒ Struct

Deletes the specified placement group. You must terminate all instances in the placement group before you can delete the placement group. For more information about placement groups and cluster instances, see Cluster Instances in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To delete a placement group


# This example deletes the specified placement group.

resp = client.delete_placement_group({
  group_name: "my-cluster", 
})

# resp.to_h outputs the following:
{
}

Request syntax with placeholder values


resp = client.delete_placement_group({
  dry_run: false,
  group_name: "String", # required
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :group_name (required, String)

    The name of the placement group.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_route(options = {}) ⇒ Struct

Deletes the specified route from the specified route table.

Examples:

Example: To delete a route


# This example deletes the specified route from the specified route table.

resp = client.delete_route({
  destination_cidr_block: "0.0.0.0/0", 
  route_table_id: "rtb-22574640", 
})

Request syntax with placeholder values


resp = client.delete_route({
  destination_cidr_block: "String",
  destination_ipv_6_cidr_block: "String",
  dry_run: false,
  route_table_id: "String", # required
})

Options Hash (options):

  • :destination_cidr_block (String)

    The IPv4 CIDR range for the route. The value you specify must match the CIDR for the route exactly.

  • :destination_ipv_6_cidr_block (String)

    The IPv6 CIDR range for the route. The value you specify must match the CIDR for the route exactly.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :route_table_id (required, String)

    The ID of the route table.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_route_table(options = {}) ⇒ Struct

Deletes the specified route table. You must disassociate the route table from any subnets before you can delete it. You can't delete the main route table.

Examples:

Example: To delete a route table


# This example deletes the specified route table.

resp = client.delete_route_table({
  route_table_id: "rtb-22574640", 
})

Request syntax with placeholder values


resp = client.delete_route_table({
  dry_run: false,
  route_table_id: "String", # required
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :route_table_id (required, String)

    The ID of the route table.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_security_group(options = {}) ⇒ Struct

Deletes a security group.

If you attempt to delete a security group that is associated with an instance, or is referenced by another security group, the operation fails with InvalidGroup.InUse in EC2-Classic or DependencyViolation in EC2-VPC.

Examples:

Request syntax with placeholder values


resp = client.delete_security_group({
  group_id: "String",
  group_name: "String",
  dry_run: false,
})

Options Hash (options):

  • :group_id (String)

    The ID of the security group. Required for a nondefault VPC.

  • :group_name (String)

    [EC2-Classic, default VPC] The name of the security group. You can specify either the security group name or the security group ID.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_snapshot(options = {}) ⇒ Struct

Deletes the specified snapshot.

When you make periodic snapshots of a volume, 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 volume.

You cannot delete a snapshot of the root device of an EBS volume used by a registered AMI. You must first de-register the AMI before you can delete the snapshot.

For more information, see Deleting an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To delete a snapshot


# This example deletes a snapshot with the snapshot ID of ``snap-1234567890abcdef0``. If the command succeeds, no output is returned.

resp = client.delete_snapshot({
  snapshot_id: "snap-1234567890abcdef0", 
})

# resp.to_h outputs the following:
{
}

Request syntax with placeholder values


resp = client.delete_snapshot({
  snapshot_id: "String", # required
  dry_run: false,
})

Options Hash (options):

  • :snapshot_id (required, String)

    The ID of the EBS snapshot.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_spot_datafeed_subscription(options = {}) ⇒ Struct

Deletes the data feed for Spot instances.

Examples:

Example: To cancel a Spot Instance data feed subscription


# This example deletes a Spot data feed subscription for the account.

resp = client.delete_spot_datafeed_subscription({
})

Request syntax with placeholder values


resp = client.delete_spot_datafeed_subscription({
  dry_run: false,
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_subnet(options = {}) ⇒ Struct

Deletes the specified subnet. You must terminate all running instances in the subnet before you can delete the subnet.

Examples:

Example: To delete a subnet


# This example deletes the specified subnet.

resp = client.delete_subnet({
  subnet_id: "subnet-9d4a7b6c", 
})

Request syntax with placeholder values


resp = client.delete_subnet({
  subnet_id: "String", # required
  dry_run: false,
})

Options Hash (options):

  • :subnet_id (required, String)

    The ID of the subnet.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_tags(options = {}) ⇒ Struct

Deletes the specified set of tags from the specified set of resources.

To list the current tags, use DescribeTags. For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To delete a tag from a resource


# This example deletes the tag Stack=test from the specified image.

resp = client.delete_tags({
  resources: [
    "ami-78a54011", 
  ], 
  tags: [
    {
      key: "Stack", 
      value: "test", 
    }, 
  ], 
})

Request syntax with placeholder values


resp = client.delete_tags({
  dry_run: false,
  resources: ["String"], # required
  tags: [
    {
      key: "String",
      value: "String",
    },
  ],
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :resources (required, Array<String>)

    The IDs of one or more resources.

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

    One or more tags to delete. If you omit this parameter, we delete all tags for the specified resources. Specify a tag key and an optional tag value to delete specific tags. If you specify a tag key without a tag value, we delete any tag with this key regardless of its value. If you specify a tag key with an empty string as the tag value, we delete the tag only if its value is an empty string.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_volume(options = {}) ⇒ Struct

Deletes the specified EBS volume. The volume must be in the available state (not attached to an instance).

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

For more information, see Deleting an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To delete a volume


# This example deletes an available volume with the volume ID of ``vol-049df61146c4d7901``. If the command succeeds, no output is returned.

resp = client.delete_volume({
  volume_id: "vol-049df61146c4d7901", 
})

# resp.to_h outputs the following:
{
}

Request syntax with placeholder values


resp = client.delete_volume({
  volume_id: "String", # required
  dry_run: false,
})

Options Hash (options):

  • :volume_id (required, String)

    The ID of the volume.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_vpc(options = {}) ⇒ Struct

Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on.

Examples:

Example: To delete a VPC


# This example deletes the specified VPC.

resp = client.delete_vpc({
  vpc_id: "vpc-a01106c2", 
})

Request syntax with placeholder values


resp = client.delete_vpc({
  vpc_id: "String", # required
  dry_run: false,
})

Options Hash (options):

  • :vpc_id (required, String)

    The ID of the VPC.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_vpc_endpoints(options = {}) ⇒ Types::DeleteVpcEndpointsResult

Deletes one or more specified VPC endpoints. Deleting the endpoint also deletes the endpoint routes in the route tables that were associated with the endpoint.

Examples:

Request syntax with placeholder values


resp = client.delete_vpc_endpoints({
  dry_run: false,
  vpc_endpoint_ids: ["String"], # required
})

Response structure


resp.unsuccessful #=> Array
resp.unsuccessful[0].error.code #=> String
resp.unsuccessful[0].error.message #=> String
resp.unsuccessful[0].resource_id #=> String

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :vpc_endpoint_ids (required, Array<String>)

    One or more endpoint IDs.

Returns:

See Also:

#delete_vpc_peering_connection(options = {}) ⇒ Types::DeleteVpcPeeringConnectionResult

Deletes a VPC peering connection. Either the owner of the requester VPC or the owner of the peer VPC can delete the VPC peering connection if it's in the active state. The owner of the requester VPC can delete a VPC peering connection in the pending-acceptance state.

Examples:

Request syntax with placeholder values


resp = client.delete_vpc_peering_connection({
  dry_run: false,
  vpc_peering_connection_id: "String", # required
})

Response structure


resp.return #=> true/false

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :vpc_peering_connection_id (required, String)

    The ID of the VPC peering connection.

Returns:

See Also:

#delete_vpn_connection(options = {}) ⇒ Struct

Deletes the specified VPN connection.

If you're deleting the VPC and its associated components, we recommend that you detach the virtual private gateway from the VPC and delete the VPC before deleting the VPN connection. If you believe that the tunnel credentials for your VPN connection have been compromised, you can delete the VPN connection and create a new one that has new keys, without needing to delete the VPC or virtual private gateway. If you create a new VPN connection, you must reconfigure the customer gateway using the new configuration information returned with the new VPN connection ID.

Examples:

Request syntax with placeholder values


resp = client.delete_vpn_connection({
  vpn_connection_id: "String", # required
  dry_run: false,
})

Options Hash (options):

  • :vpn_connection_id (required, String)

    The ID of the VPN connection.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_vpn_connection_route(options = {}) ⇒ Struct

Deletes the specified static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway.

Examples:

Request syntax with placeholder values


resp = client.delete_vpn_connection_route({
  destination_cidr_block: "String", # required
  vpn_connection_id: "String", # required
})

Options Hash (options):

  • :destination_cidr_block (required, String)

    The CIDR block associated with the local subnet of the customer network.

  • :vpn_connection_id (required, String)

    The ID of the VPN connection.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_vpn_gateway(options = {}) ⇒ Struct

Deletes the specified virtual private gateway. We recommend that before you delete a virtual private gateway, you detach it from the VPC and delete the VPN connection. Note that you don't need to delete the virtual private gateway if you plan to delete and recreate the VPN connection between your VPC and your network.

Examples:

Request syntax with placeholder values


resp = client.delete_vpn_gateway({
  vpn_gateway_id: "String", # required
  dry_run: false,
})

Options Hash (options):

  • :vpn_gateway_id (required, String)

    The ID of the virtual private gateway.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#deregister_image(options = {}) ⇒ Struct

Deregisters the specified AMI. After you deregister an AMI, it can't be used to launch new instances; however, it doesn't affect any instances that you've already launched from the AMI. You'll continue to incur usage costs for those instances until you terminate them.

When you deregister an Amazon EBS-backed AMI, it doesn't affect the snapshot that was created for the root volume of the instance during the AMI creation process. When you deregister an instance store-backed AMI, it doesn't affect the files that you uploaded to Amazon S3 when you created the AMI.

Examples:

Request syntax with placeholder values


resp = client.deregister_image({
  image_id: "String", # required
  dry_run: false,
})

Options Hash (options):

  • :image_id (required, String)

    The ID of the AMI.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#describe_account_attributes(options = {}) ⇒ Types::DescribeAccountAttributesResult

Describes attributes of your AWS account. The following are the supported account attributes:

  • supported-platforms: Indicates whether your account can launch instances into EC2-Classic and EC2-VPC, or only into EC2-VPC.

  • default-vpc: The ID of the default VPC for your account, or none.

  • max-instances: The maximum number of On-Demand instances that you can run.

  • vpc-max-security-groups-per-interface: The maximum number of security groups that you can assign to a network interface.

  • max-elastic-ips: The maximum number of Elastic IP addresses that you can allocate for use with EC2-Classic.

  • vpc-max-elastic-ips: The maximum number of Elastic IP addresses that you can allocate for use with EC2-VPC.

Examples:

Example: To describe a single attribute for your AWS account


# This example describes the supported-platforms attribute for your AWS account.

resp = client.({
  attribute_names: [
    "supported-platforms", 
  ], 
})

# resp.to_h outputs the following:
{
  account_attributes: [
    {
      attribute_name: "supported-platforms", 
      attribute_values: [
        {
          attribute_value: "EC2", 
        }, 
        {
          attribute_value: "VPC", 
        }, 
      ], 
    }, 
  ], 
}

Example: To describe all attributes for your AWS account


# This example describes the attributes for your AWS account.

resp = client.({
})

# resp.to_h outputs the following:
{
  account_attributes: [
    {
      attribute_name: "supported-platforms", 
      attribute_values: [
        {
          attribute_value: "EC2", 
        }, 
        {
          attribute_value: "VPC", 
        }, 
      ], 
    }, 
    {
      attribute_name: "vpc-max-security-groups-per-interface", 
      attribute_values: [
        {
          attribute_value: "5", 
        }, 
      ], 
    }, 
    {
      attribute_name: "max-elastic-ips", 
      attribute_values: [
        {
          attribute_value: "5", 
        }, 
      ], 
    }, 
    {
      attribute_name: "max-instances", 
      attribute_values: [
        {
          attribute_value: "20", 
        }, 
      ], 
    }, 
    {
      attribute_name: "vpc-max-elastic-ips", 
      attribute_values: [
        {
          attribute_value: "5", 
        }, 
      ], 
    }, 
    {
      attribute_name: "default-vpc", 
      attribute_values: [
        {
          attribute_value: "none", 
        }, 
      ], 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.({
  attribute_names: ["supported-platforms"], # accepts supported-platforms, default-vpc
  dry_run: false,
})

Response structure


resp. #=> Array
resp.[0].attribute_name #=> String
resp.[0].attribute_values #=> Array
resp.[0].attribute_values[0].attribute_value #=> String

Options Hash (options):

  • :attribute_names (Array<String>)

    One or more account attribute names.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#describe_addresses(options = {}) ⇒ Types::DescribeAddressesResult

Describes one or more of your Elastic IP addresses.

An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To describe your Elastic IP addresses


# This example describes your Elastic IP addresses.

resp = client.describe_addresses({
})

# resp.to_h outputs the following:
{
  addresses: [
    {
      domain: "standard", 
      instance_id: "i-1234567890abcdef0", 
      public_ip: "198.51.100.0", 
    }, 
    {
      allocation_id: "eipalloc-12345678", 
      association_id: "eipassoc-12345678", 
      domain: "vpc", 
      instance_id: "i-1234567890abcdef0", 
      network_interface_id: "eni-12345678", 
      network_interface_owner_id: "123456789012", 
      private_ip_address: "10.0.1.241", 
      public_ip: "203.0.113.0", 
    }, 
  ], 
}

Example: To describe your Elastic IP addresses for EC2-VPC


# This example describes your Elastic IP addresses for use with instances in a VPC.

resp = client.describe_addresses({
  filters: [
    {
      name: "domain", 
      values: [
        "vpc", 
      ], 
    }, 
  ], 
})

# resp.to_h outputs the following:
{
  addresses: [
    {
      allocation_id: "eipalloc-12345678", 
      association_id: "eipassoc-12345678", 
      domain: "vpc", 
      instance_id: "i-1234567890abcdef0", 
      network_interface_id: "eni-12345678", 
      network_interface_owner_id: "123456789012", 
      private_ip_address: "10.0.1.241", 
      public_ip: "203.0.113.0", 
    }, 
  ], 
}

Example: To describe your Elastic IP addresses for EC2-Classic


# This example describes your Elastic IP addresses for use with instances in EC2-Classic.

resp = client.describe_addresses({
  filters: [
    {
      name: "domain", 
      values: [
        "standard", 
      ], 
    }, 
  ], 
})

# resp.to_h outputs the following:
{
  addresses: [
    {
      domain: "standard", 
      instance_id: "i-1234567890abcdef0", 
      public_ip: "198.51.100.0", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.describe_addresses({
  filters: [
    {
      name: "String",
      values: ["String"],
    },
  ],
  public_ips: ["String"],
  allocation_ids: ["String"],
  dry_run: false,
})

Response structure


resp.addresses #=> Array
resp.addresses[0].instance_id #=> String
resp.addresses[0].public_ip #=> String
resp.addresses[0].allocation_id #=> String
resp.addresses[0].association_id #=> String
resp.addresses[0].domain #=> String, one of "vpc", "standard"
resp.addresses[0].network_interface_id #=> String
resp.addresses[0].network_interface_owner_id #=> String
resp.addresses[0].private_ip_address #=> String

Options Hash (options):

  • :filters (Array<Types::Filter>)

    One or more filters. Filter names and values are case-sensitive.

    • allocation-id - [EC2-VPC] The allocation ID for the address.

    • association-id - [EC2-VPC] The association ID for the address.

    • domain - Indicates whether the address is for use in EC2-Classic (standard) or in a VPC (vpc).

    • instance-id - The ID of the instance the address is associated with, if any.

    • network-interface-id - [EC2-VPC] The ID of the network interface that the address is associated with, if any.

    • network-interface-owner-id - The AWS account ID of the owner.

    • private-ip-address - [EC2-VPC] The private IP address associated with the Elastic IP address.

    • public-ip - The Elastic IP address.

  • :public_ips (Array<String>)

    [EC2-Classic] One or more Elastic IP addresses.

    Default: Describes all your Elastic IP addresses.

  • :allocation_ids (Array<String>)

    [EC2-VPC] One or more allocation IDs.

    Default: Describes all your Elastic IP addresses.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#describe_availability_zones(options = {}) ⇒ Types::DescribeAvailabilityZonesResult

Describes one or more of the Availability Zones that are available to you. The results include zones only for the region you're currently using. If there is an event impacting an Availability Zone, you can use this request to view the state and any provided message for that Availability Zone.

For more information, see Regions and Availability Zones in the Amazon Elastic Compute Cloud User Guide.

Examples:

Example: To describe your Availability Zones


# This example describes the Availability Zones that are available to you. The response includes Availability Zones only for the current region.

resp = client.describe_availability_zones({
})

# resp.to_h outputs the following:
{
  availability_zones: [
    {
      messages: [
      ], 
      region_name: "us-east-1", 
      state: "available", 
      zone_name: "us-east-1b", 
    }, 
    {
      messages: [
      ], 
      region_name: "us-east-1", 
      state: "available", 
      zone_name: "us-east-1c", 
    }, 
    {
      messages: [
      ], 
      region_name: "us-east-1", 
      state: "available", 
      zone_name: "us-east-1d", 
    }, 
    {
      messages: [
      ], 
      region_name: "us-east-1", 
      state: "available", 
      zone_name: "us-east-1e", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.describe_availability_zones({
  filters: [
    {
      name: "String",
      values: ["String"],
    },
  ],
  zone_names: ["String"],
  dry_run: false,
})

Response structure


resp.availability_zones #=> Array
resp.availability_zones[0].state #=> String, one of "available", "information", "impaired", "unavailable"
resp.availability_zones[0].messages #=> Array
resp.availability_zones[0].messages[0].message #=> String
resp.availability_zones[0].region_name #=> String
resp.availability_zones[0].zone_name #=> String

Options Hash (options):

  • :filters (Array<Types::Filter>)

    One or more filters.

    • message - Information about the Availability Zone.

    • region-name - The name of the region for the Availability Zone (for example, us-east-1).

    • state - The state of the Availability Zone (available | information | impaired | unavailable).

    • zone-name - The name of the Availability Zone (for example, us-east-1a).

  • :zone_names (Array<String>)

    The names of one or more Availability Zones.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#describe_bundle_tasks(options = {}) ⇒ Types::DescribeBundleTasksResult

Describes one or more of your bundling tasks.

Completed bundle tasks are listed for only a limited time. If your bundle task is no longer in the list, you can still register an AMI from it. Just use RegisterImage with the Amazon S3 bucket name and image manifest name you provided to the bundle task.

Examples:

Request syntax with placeholder values


resp = client.describe_bundle_tasks({
  bundle_ids: ["String"],
  filters: [
    {
      name: "String",
      values: ["String"],
    },
  ],
  dry_run: false,
})

Response structure


resp.bundle_tasks #=> Array
resp.bundle_tasks[0].bundle_id #=> String
resp.bundle_tasks[0].bundle_task_error.code #=> String
resp.bundle_tasks[0].bundle_task_error.message #=> String
resp.bundle_tasks[0].instance_id #=> String
resp.bundle_tasks[0].progress #=> String
resp.bundle_tasks[0].start_time #=> Time
resp.bundle_tasks[0].state #=> String, one of "pending", "waiting-for-shutdown", "bundling", "storing", "cancelling", "complete", "failed"
resp.bundle_tasks[0].storage.s3.aws_access_key_id #=> String
resp.bundle_tasks[0].storage.s3.bucket #=> String
resp.bundle_tasks[0].storage.s3.prefix #=> String
resp.bundle_tasks[0].storage.s3.upload_policy #=> IO
resp.bundle_tasks[0].storage.s3.upload_policy_signature #=> String
resp.bundle_tasks[0].update_time #=> Time

Options Hash (options):

  • :bundle_ids (Array<String>)

    One or more bundle task IDs.

    Default: Describes all your bundle tasks.

  • :filters (Array<Types::Filter>)

    One or more filters.

    • bundle-id - The ID of the bundle task.

    • error-code - If the task failed, the error code returned.

    • error-message - If the task failed, the error message returned.

    • instance-id - The ID of the instance.

    • progress - The level of task completion, as a percentage (for example, 20%).

    • s3-bucket - The Amazon S3 bucket to store the AMI.

    • s3-prefix - The beginning of the AMI name.

    • start-time - The time the task started (for example, 2013-09-15T17:15:20.000Z).

    • state - The state of the task (pending | waiting-for-shutdown | bundling | storing | cancelling | complete | failed).

    • update-time - The time of the most recent update for the task.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

Describes one or more of your linked EC2-Classic instances. This request only returns information about EC2-Classic instances linked to a VPC through ClassicLink; you cannot use this request to return information about other instances.

Examples:

Request syntax with placeholder values


resp = client.describe_classic_link_instances({
  filters: [
    {
      name: "String",
      values: ["String"],
    },
  ],
  dry_run: false,
  instance_ids: ["String"],
  max_results: 1,
  next_token: "String",
})

Response structure


resp.instances #=> Array
resp.instances[0].groups #=> Array
resp.instances[0].groups[0].group_name #=> String
resp.instances[0].groups[0].group_id #=> String
resp.instances[0].instance_id #=> String
resp.instances[0].tags #=> Array
resp.instances[0].tags[0].key #=> String
resp.instances[0].tags[0].value #=> String
resp.instances[0].vpc_id #=> String
resp.next_token #=> String

Options Hash (options):

  • :filters (Array<Types::Filter>)

    One or more filters.

    • group-id - The ID of a VPC security group that\'s associated with the instance.

    • instance-id - The ID of the instance.

    • tag:key=value - The key/value combination of a tag assigned to the resource.

    • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter \"tag-key=Purpose\" and the filter \"tag-value=X\", you get any resources assigned both the tag key Purpose (regardless of what the tag\'s value is), and the tag value X (regardless of what the tag\'s key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

    • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

    • vpc-id - The ID of the VPC that the instance is linked to.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :instance_ids (Array<String>)

    One or more instance IDs. Must be instances linked to a VPC through ClassicLink.

  • :max_results (Integer)

    The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. This value can be between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 results are returned. You cannot specify this parameter and the instance IDs parameter in the same request.

    Constraint: If the value is greater than 1000, we return only 1000 items.

  • :next_token (String)

    The token to retrieve the next page of results.

Returns:

See Also:

#describe_conversion_tasks(options = {}) ⇒ Types::DescribeConversionTasksResult

Describes one or more of your conversion tasks. For more information, see the VM Import/Export User Guide.

For information about the import manifest referenced by this API action, see VM Import Manifest.

Examples:

Request syntax with placeholder values


resp = client.describe_conversion_tasks({
  conversion_task_ids: ["String"],
  dry_run: false,
})

Response structure


resp.conversion_tasks #=> Array
resp.conversion_tasks[0].conversion_task_id #=> String
resp.conversion_tasks[0].expiration_time #=> String
resp.conversion_tasks[0].import_instance.description #=> String
resp.conversion_tasks[0].import_instance.instance_id #=> String
resp.conversion_tasks[0].import_instance.platform #=> String, one of "Windows"
resp.conversion_tasks[0].import_instance.volumes #=> Array
resp.conversion_tasks[0].import_instance.volumes[0].availability_zone #=> String
resp.conversion_tasks[0].import_instance.volumes[0].bytes_converted #=> Integer
resp.conversion_tasks[0].import_instance.volumes[0].description #=> String
resp.conversion_tasks[0].import_instance.volumes[0].image.checksum #=> String
resp.conversion_tasks[0].import_instance.volumes[0].image.format #=> String, one of "VMDK", "RAW", "VHD"
resp.conversion_tasks[0].import_instance.volumes[0].image.import_manifest_url #=> String
resp.conversion_tasks[0].import_instance.volumes[0].image.size #=> Integer
resp.conversion_tasks[0].import_instance.volumes[0].status #=> String
resp.conversion_tasks[0].import_instance.volumes[0].status_message #=> String
resp.conversion_tasks[0].import_instance.volumes[0].volume.id #=> String
resp.conversion_tasks[0].import_instance.volumes[0].volume.size #=> Integer
resp.conversion_tasks[0].import_volume.availability_zone #=> String
resp.conversion_tasks[0].import_volume.bytes_converted #=> Integer
resp.conversion_tasks[0].import_volume.description #=> String
resp.conversion_tasks[0].import_volume.image.checksum #=> String
resp.conversion_tasks[0].import_volume.image.format #=> String, one of "VMDK", "RAW", "VHD"
resp.conversion_tasks[0].import_volume.image.import_manifest_url #=> String
resp.conversion_tasks[0].import_volume.image.size #=> Integer
resp.conversion_tasks[0].import_volume.volume.id #=> String
resp.conversion_tasks[0].import_volume.volume.size #=> Integer
resp.conversion_tasks[0].state #=> String, one of "active", "cancelling", "cancelled", "completed"
resp.conversion_tasks[0].status_message #=> String
resp.conversion_tasks[0].tags #=> Array
resp.conversion_tasks[0].tags[0].key #=> String
resp.conversion_tasks[0].tags[0].value #=> String

Options Hash (options):

  • :conversion_task_ids (Array<String>)

    One or more conversion task IDs.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#describe_customer_gateways(options = {}) ⇒ Types::DescribeCustomerGatewaysResult

Describes one or more of your VPN customer gateways.

For more information about VPN customer gateways, see AWS Managed VPN Connections in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To describe a customer gateway


# This example describes the specified customer gateway.

resp = client.describe_customer_gateways({
  customer_gateway_ids: [
    "cgw-0e11f167", 
  ], 
})

# resp.to_h outputs the following:
{
  customer_gateways: [
    {
      bgp_asn: "65534", 
      customer_gateway_id: "cgw-0e11f167", 
      ip_address: "12.1.2.3", 
      state: "available", 
      type: "ipsec.1", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.describe_customer_gateways({
  customer_gateway_ids: ["String"],
  filters: [
    {
      name: "String",
      values: ["String"],
    },
  ],
  dry_run: false,
})

Response structure


resp.customer_gateways #=> Array
resp.customer_gateways[0].bgp_asn #=> String
resp.customer_gateways[0].customer_gateway_id #=> String
resp.customer_gateways[0].ip_address #=> String
resp.customer_gateways[0].state #=> String
resp.customer_gateways[0].type #=> String
resp.customer_gateways[0].tags #=> Array
resp.customer_gateways[0].tags[0].key #=> String
resp.customer_gateways[0].tags[0].value #=> String

Options Hash (options):

  • :customer_gateway_ids (Array<String>)

    One or more customer gateway IDs.

    Default: Describes all your customer gateways.

  • :filters (Array<Types::Filter>)

    One or more filters.

    • bgp-asn - The customer gateway\'s Border Gateway Protocol (BGP) Autonomous System Number (ASN).

    • customer-gateway-id - The ID of the customer gateway.

    • ip-address - The IP address of the customer gateway\'s Internet-routable external interface.

    • state - The state of the customer gateway (pending | available | deleting | deleted).

    • type - The type of customer gateway. Currently, the only supported type is ipsec.1.

    • tag:key=value - The key/value combination of a tag assigned to the resource. Specify the key of the tag in the filter name and the value of the tag in the filter value. For example, for the tag Purpose=X, specify tag:Purpose for the filter name and X for the filter value.

    • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter \"tag-key=Purpose\" and the filter \"tag-value=X\", you get any resources assigned both the tag key Purpose (regardless of what the tag\'s value is), and the tag value X (regardless of what the tag\'s key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

    • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also:

#describe_dhcp_options(options = {}) ⇒ Types::DescribeDhcpOptionsResult

Describes one or more of your DHCP options sets.

For more information about DHCP options sets, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide.

Examples:

Example: To describe a DHCP options set


# This example describes the specified DHCP options set.

resp = client.describe_dhcp_options({
  dhcp_options_ids: [
    "dopt-d9070ebb", 
  ], 
})

# resp.to_h outputs the following:
{
  dhcp_options: [
    {
      dhcp_configurations: [
        {
          key: "domain-name-servers", 
          values: [
            {
              value: "10.2.5.2", 
            }, 
            {
              value: "10.2.5.1", 
            }, 
          ], 
        }, 
      ], 
      dhcp_options_id: "dopt-d9070ebb", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.describe_dhcp_options({
  dhcp_options_ids: ["String"],
  filters: [
    {
      name: "String",
      values: ["String"],
    },
  ],
  dry_run: false,
})

Response structure


resp.dhcp_options #=> Array
resp.dhcp_options[0].dhcp_configurations #=> Array
resp.dhcp_options[0].dhcp_configurations[0].key #=> String
resp.dhcp_options[0].dhcp_configurations[0].values #=> Array
resp.dhcp_options[0].dhcp_configurations[0].values[0] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.dhcp_options[0].dhcp_options_id #=> String
resp.dhcp_options[0].tags #=> Array
resp.dhcp_options[0].tags[0].key #=> String
resp.dhcp_options[0].tags[0].value #=> String

Options Hash (options):

  • :dhcp_options_ids (Array<String>)

    The IDs of one or more DHCP options sets.

    Default: Describes all your DHCP options sets.

  • :filters (Array<Types::Filter>)

    One or more filters.

    • dhcp-options-id - The ID of a set of DHCP options.

    • key - The key for one of the options (for example, domain-name).

    • value - The value for one of the options.

    • tag:key=value - The key/value combination of a tag assigned to the resource. Specify the key of the tag in the filter name and the value of the tag in the filter value. For example, for the tag Purpose=X, specify tag:Purpose for the filter name and X for the filter value.

    • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter \"tag-key=Purpose\" and the filter \"tag-value=X\", you get any resources assigned both the tag key Purpose (regardless of what the tag\'s value is), and the tag value X (regardless of what the tag\'s key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

    • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

See Also: