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

Class: Aws::EC2::InternetGateway

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(id, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(id, options = {}) ⇒ Object

    Parameters:

    • id (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :id (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#attachmentsArray<Types::InternetGatewayAttachment> (readonly)

Any VPCs attached to the internet gateway.

Returns:

#idString (readonly)

Returns:

  • (String)

#internet_gateway_idString (readonly)

The ID of the internet gateway.

Returns:

  • (String)

    The ID of the internet gateway.

#owner_idString (readonly)

The ID of the AWS account that owns the internet gateway.

Returns:

  • (String)

    The ID of the AWS account that owns the internet gateway.

#tagsArray<Types::Tag> (readonly)

Any tags assigned to the internet gateway.

Returns:

  • (Array<Types::Tag>)

    Any tags assigned to the internet gateway.

Instance Method Details

#attach_to_vpc(options = {}) ⇒ Struct

Attaches an internet gateway or a virtual private 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:

Request syntax example with placeholder values


internetgateway.attach_to_vpc({
  dry_run: false,
  vpc_id: "VpcId", # 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.

  • :vpc_id (required, String)

    The ID of the VPC.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_tags(options = {}) ⇒ Array<Tag>

Examples:

Request syntax example with placeholder values


internetgateway.create_tags({
  dry_run: false,
  tags: [ # required
    {
      key: "String",
      value: "String",
    },
  ],
})

Basic usage

tags = internetgateway.create_tags(options)
tags.map(&:value)
#=> ["tag-value", ...]

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.

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

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

See Also:

#delete(options = {}) ⇒ Struct

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

Examples:

Request syntax example with placeholder values


internetgateway.delete({
  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_tags(options = {}) ⇒ Array<Tag>

Examples:

Request syntax example with placeholder values


internetgateway.delete_tags({
  dry_run: false,
  tags: [
    {
      key: "String",
      value: "String",
    },
  ],
})

Basic usage

tags = internetgateway.delete_tags(options)
tags.map(&:value)
#=> ["tag-value", ...]

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.

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

    The tags to delete. 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.

    If you omit this parameter, we delete all user-defined tags for the specified resources. We do not delete AWS-generated tags (tags that have the aws: prefix).

Returns:

See Also:

#detach_from_vpc(options = {}) ⇒ Struct

Detaches an internet gateway from a VPC, disabling connectivity between the internet and the VPC. The VPC must not contain any running instances with Elastic IP addresses or public IPv4 addresses.

Examples:

Request syntax example with placeholder values


internetgateway.detach_from_vpc({
  dry_run: false,
  vpc_id: "VpcId", # 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.

  • :vpc_id (required, String)

    The ID of the VPC.

Returns:

  • (Struct)

    Returns an empty response.

See Also: