Class: Formatron::CloudFormation::Template::VPC

Inherits:
Object
  • Object
show all
Defined in:
lib/formatron/cloud_formation/template/vpc.rb,
lib/formatron/cloud_formation/template/vpc/subnet.rb,
lib/formatron/cloud_formation/template/vpc/subnet/acl.rb,
lib/formatron/cloud_formation/template/vpc/subnet/nat.rb,
lib/formatron/cloud_formation/template/vpc/subnet/bastion.rb,
lib/formatron/cloud_formation/template/vpc/subnet/instance.rb,
lib/formatron/cloud_formation/template/vpc/subnet/chef_server.rb,
lib/formatron/cloud_formation/template/vpc/subnet/instance/setup.rb,
lib/formatron/cloud_formation/template/vpc/subnet/instance/policy.rb,
lib/formatron/cloud_formation/template/vpc/subnet/instance/block_devices.rb,
lib/formatron/cloud_formation/template/vpc/subnet/instance/security_group.rb

Overview

generates CloudFormation VPC resources rubocop:disable Metrics/ClassLength

Defined Under Namespace

Classes: Subnet

Constant Summary collapse

VPC_PREFIX =
'vpc'
INTERNET_GATEWAY_PREFIX =
'internetGateway'
VPC_GATEWAY_ATTACHMENT_PREFIX =
'vpcGatewayAttachment'
ROUTE_TABLE_PREFIX =
'routeTable'
ROUTE_PREFIX =
'route'
HOSTED_ZONE_PREFIX =
'hostedZone'

Instance Method Summary collapse

Constructor Details

#initialize(vpc:, external:, hosted_zone_name:, key_pair:, administrator_name:, administrator_password:, kms_key:, hosted_zone_id:, bucket:, name:, target:) ⇒ VPC

rubocop:disable Metrics/MethodLength rubocop:disable Metrics/ParameterLists



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/formatron/cloud_formation/template/vpc.rb', line 21

def initialize(
  vpc:,
  external:,
  hosted_zone_name:,
  key_pair:,
  administrator_name:,
  administrator_password:,
  kms_key:,
  hosted_zone_id:,
  bucket:,
  name:,
  target:
)
  @vpc = vpc
  @external = external
  @hosted_zone_name = hosted_zone_name
  @key_pair = key_pair
  @administrator_name = administrator_name
  @administrator_password = administrator_password
  @kms_key = kms_key
  @hosted_zone_id = hosted_zone_id
  @bucket = bucket
  @name = name
  @target = target
end

Instance Method Details

#merge(resources:, outputs:) ⇒ Object

rubocop:enable Metrics/ParameterLists rubocop:enable Metrics/MethodLength



49
50
51
52
53
54
55
56
57
# File 'lib/formatron/cloud_formation/template/vpc.rb', line 49

def merge(resources:, outputs:)
  @guid = @vpc.guid
  if @guid.nil?
    @guid = @external.guid
    _merge_external resources: resources, outputs: outputs
  else
    _merge_local resources: resources, outputs: outputs
  end
end