Sha256: aa8a93d0cb4a188dabaf578b43086e600be9b7177184acbd08d4e581228479c1

Contents?: true

Size: 1.19 KB

Versions: 7

Compression:

Stored size: 1.19 KB

Contents

module CFM
  class OneAzTwoPublicAndPrivateSubnetVpc < Vpc
    def initialize
      super
      template_file = @config.get_template_file(CFM::Vpc::TYPE.fetch(3))
      file = get_template_full_path(template_file)
      @config.template = File.read(file)
      @config.parameters = [
          {
              parameter_key: "AZ1",
              parameter_value: @config.azs[0],
              use_previous_value: false,
          },
      ]
    end

    def get_subnet_info(logical_resource_id)
      info = {}
      info[:subnet_id] = @cfm.describe_stack_resource({stack_name: @config.stack_name, logical_resource_id: logical_resource_id}).stack_resource_detail.physical_resource_id
      info[:az] = @config.azs[0]
      info
    end

    def get_subnet_infos
      infos = []
      infos << get_subnet_info('PublicSubnet')
      infos << get_subnet_info('PrivateSubnet')
      infos
    end
  end

  class OneAzTwoPublicAndPrivateSubnetVpcStub < VpcStub
    def get_subnet_info
      info = {}
      info[:subnet_id] = 'DUMMY_SUBNET_ID'
      info[:az] = 'DUMMY_AZ'
      info
    end

    def get_subnet_infos
      infos = []
      infos << get_subnet_info
      infos << get_subnet_info
      infos
    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/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb
etude_for_aws-0.7.9 lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb
etude_for_aws-0.7.8 lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb
etude_for_aws-0.7.7 lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb
etude_for_aws-0.7.6 lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb
etude_for_aws-0.7.5 lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb
etude_for_aws-0.7.4 lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb