sparkle-pack-aws-vpc 0.1.6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c1c3f3f3856d8b19d0f61dcdbc289ce2b9fc533
4
- data.tar.gz: 11a0abac85885ce0c44d47314deb64472a15172e
3
+ metadata.gz: c17a10d191efe013ba01894beaa19993801ca61c
4
+ data.tar.gz: ca07d9eb02716ed144f0cae47febfe881d2ddfee
5
5
  SHA512:
6
- metadata.gz: c08ac51d2cef91f9062c4a51611e79d914023504c408781128bc21859c9d63ca3d1b9af2575e80d4d7b6b46006b5aea8c12926a1e6051bfc63e76b5dbdfc586a
7
- data.tar.gz: 8d6d4b03ccbaa29c3199b3d01359887316dab18e3957e8399077349ae7c99a6e2693e12d140960fa19207dbef6224a3154bb1e99e4a42cbad3268607bed5f089
6
+ metadata.gz: 2d7b4963e961ed8c0a6ebd88161ff52f4e24ba4bf7e6d86c9a9c98c33b7a6e0f9ceae4912e131576353832dd3cf4f0ec00d9a0199c5b11e92959b9ce452e8537
7
+ data.tar.gz: 91f674e982efd1759a405a64765e725879368832d59c0a95c169d2da57a557d775c6db25ffd4817826796541d584979c89a9b369b9eeed413dd454d01d9397e8
@@ -1,124 +1,102 @@
1
- SparkleFormation.component(:vpc) do |_config ={}|
1
+ SparkleFormation.component(:aws_vpc_core) do |_config ={}|
2
+ set!('AWSTemplateFormatVersion', '2010-09-09')
2
3
 
3
- parameters(:vpc_cidr) do
4
- description 'VPC Subnet'
5
- type 'String'
6
- default '10.0.0.0/16'
7
- end
8
-
9
- parameters(:dns_support) do
10
- description 'Enable VPC DNS Support'
11
- type 'String'
12
- default 'true'
13
- allowed_values %w(true false)
14
- end
15
-
16
- parameters(:dns_hostnames) do
17
- description 'Enable VPC DNS Hostname Support'
18
- type 'String'
19
- default 'true'
20
- allowed_values %w(true false)
21
- end
4
+ parameters do
5
+ stack_creator do
6
+ type 'String'
7
+ default ENV['USER']
8
+ end
22
9
 
23
- parameters(:instance_tenancy) do
24
- description 'Enable VPC Instance Tenancy'
25
- type 'String'
26
- default 'default'
27
- allowed_values %w(default dedicated)
28
- end
10
+ vpc_cidr do
11
+ description 'VPC Subnet'
12
+ type 'String'
13
+ default '10.0.0.0/16'
14
+ end
29
15
 
30
- resources(:dhcp_options) do
31
- type 'AWS::EC2::DHCPOptions'
32
- properties do
33
- domain_name 'ec2.internal'
34
- domain_name_servers ['AmazonProvidedDNS']
35
- tags _array(
36
- -> {
37
- key 'Name'
38
- value stack_name!
39
- }
40
- )
16
+ dns_support do
17
+ description 'Enable VPC DNS Support'
18
+ type 'String'
19
+ default 'true'
20
+ allowed_values %w(true false)
41
21
  end
42
- end
43
22
 
44
- resources(:vpc) do
45
- type 'AWS::EC2::VPC'
46
- properties do
47
- cidr_block ref!(:vpc_cidr)
48
- enable_dns_support ref!(:dns_support)
49
- enable_dns_hostnames ref!(:dns_hostnames)
50
- instance_tenancy ref!(:instance_tenancy)
51
- tags _array(
52
- -> {
53
- key 'Name'
54
- value stack_name!
55
- }
56
- )
23
+ dns_hostnames do
24
+ description 'Enable VPC DNS Hostname Support'
25
+ type 'String'
26
+ default 'true'
27
+ allowed_values %w(true false)
57
28
  end
58
- end
59
29
 
60
- resources(:vpc_dhcp_options_association) do
61
- type 'AWS::EC2::VPCDHCPOptionsAssociation'
62
- properties do
63
- vpc_id ref!(:vpc)
64
- dhcp_options_id ref!(:dhcp_options)
30
+ instance_tenancy do
31
+ description 'Enable VPC Instance Tenancy'
32
+ type 'String'
33
+ default 'default'
34
+ allowed_values %w(default dedicated)
65
35
  end
66
36
  end
67
37
 
68
- %w( public private ).each do |type|
69
- resources("#{type}_route_table".to_sym) do
70
- type 'AWS::EC2::RouteTable'
38
+ resources do
39
+ dhcp_options do
40
+ type 'AWS::EC2::DHCPOptions'
71
41
  properties do
