Sha256: 580a696e2515ffab3edca308bb5dd43b9a7a4b7b3a1e8f91ecb3697846a0c81b

Contents?: true

Size: 966 Bytes

Versions: 7

Compression:

Stored size: 966 Bytes

Contents

module VPC
  class CustomerGateway
    attr_reader :customer_gateway_id

    def initialize(config,gateway,customer_gateway_id=nil)
      @config = config
      @gateway = gateway
      @customer_gateway_id = customer_gateway_id
    end

    def create(customer_gateway_info)
      bgp_asn = customer_gateway_info['BGP_ASN']
      public_ip = customer_gateway_info['PUBLIC_IP']
      type = customer_gateway_info['TYPE']
      customer_gateway = @gateway.create_customer_gateway(bgp_asn, public_ip, type)
      @customer_gateway_id = customer_gateway[0].customer_gateway_id
      resources = [@customer_gateway_id]
      customer_gateway_tags = customer_gateway_info['TAGS']
      tag = {key: customer_gateway_tags['NAME']['KEY'], value: customer_gateway_tags['NAME']['VALUE']}
      tags = [tag, @config.vpc_group_tag]
      @gateway.create_tags(resources, tags)
    end

    def delete
      @gateway.delete_customer_gateway(@customer_gateway_id)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
etude_for_aws-0.7.10 lib/etude_for_aws/vpc/customer_gateway.rb
etude_for_aws-0.7.9 lib/etude_for_aws/vpc/customer_gateway.rb
etude_for_aws-0.7.8 lib/etude_for_aws/vpc/customer_gateway.rb
etude_for_aws-0.7.7 lib/etude_for_aws/vpc/customer_gateway.rb
etude_for_aws-0.7.6 lib/etude_for_aws/vpc/customer_gateway.rb
etude_for_aws-0.7.5 lib/etude_for_aws/vpc/customer_gateway.rb
etude_for_aws-0.7.4 lib/etude_for_aws/vpc/customer_gateway.rb