class Aws::EC2::NatGateway

We provide this class because the AWS SDK V2 does not provide it (as of May 2016). We copied the pattern in their SDK so when they do add a real resource there shouldn't be a need for much translation.

Attributes

id[R]
nat_gateway_addresses[R]
nat_gateway_id[R]
resource[R]
subnet_id[R]
vpc_id[R]

Public Class Methods

new(id, options = {}) click to toggle source
# File lib/chef/resource/aws_nat_gateway.rb, line 21
def initialize(id, options = {})
  @id = id
  @nat_gateway_id = id
  @client = options[:client]
  nat_gateway_struct = get_nat_gateway_struct
  @vpc_id = nat_gateway_struct.vpc_id
  @subnet_id = nat_gateway_struct.subnet_id
  @nat_gateway_addresses = nat_gateway_struct.nat_gateway_addresses
end

Public Instance Methods

delete() click to toggle source
# File lib/chef/resource/aws_nat_gateway.rb, line 35
def delete
  @client.delete_nat_gateway(nat_gateway_id: @id)
end
state() click to toggle source
# File lib/chef/resource/aws_nat_gateway.rb, line 31
def state
  get_nat_gateway_struct.state
end

Private Instance Methods

get_nat_gateway_struct() click to toggle source
# File lib/chef/resource/aws_nat_gateway.rb, line 41
def get_nat_gateway_struct
  @client.describe_nat_gateways(nat_gateway_ids: [@id]).nat_gateways.first
end