Module: Enscalator::Plugins::VPCPeeringConnection
- Included in:
- Templates::VPCPeering
- Defined in:
- lib/enscalator/plugins/vpc_peering_connection.rb
Overview
VPC Peering Connection Plugin
Instance Method Summary collapse
-
#parameter_vpc_id(name, description, default_value = nil) ⇒ Object
Template parameter for VPC ID.
-
#vpc_peering_init(conn_name, tags: []) ⇒ Object
Create new vpc peering connection.
Instance Method Details
#parameter_vpc_id(name, description, default_value = nil) ⇒ Object
Template parameter for VPC ID
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/enscalator/plugins/vpc_peering_connection.rb', line 9 def parameter_vpc_id(name, description, default_value = nil) = { Description: description, Type: 'String', AllowedPattern: 'vpc-[a-zA-Z0-9]*', ConstraintDescription: 'must be valid VPC id (vpc-*).' } [:Default] = default_value if default_value && !default_value.nil? parameter name, end |
#vpc_peering_init(conn_name, tags: []) ⇒ Object
Create new vpc peering connection
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/enscalator/plugins/vpc_peering_connection.rb', line 24 def vpc_peering_init(conn_name, tags: []) = {} [:Properties] = { VpcId: ref("#{conn_name}VpcId"), PeerVpcId: ref("#{conn_name}PeerVpcId") } # Set plugin tags [:Properties][:Tags] = if && !.empty? resource conn_name, { Type: 'AWS::EC2::VPCPeeringConnection' }.merge() output conn_name, Description: 'VPC Peering connection name', Value: ref(conn_name) # return resource name conn_name end |