etude_for_aws 0.7.5 → 0.7.6
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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/config.yml +7 -7
- data/docs/ops/ship_circleci.md +4 -0
- data/lib/etude_for_aws/cfm/vpc/cfm_templates/{vpc-1az-1subnet-pub.template → vpc-1az-1subnet-pub.json} +1 -1
- data/lib/etude_for_aws/cfm/vpc/cfm_templates/{vpc-1az-2subnet-pub-pri.template → vpc-1az-2subnet-pub-pri.json} +1 -1
- data/lib/etude_for_aws/cfm/vpc/cfm_templates/{vpc-1az-2subnet-pub.template → vpc-1az-2subnet-pub.json} +1 -1
- data/lib/etude_for_aws/cfm/vpc/cfm_templates/{vpc-2az-2subnet-pri.template → vpc-2az-2subnet-pri.json} +3 -3
- data/lib/etude_for_aws/cfm/vpc/cfm_templates/{vpc-2az-2subnet-pub-pri.template → vpc-2az-2subnet-pub-pri.json} +2 -2
- data/lib/etude_for_aws/cfm/vpc/cfm_templates/{vpc-2az-2subnet-pub.template → vpc-2az-2subnet-pub.json} +2 -2
- data/lib/etude_for_aws/cfm/vpc/cfm_templates/{vpc-2az-4subnet-pub-pri.template → vpc-2az-4subnet-pub-pri.json} +2 -2
- data/lib/etude_for_aws/cfm/vpc/two_az_two_private_subnet_vpc.rb +14 -0
- data/lib/etude_for_aws/cfm/vpc/two_az_two_public_subnet_and_private_subnet_vpc.rb +17 -0
- data/lib/etude_for_aws/cfm/vpc/two_az_two_public_subnet_vpc.rb +15 -0
- data/lib/etude_for_aws/cfm/vpc/vpc.rb +5 -1
- data/lib/etude_for_aws/tasks/ec2.rake +17 -17
- data/lib/etude_for_aws/version.rb +1 -1
- data/lib/etude_for_aws/vpc/subnet.rb +0 -8
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 486c7864e85e63951e947c6dba58c139c957c12a
|
4
|
+
data.tar.gz: 3cf99b13aeb68f4df45c3cd66b3a50e0083d4399
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af3f2830bd7e6e0d60d894bd4d878d051757bf6e955a4ab335086934893e4c6d7e13537c3198554eec08d3f358098290d71ef7a9b5e28fc275f262bfe26e2a79
|
7
|
+
data.tar.gz: bd8635e9ba9af486aa117daca24060d68cdcc09dc18d54ddfa3100e0604f20d809ced180df4dbb49c9655623af27d16ac00a8d9f0c80f719ea29e66e52d5b64a
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Etude for AWS
|
2
2
|
[](https://circleci.com/gh/k2works/etude_for_aws)
|
3
|
-
[](https://github.com/k2works/etude_for_aws/LICENSE.txt)
|
3
|
+
[](https://github.com/k2works/etude_for_aws/blob/master/LICENSE.txt)
|
4
4
|
[](https://badge.fury.io/rb/etude_for_aws)
|
5
5
|
|
6
6
|
## Quick Start
|
data/config.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
DEV:
|
2
|
-
REGION: 'us-
|
2
|
+
REGION: 'us-east-1'
|
3
3
|
CFM:
|
4
4
|
VPC:
|
5
5
|
STACK_NAME: 'VPCtestStack'
|
@@ -11,9 +11,9 @@ DEV:
|
|
11
11
|
TEMPLATE_FILE_TYPE_05: 'vpc-2az-2subnet-pub.template'
|
12
12
|
TEMPLATE_FILE_TYPE_06: 'vpc-2az-2subnet-pub-pri.template'
|
13
13
|
TEMPLATE_FILE_TYPE_07: 'vpc-2az-4subnet-pub-pri.template'
|
14
|
-
TEMPLATE_PARAMS_AZ1: 'us-
|
15
|
-
TEMPLATE_PARAMS_AZ2: 'us-
|
16
|
-
TEMPLATE_PARAMS_AZ3: 'us-
|
14
|
+
TEMPLATE_PARAMS_AZ1: 'us-east-1a'
|
15
|
+
TEMPLATE_PARAMS_AZ2: 'us-east-1b'
|
16
|
+
TEMPLATE_PARAMS_AZ3: 'us-east-1c'
|
17
17
|
TAG_VALUE: 'test'
|
18
18
|
VPC:
|
19
19
|
VPC_TAGS:
|
@@ -34,7 +34,7 @@ DEV:
|
|
34
34
|
SUBNET_CIDR_BLOCK:
|
35
35
|
- '10.0.0.0/24'
|
36
36
|
AZ:
|
37
|
-
- 'us-
|
37
|
+
- 'us-east-1a'
|
38
38
|
PRIVATE:
|
39
39
|
- CONFIG:
|
40
40
|
SUBNET_TAGS:
|
@@ -44,7 +44,7 @@ DEV:
|
|
44
44
|
SUBNET_CIDR_BLOCK:
|
45
45
|
- '10.0.1.0/24'
|
46
46
|
AZ:
|
47
|
-
- 'us-
|
47
|
+
- 'us-east-1a'
|
48
48
|
ROUTE_TABLES:
|
49
49
|
PUBLIC:
|
50
50
|
- CONFIG:
|
@@ -105,7 +105,7 @@ DEV:
|
|
105
105
|
SECURITY_GROUP_DESCRIPTION: 'Security group for MyGroovyInstance'
|
106
106
|
KEY_PAIR_NAME: 'my-key-pair'
|
107
107
|
KEY_PAIR_PATH: '/lib/etude_for_aws/ec2/'
|
108
|
-
IMAGE_ID: 'ami-
|
108
|
+
IMAGE_ID: 'ami-c58c1dd3'
|
109
109
|
INSTANCE_TYPE: 't2.micro'
|
110
110
|
MIN_COUNT: '1'
|
111
111
|
MAX_COUNT: '1'
|
data/docs/ops/ship_circleci.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
"Default" : "ap-northeast-1a",
|
7
7
|
"Description" : "AZ",
|
8
8
|
"Type" : "String",
|
9
|
-
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c" ],
|
9
|
+
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c","us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e" ],
|
10
10
|
"ConstraintDescription" : "must select a valid availability zone."
|
11
11
|
}
|
12
12
|
},
|
@@ -6,7 +6,7 @@
|
|
6
6
|
"Default" : "ap-northeast-1a",
|
7
7
|
"Description" : "AZ",
|
8
8
|
"Type" : "String",
|
9
|
-
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c" ],
|
9
|
+
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c","us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e" ],
|
10
10
|
"ConstraintDescription" : "must select a valid availability zone."
|
11
11
|
}
|
12
12
|
},
|
@@ -6,7 +6,7 @@
|
|
6
6
|
"Default" : "ap-northeast-1a",
|
7
7
|
"Description" : "AZ",
|
8
8
|
"Type" : "String",
|
9
|
-
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c" ],
|
9
|
+
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c","us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e" ],
|
10
10
|
"ConstraintDescription" : "must select a valid availability zone."
|
11
11
|
}
|
12
12
|
},
|
@@ -6,14 +6,14 @@
|
|
6
6
|
"Default" : "ap-northeast-1a",
|
7
7
|
"Description" : "AZ",
|
8
8
|
"Type" : "String",
|
9
|
-
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c" ],
|
9
|
+
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c","us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e" ],
|
10
10
|
"ConstraintDescription" : "must select a valid availability zone."
|
11
11
|
},
|
12
12
|
"AZ2" : {
|
13
13
|
"Default" : "ap-northeast-1c",
|
14
14
|
"Description" : "AZ",
|
15
15
|
"Type" : "String",
|
16
|
-
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c" ],
|
16
|
+
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c","us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e" ],
|
17
17
|
"ConstraintDescription" : "must select a valid availability zone."
|
18
18
|
}
|
19
19
|
},
|
@@ -50,7 +50,7 @@
|
|
50
50
|
},
|
51
51
|
{
|
52
52
|
"Key": "Network",
|
53
|
-
"Value": "
|
53
|
+
"Value": "Private"
|
54
54
|
}
|
55
55
|
]
|
56
56
|
},
|
@@ -6,14 +6,14 @@
|
|
6
6
|
"Default" : "ap-northeast-1a",
|
7
7
|
"Description" : "AZ",
|
8
8
|
"Type" : "String",
|
9
|
-
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c" ],
|
9
|
+
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c","us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e" ],
|
10
10
|
"ConstraintDescription" : "must select a valid availability zone."
|
11
11
|
},
|
12
12
|
"AZ2" : {
|
13
13
|
"Default" : "ap-northeast-1c",
|
14
14
|
"Description" : "AZ",
|
15
15
|
"Type" : "String",
|
16
|
-
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c" ],
|
16
|
+
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c","us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e" ],
|
17
17
|
"ConstraintDescription" : "must select a valid availability zone."
|
18
18
|
}
|
19
19
|
},
|
@@ -6,14 +6,14 @@
|
|
6
6
|
"Default" : "ap-northeast-1a",
|
7
7
|
"Description" : "AZ",
|
8
8
|
"Type" : "String",
|
9
|
-
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c" ],
|
9
|
+
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c","us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e" ],
|
10
10
|
"ConstraintDescription" : "must select a valid availability zone."
|
11
11
|
},
|
12
12
|
"AZ2" : {
|
13
13
|
"Default" : "ap-northeast-1c",
|
14
14
|
"Description" : "AZ",
|
15
15
|
"Type" : "String",
|
16
|
-
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c" ],
|
16
|
+
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c","us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e" ],
|
17
17
|
"ConstraintDescription" : "must select a valid availability zone."
|
18
18
|
}
|
19
19
|
},
|
@@ -6,14 +6,14 @@
|
|
6
6
|
"Default" : "ap-northeast-1a",
|
7
7
|
"Description" : "AZ",
|
8
8
|
"Type" : "String",
|
9
|
-
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c" ],
|
9
|
+
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c","us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e" ],
|
10
10
|
"ConstraintDescription" : "must select a valid availability zone."
|
11
11
|
},
|
12
12
|
"AZ2" : {
|
13
13
|
"Default" : "ap-northeast-1c",
|
14
14
|
"Description" : "AZ",
|
15
15
|
"Type" : "String",
|
16
|
-
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c" ],
|
16
|
+
"AllowedValues" : [ "ap-northeast-1a","ap-northeast-1c","us-west-2a","us-west-2b","us-west-2c","us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e" ],
|
17
17
|
"ConstraintDescription" : "must select a valid availability zone."
|
18
18
|
}
|
19
19
|
},
|
@@ -18,6 +18,20 @@ module CFM
|
|
18
18
|
},
|
19
19
|
]
|
20
20
|
end
|
21
|
+
|
22
|
+
def get_subnet_info(logical_resource_id,az)
|
23
|
+
info = {}
|
24
|
+
info[:subnet_id] = @cfm.describe_stack_resource({stack_name: @config.stack_name, logical_resource_id: logical_resource_id}).stack_resource_detail.physical_resource_id
|
25
|
+
info[:az] = az
|
26
|
+
info
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_subnet_infos
|
30
|
+
infos = []
|
31
|
+
infos << get_subnet_info('PrivateSubnet1a',@config.azs[0])
|
32
|
+
infos << get_subnet_info('PrivateSubnet1c',@config.azs[1])
|
33
|
+
infos
|
34
|
+
end
|
21
35
|
end
|
22
36
|
|
23
37
|
class TwoAzTwoPrivateSubnetVpcStub < VpcStub
|
@@ -18,6 +18,23 @@ module CFM
|
|
18
18
|
},
|
19
19
|
]
|
20
20
|
end
|
21
|
+
|
22
|
+
|
23
|
+
def get_subnet_info(logical_resource_id,az)
|
24
|
+
info = {}
|
25
|
+
info[:subnet_id] = @cfm.describe_stack_resource({stack_name: @config.stack_name, logical_resource_id: logical_resource_id}).stack_resource_detail.physical_resource_id
|
26
|
+
info[:az] = az
|
27
|
+
info
|
28
|
+
end
|
29
|
+
|
30
|
+
def get_subnet_infos
|
31
|
+
infos = []
|
32
|
+
infos << get_subnet_info('PublicSubnet1a',@config.azs[0])
|
33
|
+
infos << get_subnet_info('PublicSubnet1c',@config.azs[1])
|
34
|
+
infos << get_subnet_info('PrivateSubnet1a',@config.azs[0])
|
35
|
+
infos << get_subnet_info('PrivateSubnet1c',@config.azs[1])
|
36
|
+
infos
|
37
|
+
end
|
21
38
|
end
|
22
39
|
|
23
40
|
class TwoAzTwoPublicSubnetAndPrivateSubnetVpcStub < VpcStub
|
@@ -18,6 +18,21 @@ module CFM
|
|
18
18
|
},
|
19
19
|
]
|
20
20
|
end
|
21
|
+
|
22
|
+
|
23
|
+
def get_subnet_info(logical_resource_id,az)
|
24
|
+
info = {}
|
25
|
+
info[:subnet_id] = @cfm.describe_stack_resource({stack_name: @config.stack_name, logical_resource_id: logical_resource_id}).stack_resource_detail.physical_resource_id
|
26
|
+
info[:az] = az
|
27
|
+
info
|
28
|
+
end
|
29
|
+
|
30
|
+
def get_subnet_infos
|
31
|
+
infos = []
|
32
|
+
infos << get_subnet_info('PublicSubnet1a',@config.azs[0])
|
33
|
+
infos << get_subnet_info('PublicSubnet1c',@config.azs[1])
|
34
|
+
infos
|
35
|
+
end
|
21
36
|
end
|
22
37
|
|
23
38
|
class TwoAzTwoPublicSubnetVpcStub < VpcStub
|
@@ -84,116 +84,116 @@ namespace :EC2 do
|
|
84
84
|
|
85
85
|
desc '1つのアベイラビリティゾーンに1つのパブリックサブネットのVPC環境にEC2インスタンスを作成する'
|
86
86
|
task :create_type01 do
|
87
|
-
vpc =
|
87
|
+
vpc = CFM::OneAzOnePublicSubnetVpc.new
|
88
88
|
vpc.create
|
89
89
|
EC2::Ec2.new(vpc).create
|
90
90
|
end
|
91
91
|
|
92
92
|
desc '1つのアベイラビリティゾーンに1つのパブリックサブネットのVPC環境のEC2インスタンスを削除する'
|
93
93
|
task :destroy_type01_env do
|
94
|
-
vpc =
|
94
|
+
vpc = CFM::OneAzOnePublicSubnetVpc.new
|
95
95
|
EC2::Ec2.new(vpc).destroy
|
96
96
|
vpc.destroy
|
97
97
|
end
|
98
98
|
|
99
99
|
desc '1つのアベイラビリティゾーンに1つのパブリックサブネットのVPC環境にEC2インスタンスを停止する'
|
100
100
|
task :stop_type01 do
|
101
|
-
vpc =
|
101
|
+
vpc = CFM::OneAzOnePublicSubnetVpc.new
|
102
102
|
EC2::Ec2.new(vpc).stop
|
103
103
|
end
|
104
104
|
|
105
105
|
desc '1つのアベイラビリティゾーンに1つのパブリックサブネットのVPC環境にEC2インスタンスを起動する'
|
106
106
|
task :start_type01 do
|
107
|
-
vpc =
|
107
|
+
vpc = CFM::OneAzOnePublicSubnetVpc.new
|
108
108
|
EC2::Ec2.new(vpc).start
|
109
109
|
end
|
110
110
|
|
111
111
|
desc '1つのアベイラビリティゾーンに1つのパブリックサブネットのVPC環境にEC2インスタンスを再起動する'
|
112
112
|
task :reboot_type01 do
|
113
|
-
vpc =
|
113
|
+
vpc = CFM::OneAzOnePublicSubnetVpc.new
|
114
114
|
EC2::Ec2.new(vpc).reboot
|
115
115
|
end
|
116
116
|
|
117
117
|
desc '1つのアベイラビリティゾーンに2つのパブリックサブネットのVPC環境にEC2インスタンスを作成する'
|
118
118
|
task :create_type02 do
|
119
|
-
vpc =
|
119
|
+
vpc = CFM::OneAzTwoPublicSubnetVpc.new
|
120
120
|
vpc.create
|
121
121
|
EC2::Ec2.new(vpc).create
|
122
122
|
end
|
123
123
|
|
124
124
|
desc '1つのアベイラビリティゾーンに2つのパブリックサブネットのVPC環境のEC2インスタンスを削除する'
|
125
125
|
task :destroy_type02_env do
|
126
|
-
vpc =
|
126
|
+
vpc = CFM::OneAzTwoPublicSubnetVpc.new
|
127
127
|
EC2::Ec2.new(vpc).destroy
|
128
128
|
vpc.destroy
|
129
129
|
end
|
130
130
|
|
131
131
|
desc '1つのアベイラビリティゾーンに1つのパブリックサブネットと1つのプライベートサブネットのVPC環境にEC2インスタンスを作成する'
|
132
132
|
task :create_type03 do
|
133
|
-
vpc =
|
133
|
+
vpc = CFM::OneAzTwoPublicAndPrivateSubnetVpc.new
|
134
134
|
vpc.create
|
135
135
|
EC2::Ec2.new(vpc).create
|
136
136
|
end
|
137
137
|
|
138
138
|
desc '1つのアベイラビリティゾーンに1つのパブリックサブネットと1つのプライベートサブネットのVPC環境のEC2インスタンスを削除する'
|
139
139
|
task :destroy_type03_env do
|
140
|
-
vpc =
|
140
|
+
vpc = CFM::OneAzTwoPublicAndPrivateSubnetVpc.new
|
141
141
|
EC2::Ec2.new(vpc).destroy
|
142
142
|
vpc.destroy
|
143
143
|
end
|
144
144
|
|
145
145
|
desc '2つのアベイラビリティゾーンに2つのプライベートサブネットのVPC環境にEC2インスタンスを作成する'
|
146
146
|
task :create_type04 do
|
147
|
-
vpc =
|
147
|
+
vpc = CFM::TwoAzTwoPrivateSubnetVpc.new
|
148
148
|
vpc.create
|
149
149
|
EC2::Ec2.new(vpc).create
|
150
150
|
end
|
151
151
|
|
152
152
|
desc '2つのアベイラビリティゾーンに2つのプライベートサブネットのVPC環境のEC2インスタンスを削除する'
|
153
153
|
task :destroy_type04_env do
|
154
|
-
vpc =
|
154
|
+
vpc = CFM::TwoAzTwoPrivateSubnetVpc.new
|
155
155
|
EC2::Ec2.new(vpc).destroy
|
156
156
|
vpc.destroy
|
157
157
|
end
|
158
158
|
|
159
159
|
desc '2つのアベイラビリティゾーンに2つのパブリックサブネットのVPC環境にEC2インスタンスを作成する'
|
160
160
|
task :create_type05 do
|
161
|
-
vpc =
|
161
|
+
vpc = CFM::TwoAzTwoPublicSubnetVpc.new
|
162
162
|
vpc.create
|
163
163
|
EC2::Ec2.new(vpc).create
|
164
164
|
end
|
165
165
|
|
166
166
|
desc '2つのアベイラビリティゾーンに2つのパブリックサブネットのVPC環境のEC2インスタンスを削除する'
|
167
167
|
task :destroy_type05_env do
|
168
|
-
vpc =
|
168
|
+
vpc = CFM::TwoAzTwoPublicSubnetVpc.new
|
169
169
|
EC2::Ec2.new(vpc).destroy
|
170
170
|
vpc.destroy
|
171
171
|
end
|
172
172
|
|
173
173
|
desc '2つのアベイラビリティゾーンに1つのパブリックサブネットと1つのプライベートサブネットのVPC環境にEC2インスタンスを作成する'
|
174
174
|
task :create_type06 do
|
175
|
-
vpc =
|
175
|
+
vpc = CFM::TwoAzOnePublicSubnetAndPrivateSubnetVpc.new
|
176
176
|
vpc.create
|
177
177
|
EC2::Ec2.new(vpc).create
|
178
178
|
end
|
179
179
|
|
180
180
|
desc '2つのアベイラビリティゾーンに1つのパブリックサブネットと1つのプライベートサブネットのVPC環境のEC2インスタンスを削除する'
|
181
181
|
task :destroy_type06_env do
|
182
|
-
vpc =
|
182
|
+
vpc = CFM::TwoAzOnePublicSubnetAndPrivateSubnetVpc.new
|
183
183
|
EC2::Ec2.new(vpc).destroy
|
184
184
|
vpc.destroy
|
185
185
|
end
|
186
186
|
|
187
187
|
desc '2つのアベイラビリティゾーンに2つのパブリックサブネットと2つのプライベートサブネットのVPC環境にEC2インスタンスを作成する'
|
188
188
|
task :create_type07 do
|
189
|
-
vpc =
|
189
|
+
vpc = CFM::TwoAzTwoPublicSubnetAndPrivateSubnetVpc.new
|
190
190
|
vpc.create
|
191
191
|
EC2::Ec2.new(vpc).create
|
192
192
|
end
|
193
193
|
|
194
194
|
desc '2つのアベイラビリティゾーンに2つのパブリックサブネットと2つのプライベートサブネットVPCのVPC環境のEC2インスタンスを削除する'
|
195
195
|
task :destroy_type07_env do
|
196
|
-
vpc =
|
196
|
+
vpc = CFM::TwoAzTwoPublicSubnetAndPrivateSubnetVpc.new
|
197
197
|
EC2::Ec2.new(vpc).destroy
|
198
198
|
vpc.destroy
|
199
199
|
end
|
@@ -7,14 +7,6 @@ module VPC
|
|
7
7
|
@subnet_id = vpc.gateway.create_subnet(subnet_cidr_block,vpc.vpc_id,az)
|
8
8
|
end
|
9
9
|
|
10
|
-
def create_private(vpc)
|
11
|
-
@subnet_id = vpc.gateway.create_subnet(vpc.config.subnet_cidr_block_private,vpc.vpc_id,vpc.config.vpc_name)
|
12
|
-
end
|
13
|
-
|
14
|
-
def create_public(vpc)
|
15
|
-
@subnet_id = vpc.gateway.create_subnet(vpc.config.subnet_cidr_block_public,vpc.vpc_id,vpc.config.vpc_name)
|
16
|
-
end
|
17
|
-
|
18
10
|
def delete(vpc)
|
19
11
|
vpc.gateway.delete_subnet(@subnet_id)
|
20
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etude_for_aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k2works
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -210,13 +210,13 @@ files:
|
|
210
210
|
- exe/etude_for_aws
|
211
211
|
- lib/etude_for_aws.rb
|
212
212
|
- lib/etude_for_aws/cfm/configuration.rb
|
213
|
-
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-1az-1subnet-pub.
|
214
|
-
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-1az-2subnet-pub-pri.
|
215
|
-
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-1az-2subnet-pub.
|
216
|
-
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-2subnet-pri.
|
217
|
-
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-2subnet-pub-pri.
|
218
|
-
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-2subnet-pub.
|
219
|
-
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-4subnet-pub-pri.
|
213
|
+
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-1az-1subnet-pub.json
|
214
|
+
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-1az-2subnet-pub-pri.json
|
215
|
+
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-1az-2subnet-pub.json
|
216
|
+
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-2subnet-pri.json
|
217
|
+
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-2subnet-pub-pri.json
|
218
|
+
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-2subnet-pub.json
|
219
|
+
- lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-4subnet-pub-pri.json
|
220
220
|
- lib/etude_for_aws/cfm/vpc/null_vpc.rb
|
221
221
|
- lib/etude_for_aws/cfm/vpc/one_az_one_public_subnet_vpc.rb
|
222
222
|
- lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb
|