cfndk 0.0.7 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +68 -0
- data/.simplecov +9 -0
- data/Gemfile +10 -1
- data/README.md +43 -76
- data/bin/cfndk +3 -18
- data/cfndk.gemspec +11 -6
- data/lib/cfndk.rb +21 -0
- data/lib/cfndk/command.rb +279 -115
- data/lib/cfndk/key_pair.rb +26 -9
- data/lib/cfndk/key_pairs.rb +8 -4
- data/lib/cfndk/logger.rb +12 -3
- data/lib/cfndk/stack.rb +60 -45
- data/lib/cfndk/stacks.rb +4 -20
- data/lib/cfndk/version.rb +1 -1
- data/spec/.gitignore +1 -0
- data/spec/cfndk_create_spec.rb +589 -0
- data/spec/cfndk_destroy_spec.rb +146 -0
- data/spec/cfndk_keypiar_spec.rb +395 -0
- data/spec/cfndk_report_spec.rb +162 -0
- data/spec/cfndk_spec.rb +101 -0
- data/spec/cfndk_stack_spec.rb +1273 -0
- data/spec/fixtures/empty_resource.yaml +2 -0
- data/spec/fixtures/iam.json +8 -0
- data/spec/fixtures/iam.yaml +38 -0
- data/spec/fixtures/iam_different.json +8 -0
- data/spec/fixtures/invalid_vpc.yaml +21 -0
- data/spec/fixtures/sg.json +8 -0
- data/spec/fixtures/sg.yaml +27 -0
- data/spec/fixtures/sg_different.yaml +22 -0
- data/spec/fixtures/vpc.json +8 -0
- data/spec/fixtures/vpc.yaml +21 -0
- data/spec/fixtures/vpc_different.yaml +21 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/support/aruba.rb +5 -0
- metadata +139 -27
@@ -0,0 +1,38 @@
|
|
1
|
+
AWSTemplateFormatVersion: 2010-09-09
|
2
|
+
Description: IAM Stack
|
3
|
+
Parameters:
|
4
|
+
WebRoleName:
|
5
|
+
Description: Name for WebRole
|
6
|
+
Type: String
|
7
|
+
Resources:
|
8
|
+
WebRole:
|
9
|
+
Type: AWS::IAM::Role
|
10
|
+
Properties:
|
11
|
+
AssumeRolePolicyDocument:
|
12
|
+
Version: "2012-10-17"
|
13
|
+
Statement:
|
14
|
+
-
|
15
|
+
Effect: "Allow"
|
16
|
+
Principal:
|
17
|
+
Service:
|
18
|
+
- "ec2.amazonaws.com"
|
19
|
+
Action:
|
20
|
+
- "sts:AssumeRole"
|
21
|
+
Path: "/"
|
22
|
+
Policies:
|
23
|
+
-
|
24
|
+
PolicyName: "root"
|
25
|
+
PolicyDocument:
|
26
|
+
Version: "2012-10-17"
|
27
|
+
Statement:
|
28
|
+
-
|
29
|
+
Effect: "Allow"
|
30
|
+
Action: "*"
|
31
|
+
Resource: "*"
|
32
|
+
RoleName: !Ref WebRoleName
|
33
|
+
Outputs:
|
34
|
+
WebRole:
|
35
|
+
Description: WebIam Role
|
36
|
+
Value: !Ref WebRole
|
37
|
+
Export:
|
38
|
+
Name: !Ref WebRoleName
|
@@ -0,0 +1,21 @@
|
|
1
|
+
AWSTemplateFormatVersion: '2010-09-09'
|
2
|
+
Description: Stack1
|
3
|
+
Parameters:
|
4
|
+
VpcName:
|
5
|
+
Description: Name for this VPC
|
6
|
+
Type: String
|
7
|
+
Resources:
|
8
|
+
Vpc:
|
9
|
+
Type: AWS::EC2::VPC
|
10
|
+
Properties:
|
11
|
+
CidrBlock: 192.168.0.0/24
|
12
|
+
EnableDnsHostnames: true
|
13
|
+
Tags:
|
14
|
+
- Key: Name
|
15
|
+
Value: !Sub ${VpcName}-VPC
|
16
|
+
Outputs:
|
17
|
+
VpcId:
|
18
|
+
Description: VPC ID
|
19
|
+
Value: !Ref Vpc
|
20
|
+
Export:
|
21
|
+
Name: !Sub ${VpcName}-VpcId
|
@@ -0,0 +1,27 @@
|
|
1
|
+
AWSTemplateFormatVersion: '2010-09-09'
|
2
|
+
Description: Stack2
|
3
|
+
Parameters:
|
4
|
+
VpcName:
|
5
|
+
Description: Name for this VPC
|
6
|
+
Type: String
|
7
|
+
Resources:
|
8
|
+
TestSg:
|
9
|
+
Type: AWS::EC2::SecurityGroup
|
10
|
+
Properties:
|
11
|
+
GroupDescription: Web ELB Acccess Security Group
|
12
|
+
VpcId:
|
13
|
+
Fn::ImportValue: !Sub ${VpcName}-VpcId
|
14
|
+
SecurityGroupIngress:
|
15
|
+
- IpProtocol: tcp
|
16
|
+
FromPort: 80
|
17
|
+
ToPort: 80
|
18
|
+
CidrIp: 0.0.0.0/0
|
19
|
+
Description: Allow HTTP Access From Internet
|
20
|
+
- IpProtocol: tcp
|
21
|
+
FromPort: 443
|
22
|
+
ToPort: 443
|
23
|
+
CidrIp: 0.0.0.0/0
|
24
|
+
Description: Allow HTTPS Access From Internet
|
25
|
+
Tags:
|
26
|
+
- Key: Name
|
27
|
+
Value: TestSg
|
@@ -0,0 +1,22 @@
|
|
1
|
+
AWSTemplateFormatVersion: '2010-09-09'
|
2
|
+
Description: Stack2
|
3
|
+
Parameters:
|
4
|
+
VpcName:
|
5
|
+
Description: Name for this VPC
|
6
|
+
Type: String
|
7
|
+
Resources:
|
8
|
+
TestSg:
|
9
|
+
Type: AWS::EC2::SecurityGroup
|
10
|
+
Properties:
|
11
|
+
GroupDescription: Web ELB Acccess Security Group
|
12
|
+
VpcId:
|
13
|
+
Fn::ImportValue: !Sub ${VpcName}-VpcId
|
14
|
+
SecurityGroupIngress:
|
15
|
+
- IpProtocol: tcp
|
16
|
+
FromPort: 80
|
17
|
+
ToPort: 80
|
18
|
+
CidrIp: 0.0.0.0/0
|
19
|
+
Description: Allow HTTP Access From Internet
|
20
|
+
Tags:
|
21
|
+
- Key: Name
|
22
|
+
Value: TestSg
|
@@ -0,0 +1,21 @@
|
|
1
|
+
AWSTemplateFormatVersion: '2010-09-09'
|
2
|
+
Description: Stack1
|
3
|
+
Parameters:
|
4
|
+
VpcName:
|
5
|
+
Description: Name for this VPC
|
6
|
+
Type: String
|
7
|
+
Resources:
|
8
|
+
Vpc:
|
9
|
+
Type: AWS::EC2::VPC
|
10
|
+
Properties:
|
11
|
+
CidrBlock: 192.168.0.0/24
|
12
|
+
EnableDnsHostnames: true
|
13
|
+
Tags:
|
14
|
+
- Key: Name
|
15
|
+
Value: !Sub ${VpcName}-VPC
|
16
|
+
Outputs:
|
17
|
+
VpcId:
|
18
|
+
Description: VPC ID
|
19
|
+
Value: !Ref Vpc
|
20
|
+
Export:
|
21
|
+
Name: !Sub ${VpcName}-VpcId
|
@@ -0,0 +1,21 @@
|
|
1
|
+
AWSTemplateFormatVersion: '2010-09-09'
|
2
|
+
Description: Stack1
|
3
|
+
Parameters:
|
4
|
+
VpcName:
|
5
|
+
Description: Name for this VPC
|
6
|
+
Type: String
|
7
|
+
Resources:
|
8
|
+
Vpc:
|
9
|
+
Type: AWS::EC2::VPC
|
10
|
+
Properties:
|
11
|
+
CidrBlock: 192.168.0.0/24
|
12
|
+
EnableDnsHostnames: false
|
13
|
+
Tags:
|
14
|
+
- Key: Name
|
15
|
+
Value: !Sub ${VpcName}-VPC
|
16
|
+
Outputs:
|
17
|
+
VpcId:
|
18
|
+
Description: VPC ID
|
19
|
+
Value: !Ref Vpc
|
20
|
+
Export:
|
21
|
+
Name: !Sub ${VpcName}-VpcId
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
|
+
|
3
|
+
if RUBY_VERSION < '1.9.3'
|
4
|
+
::Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
|
5
|
+
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
|
6
|
+
else
|
7
|
+
::Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }
|
8
|
+
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }
|
9
|
+
end
|
10
|
+
|
11
|
+
require 'awspec'
|
metadata
CHANGED
@@ -1,99 +1,169 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfndk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshihisa AMAKATA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: aruba
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: awspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: thor
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
41
111
|
- !ruby/object:Gem::Dependency
|
42
112
|
name: rainbow
|
43
113
|
requirement: !ruby/object:Gem::Requirement
|
44
114
|
requirements:
|
45
|
-
- - "
|
115
|
+
- - ">="
|
46
116
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
117
|
+
version: '0'
|
48
118
|
type: :runtime
|
49
119
|
prerelease: false
|
50
120
|
version_requirements: !ruby/object:Gem::Requirement
|
51
121
|
requirements:
|
52
|
-
- - "
|
122
|
+
- - ">="
|
53
123
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
124
|
+
version: '0'
|
55
125
|
- !ruby/object:Gem::Dependency
|
56
126
|
name: aws-sdk
|
57
127
|
requirement: !ruby/object:Gem::Requirement
|
58
128
|
requirements:
|
59
|
-
- - "
|
129
|
+
- - ">="
|
60
130
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
131
|
+
version: '0'
|
62
132
|
type: :runtime
|
63
133
|
prerelease: false
|
64
134
|
version_requirements: !ruby/object:Gem::Requirement
|
65
135
|
requirements:
|
66
|
-
- - "
|
136
|
+
- - ">="
|
67
137
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
138
|
+
version: '0'
|
69
139
|
- !ruby/object:Gem::Dependency
|
70
140
|
name: camelizable
|
71
141
|
requirement: !ruby/object:Gem::Requirement
|
72
142
|
requirements:
|
73
|
-
- - "
|
143
|
+
- - ">="
|
74
144
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0
|
145
|
+
version: '0'
|
76
146
|
type: :runtime
|
77
147
|
prerelease: false
|
78
148
|
version_requirements: !ruby/object:Gem::Requirement
|
79
149
|
requirements:
|
80
|
-
- - "
|
150
|
+
- - ">="
|
81
151
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0
|
152
|
+
version: '0'
|
83
153
|
- !ruby/object:Gem::Dependency
|
84
154
|
name: terminal-table
|
85
155
|
requirement: !ruby/object:Gem::Requirement
|
86
156
|
requirements:
|
87
|
-
- - "
|
157
|
+
- - ">="
|
88
158
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
159
|
+
version: '0'
|
90
160
|
type: :runtime
|
91
161
|
prerelease: false
|
92
162
|
version_requirements: !ruby/object:Gem::Requirement
|
93
163
|
requirements:
|
94
|
-
- - "
|
164
|
+
- - ">="
|
95
165
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
166
|
+
version: '0'
|
97
167
|
description: cfndk is AWS Cloud Formation Development Kit
|
98
168
|
email:
|
99
169
|
- amakata@gmail.com
|
@@ -102,8 +172,10 @@ executables:
|
|
102
172
|
extensions: []
|
103
173
|
extra_rdoc_files: []
|
104
174
|
files:
|
175
|
+
- ".circleci/config.yml"
|
105
176
|
- ".gitignore"
|
106
177
|
- ".rubocop.yml"
|
178
|
+
- ".simplecov"
|
107
179
|
- Gemfile
|
108
180
|
- LICENSE.txt
|
109
181
|
- README.md
|
@@ -136,6 +208,26 @@ files:
|
|
136
208
|
- skel/sg/sg.yaml
|
137
209
|
- skel/web/prod.json
|
138
210
|
- skel/web/web.yaml
|
211
|
+
- spec/.gitignore
|
212
|
+
- spec/cfndk_create_spec.rb
|
213
|
+
- spec/cfndk_destroy_spec.rb
|
214
|
+
- spec/cfndk_keypiar_spec.rb
|
215
|
+
- spec/cfndk_report_spec.rb
|
216
|
+
- spec/cfndk_spec.rb
|
217
|
+
- spec/cfndk_stack_spec.rb
|
218
|
+
- spec/fixtures/empty_resource.yaml
|
219
|
+
- spec/fixtures/iam.json
|
220
|
+
- spec/fixtures/iam.yaml
|
221
|
+
- spec/fixtures/iam_different.json
|
222
|
+
- spec/fixtures/invalid_vpc.yaml
|
223
|
+
- spec/fixtures/sg.json
|
224
|
+
- spec/fixtures/sg.yaml
|
225
|
+
- spec/fixtures/sg_different.yaml
|
226
|
+
- spec/fixtures/vpc.json
|
227
|
+
- spec/fixtures/vpc.yaml
|
228
|
+
- spec/fixtures/vpc_different.yaml
|
229
|
+
- spec/spec_helper.rb
|
230
|
+
- spec/support/aruba.rb
|
139
231
|
homepage: https://github.com/Amakata/cfndk
|
140
232
|
licenses:
|
141
233
|
- http://www.apache.org/licenses/license-2.0
|
@@ -160,4 +252,24 @@ rubygems_version: 2.5.1
|
|
160
252
|
signing_key:
|
161
253
|
specification_version: 4
|
162
254
|
summary: cfndk is AWS Cloud Formation Development Kit
|
163
|
-
test_files:
|
255
|
+
test_files:
|
256
|
+
- spec/.gitignore
|
257
|
+
- spec/cfndk_create_spec.rb
|
258
|
+
- spec/cfndk_destroy_spec.rb
|
259
|
+
- spec/cfndk_keypiar_spec.rb
|
260
|
+
- spec/cfndk_report_spec.rb
|
261
|
+
- spec/cfndk_spec.rb
|
262
|
+
- spec/cfndk_stack_spec.rb
|
263
|
+
- spec/fixtures/empty_resource.yaml
|
264
|
+
- spec/fixtures/iam.json
|
265
|
+
- spec/fixtures/iam.yaml
|
266
|
+
- spec/fixtures/iam_different.json
|
267
|
+
- spec/fixtures/invalid_vpc.yaml
|
268
|
+
- spec/fixtures/sg.json
|
269
|
+
- spec/fixtures/sg.yaml
|
270
|
+
- spec/fixtures/sg_different.yaml
|
271
|
+
- spec/fixtures/vpc.json
|
272
|
+
- spec/fixtures/vpc.yaml
|
273
|
+
- spec/fixtures/vpc_different.yaml
|
274
|
+
- spec/spec_helper.rb
|
275
|
+
- spec/support/aruba.rb
|