Class: Formatron::CloudFormation::Template::VPC::Subnet::Bastion

Inherits:
Object
  • Object
show all
Defined in:
lib/formatron/cloud_formation/template/vpc/subnet/bastion.rb

Overview

generates CloudFormation Bastion resources

Instance Method Summary collapse

Constructor Details

#initialize(bastion:, key_pair:, administrator_name:, administrator_password:, availability_zone:, subnet_guid:, hosted_zone_name:, vpc_guid:, vpc_cidr:, kms_key:, private_hosted_zone_id:, public_hosted_zone_id:, bucket:, name:, target:) ⇒ Bastion

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



12
13
14
15
16
17
18
19
20
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
46
47
48
49
# File 'lib/formatron/cloud_formation/template/vpc/subnet/bastion.rb', line 12

def initialize(
  bastion:,
  key_pair:,
  administrator_name:,
  administrator_password:,
  availability_zone:,
  subnet_guid:,
  hosted_zone_name:,
  vpc_guid:,
  vpc_cidr:,
  kms_key:,
  private_hosted_zone_id:,
  public_hosted_zone_id:,
  bucket:,
  name:,
  target:
)
  @bastion = bastion
  _set_os
  _add_open_ports
  @instance = Instance.new(
    instance: bastion,
    key_pair: key_pair,
    administrator_name: administrator_name,
    administrator_password: administrator_password,
    availability_zone: availability_zone,
    subnet_guid: subnet_guid,
    hosted_zone_name: hosted_zone_name,
    vpc_guid: vpc_guid,
    vpc_cidr: vpc_cidr,
    kms_key: kms_key,
    private_hosted_zone_id: private_hosted_zone_id,
    public_hosted_zone_id: public_hosted_zone_id,
    bucket: bucket,
    name: name,
    target: target
  )
end

Instance Method Details

#merge(resources:, outputs:) ⇒ Object



65
66
67
# File 'lib/formatron/cloud_formation/template/vpc/subnet/bastion.rb', line 65

def merge(resources:, outputs:)
  @instance.merge resources: resources, outputs: outputs
end