72
- vpc_id ref!(:vpc)
73
- tags _array(
42
+ domain_name 'ec2.internal'
43
+ domain_name_servers ['AmazonProvidedDNS']
44
+ tags array!(
74
45
  -> {
75
46
  key 'Name'
76
- value join!(stack_name!, " #{type}")
47
+ value stack_name!
77
48
  }
78
49
  )
79
50
  end
80
51
  end
81
- end
82
52
 
83
- resources(:internet_gateway) do
84
- type 'AWS::EC2::InternetGateway'
85
- properties do
86
- tags _array(
87
- -> {
88
- key 'Name'
89
- value stack_name!
90
- }
91
- )
53
+ vpc do
54
+ type 'AWS::EC2::VPC'
55
+ properties do
56
+ cidr_block ref!(:vpc_cidr)
57
+ enable_dns_support ref!(:dns_support)
58
+ enable_dns_hostnames ref!(:dns_hostnames)
59
+ instance_tenancy ref!(:instance_tenancy)
60
+ tags array!(
61
+ -> {
62
+ key 'Name'
63
+ value stack_name!
64
+ }
65
+ )
66
+ end
92
67
  end
93
- end
94
68
 
95
- resources(:internet_gateway_attachment) do
96
- type 'AWS::EC2::VPCGatewayAttachment'
97
- properties do
98
- internet_gateway_id ref!(:internet_gateway)
99
- vpc_id ref!(:vpc)
69
+ vpc_dhcp_options_association do
70
+ type 'AWS::EC2::VPCDHCPOptionsAssociation'
71
+ properties do
72
+ vpc_id ref!(:vpc)
73
+ dhcp_options_id ref!(:dhcp_options)
74
+ end
100
75
  end
101
- end
102
76
 
103
- resources(:public_subnet_internet_route) do
104
- type 'AWS::EC2::Route'
105
- properties do
106
- destination_cidr_block '0.0.0.0/0'
107
- gateway_id ref!(:internet_gateway)
108
- route_table_id ref!(:public_route_table)
77
+ private_route_table do
78
+ type 'AWS::EC2::RouteTable'
79
+ properties do
80
+ vpc_id ref!(:vpc)
81
+ tags array!(
82
+ -> {
83
+ key 'Name'
84
+ value join!(stack_name!, " private")
85
+ }
86
+ )
87
+ end
109
88
  end
110
89
  end
111
90
 
112
- outputs(:vpc_id) do
113
- value ref!(:vpc)
114
- end
91
+ outputs do
92
+ vpc_id do
93
+ value ref!(:vpc)
94
+ end
115
95
 
116
- [ :vpc_cidr, :public_route_table, :private_route_table, :internet_gateway ].each do |x|
117
- outputs do
96
+ [ :vpc_cidr, :private_route_table ].each do |x|
118
97
  set!(x) do
119
98
  value ref!(x)
120
99
  end
121
100
  end
122
101
  end
123
-
124
102
  end
@@ -1,4 +1,4 @@
1
- SparkleFormation.new(:lazy_vpc__public_subnet_vpc).load(:base, :vpc).overrides do
1
+ SparkleFormation.new(:lazy_vpc__public_subnet_vpc).load(:aws_vpc_core).overrides do
2
2
 
3
3
  description 'VPC with Public Subnets'
4
4
 
@@ -25,8 +25,60 @@ SparkleFormation.new(:lazy_vpc__public_subnet_vpc).load(:base, :vpc).overrides d
25
25
  public_subnet_ids.push(ref!(['public_', zone.gsub('-', '_'), '_subnet'].join.to_sym))
26
26
  end
27
27
 
28
- outputs(:public_subnet_ids) do
29
- value join!(public_subnet_ids, :options => { :delimiter => ',' })
28
+ resources do
29
+ public_route_table do
30
+ type 'AWS::EC2::RouteTable'
31
+ properties do
32
+ vpc_id ref!(:vpc)
33
+ tags array!(
34
+ -> {
35
+ key 'Name'
36
+ value join!(stack_name!, " public")
37
+ }
38
+ )
39
+ end
40
+ end
41
+
42
+ internet_gateway do
43
+ type 'AWS::EC2::InternetGateway'
44
+ properties do
45
+ tags array!(
46
+ -> {
47
+ key 'Name'
48
+ value stack_name!
49
+ }
50
+ )
51
+ end
52
+ end
53
+
54
+ internet_gateway_attachment do
55
+ type 'AWS::EC2::VPCGatewayAttachment'
56
+ properties do
57
+ internet_gateway_id ref!(:internet_gateway)
58
+ vpc_id ref!(:vpc)
59
+ end
60
+ end
61
+
62
+ public_subnet_internet_route do
63
+ type 'AWS::EC2::Route'
64
+ properties do
65
+ destination_cidr_block '0.0.0.0/0'
66
+ gateway_id ref!(:internet_gateway)
67
+ route_table_id ref!(:public_route_table)
68
+ end
69
+ end
70
+ end
71
+
72
+ outputs do
73
+ public_subnet_ids do
74
+ value join!(public_subnet_ids, :options => { :delimiter => ',' })
75
+ end
76
+
77
+ [ :public_route_table, :internet_gateway ].each do |x|
78
+ set!(x) do
79
+ value ref!(x)
80
+ end
81
+ end
30
82
  end
31
83
 
32
84
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparkle-pack-aws-vpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Johnston
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-06 00:00:00.000000000 Z
12
+ date: 2016-11-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sparkle-pack-aws-availability-zones
@@ -32,7 +32,6 @@ extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
34
  - lib/sparkle-pack-aws-vpc.rb
35
- - lib/sparkleformation/components/base.rb
36
35
  - lib/sparkleformation/components/vpc.rb
37
36
  - lib/sparkleformation/dynamics/security_group.rb
38
37
  - lib/sparkleformation/dynamics/vpc_nat_routing.rb
@@ -59,9 +58,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
58
  version: '0'
60
59
  requirements: []
61
60
  rubyforge_project:
62
- rubygems_version: 2.2.2
61
+ rubygems_version: 2.5.1
63
62
  signing_key:
64
63
  specification_version: 4
65
64
  summary: AWS VPC SparklePack
66
65
  test_files: []
67
- has_rdoc:
@@ -1,9 +0,0 @@
1
- SparkleFormation.component(:base) do
2
- set!('AWSTemplateFormatVersion', '2010-09-09')
3
- parameters do
4
- stack_creator do
5
- type 'String'
6
- default ENV['USER']
7
- end
8
- end
9
- end