Class: CFM::OneAzTwoPublicAndPrivateSubnetVpc
- Defined in:
- lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb
Constant Summary
Constants inherited from Vpc
Instance Attribute Summary
Attributes inherited from Vpc
Instance Method Summary collapse
- #get_subnet_info(logical_resource_id) ⇒ Object
- #get_subnet_infos ⇒ Object
-
#initialize ⇒ OneAzTwoPublicAndPrivateSubnetVpc
constructor
A new instance of OneAzTwoPublicAndPrivateSubnetVpc.
Methods inherited from Vpc
#create, #destroy, #get_vpc_id
Methods included from EC2::VpcInterface
Constructor Details
#initialize ⇒ OneAzTwoPublicAndPrivateSubnetVpc
Returns a new instance of OneAzTwoPublicAndPrivateSubnetVpc.
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb', line 3 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 |
Instance Method Details
#get_subnet_info(logical_resource_id) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb', line 17 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 |
#get_subnet_infos ⇒ Object
24 25 26 27 28 29 |
# File 'lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb', line 24 def get_subnet_infos infos = [] infos << get_subnet_info('PublicSubnet') infos << get_subnet_info('PrivateSubnet') infos end |