awspec 0.67.1 → 0.68.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/_resource_types/internet_gateway.md +31 -0
- data/doc/resource_types.md +40 -0
- data/lib/awspec/generator/doc/type/internet_gateway.rb +17 -0
- data/lib/awspec/helper/type.rb +1 -1
- data/lib/awspec/stub/internet_gateway.rb +36 -0
- data/lib/awspec/type/internet_gateway.rb +20 -0
- data/lib/awspec/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b54ccb76f4f7552af0669f8601aef1613b3a8a56
|
4
|
+
data.tar.gz: 9c6e25842c3214e6df98a7707e7331bc66511f43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c82ae09fa349e9fda1b0b91c31c0398ff98d42f65c8500bd194a5f8bcd36f73884da6c8f2d69d9fcbbcb6d549b6bc6029515ed81f6799d428827359d10866494
|
7
|
+
data.tar.gz: d8071de75c566361e665d87a6a9ab78815c45a063a31eef5b944bb2ba6d1dc4770f63ef90324da625b77bbcaf373ce1d35abbcf100f5addcb44f3161606a32cc
|
@@ -0,0 +1,31 @@
|
|
1
|
+
### exist
|
2
|
+
|
3
|
+
```ruby
|
4
|
+
describe internet_gateway('igw-1ab2cd3e') do
|
5
|
+
it { should exist }
|
6
|
+
end
|
7
|
+
|
8
|
+
describe internet_gateway('my-internet-gateway') do
|
9
|
+
it { should exist }
|
10
|
+
end
|
11
|
+
```
|
12
|
+
|
13
|
+
### be_attached_to
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
describe internet_gateway('igw-1ab2cd3e') do
|
17
|
+
it { should be_attached_to('vpc-ab123cde') }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe internet_gateway('igw-1ab2cd3e') do
|
21
|
+
it { should be_attached_to('my-vpc') }
|
22
|
+
end
|
23
|
+
```
|
24
|
+
|
25
|
+
### have_tag
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
describe internet_gateway('igw-1ab2cd3e') do
|
29
|
+
it { should have_tag('Name').value('my-internet-gateway') }
|
30
|
+
end
|
31
|
+
```
|
data/doc/resource_types.md
CHANGED
@@ -45,6 +45,7 @@
|
|
45
45
|
| [customer_gateway](#customer_gateway)
|
46
46
|
| [vpn_gateway](#vpn_gateway)
|
47
47
|
| [vpn_connection](#vpn_connection)
|
48
|
+
| [internet_gateway](#internet_gateway)
|
48
49
|
|
49
50
|
## <a name="alb">alb</a>
|
50
51
|
|
@@ -2176,3 +2177,42 @@ end
|
|
2176
2177
|
|
2177
2178
|
|
2178
2179
|
### its(:vpn_connection_id), its(:state), its(:customer_gateway_configuration), its(:type), its(:customer_gateway_id), its(:vpn_gateway_id), its(:options)
|
2180
|
+
## <a name="internet_gateway">internet_gateway</a>
|
2181
|
+
|
2182
|
+
InternetGateway resource type.
|
2183
|
+
|
2184
|
+
### exist
|
2185
|
+
|
2186
|
+
```ruby
|
2187
|
+
describe internet_gateway('igw-1ab2cd3e') do
|
2188
|
+
it { should exist }
|
2189
|
+
end
|
2190
|
+
|
2191
|
+
describe internet_gateway('my-internet-gateway') do
|
2192
|
+
it { should exist }
|
2193
|
+
end
|
2194
|
+
```
|
2195
|
+
|
2196
|
+
|
2197
|
+
### be_attached_to
|
2198
|
+
|
2199
|
+
```ruby
|
2200
|
+
describe internet_gateway('igw-1ab2cd3e') do
|
2201
|
+
it { should be_attached_to('vpc-ab123cde') }
|
2202
|
+
end
|
2203
|
+
|
2204
|
+
describe internet_gateway('igw-1ab2cd3e') do
|
2205
|
+
it { should be_attached_to('my-vpc') }
|
2206
|
+
end
|
2207
|
+
```
|
2208
|
+
|
2209
|
+
|
2210
|
+
### have_tag
|
2211
|
+
|
2212
|
+
```ruby
|
2213
|
+
describe internet_gateway('igw-1ab2cd3e') do
|
2214
|
+
it { should have_tag('Name').value('my-internet-gateway') }
|
2215
|
+
end
|
2216
|
+
```
|
2217
|
+
|
2218
|
+
### its(:internet_gateway_id)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Awspec::Generator
|
2
|
+
module Doc
|
3
|
+
module Type
|
4
|
+
class InternetGateway < Base
|
5
|
+
def initialize
|
6
|
+
super
|
7
|
+
@type_name = 'InternetGateway'
|
8
|
+
@type = Awspec::Type::InternetGateway.new('my-internet-gateway')
|
9
|
+
@ret = @type.resource_via_client
|
10
|
+
@matchers = []
|
11
|
+
@ignore_matchers = []
|
12
|
+
@describes = []
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/awspec/helper/type.rb
CHANGED
@@ -10,7 +10,7 @@ module Awspec
|
|
10
10
|
iam_policy iam_role iam_user kms lambda launch_configuration nat_gateway
|
11
11
|
network_acl network_interface rds rds_db_cluster_parameter_group rds_db_parameter_group route53_hosted_zone
|
12
12
|
route_table s3_bucket security_group ses_identity subnet vpc cloudfront_distribution
|
13
|
-
elastictranscoder_pipeline waf_web_acl customer_gateway vpn_gateway vpn_connection
|
13
|
+
elastictranscoder_pipeline waf_web_acl customer_gateway vpn_gateway vpn_connection internet_gateway
|
14
14
|
)
|
15
15
|
|
16
16
|
TYPES.each do |type|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
Aws.config[:ec2] = {
|
2
|
+
stub_responses: {
|
3
|
+
describe_internet_gateways: {
|
4
|
+
internet_gateways: [
|
5
|
+
internet_gateway_id: 'igw-1ab2cd3e',
|
6
|
+
attachments: [
|
7
|
+
{
|
8
|
+
vpc_id: 'vpc-ab123cde',
|
9
|
+
state: 'attached'
|
10
|
+
}
|
11
|
+
],
|
12
|
+
tags: [
|
13
|
+
{
|
14
|
+
key: 'Name',
|
15
|
+
value: 'my-internet-gateway'
|
16
|
+
}
|
17
|
+
]
|
18
|
+
]
|
19
|
+
},
|
20
|
+
describe_vpcs: {
|
21
|
+
vpcs: [
|
22
|
+
{
|
23
|
+
vpc_id: 'vpc-ab123cde',
|
24
|
+
state: 'available',
|
25
|
+
cidr_block: '10.0.0.0/16',
|
26
|
+
tags: [
|
27
|
+
{
|
28
|
+
key: 'Name',
|
29
|
+
value: 'my-vpc'
|
30
|
+
}
|
31
|
+
]
|
32
|
+
}
|
33
|
+
]
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class InternetGateway < Base
|
3
|
+
aws_resource Aws::EC2::InternetGateway
|
4
|
+
tags_allowed
|
5
|
+
|
6
|
+
def resource_via_client
|
7
|
+
@resource_via_client ||= find_internet_gateway(@display_name)
|
8
|
+
end
|
9
|
+
|
10
|
+
def id
|
11
|
+
@id ||= resource_via_client.internet_gateway_id if resource_via_client
|
12
|
+
end
|
13
|
+
|
14
|
+
def attached_to?(vpc)
|
15
|
+
resource_via_client.attachments.find do |a|
|
16
|
+
a.vpc_id == find_vpc(vpc).vpc_id && a.state == 'attached'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/awspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.68.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -230,6 +230,7 @@ files:
|
|
230
230
|
- doc/_resource_types/iam_policy.md
|
231
231
|
- doc/_resource_types/iam_role.md
|
232
232
|
- doc/_resource_types/iam_user.md
|
233
|
+
- doc/_resource_types/internet_gateway.md
|
233
234
|
- doc/_resource_types/kms.md
|
234
235
|
- doc/_resource_types/lambda.md
|
235
236
|
- doc/_resource_types/launch_configuration.md
|
@@ -288,6 +289,7 @@ files:
|
|
288
289
|
- lib/awspec/generator/doc/type/iam_policy.rb
|
289
290
|
- lib/awspec/generator/doc/type/iam_role.rb
|
290
291
|
- lib/awspec/generator/doc/type/iam_user.rb
|
292
|
+
- lib/awspec/generator/doc/type/internet_gateway.rb
|
291
293
|
- lib/awspec/generator/doc/type/kms.rb
|
292
294
|
- lib/awspec/generator/doc/type/lambda.rb
|
293
295
|
- lib/awspec/generator/doc/type/launch_configuration.rb
|
@@ -419,6 +421,7 @@ files:
|
|
419
421
|
- lib/awspec/stub/iam_policy.rb
|
420
422
|
- lib/awspec/stub/iam_role.rb
|
421
423
|
- lib/awspec/stub/iam_user.rb
|
424
|
+
- lib/awspec/stub/internet_gateway.rb
|
422
425
|
- lib/awspec/stub/kms.rb
|
423
426
|
- lib/awspec/stub/lambda.rb
|
424
427
|
- lib/awspec/stub/launch_configuration.rb
|
@@ -466,6 +469,7 @@ files:
|
|
466
469
|
- lib/awspec/type/iam_policy.rb
|
467
470
|
- lib/awspec/type/iam_role.rb
|
468
471
|
- lib/awspec/type/iam_user.rb
|
472
|
+
- lib/awspec/type/internet_gateway.rb
|
469
473
|
- lib/awspec/type/kms.rb
|
470
474
|
- lib/awspec/type/lambda.rb
|
471
475
|
- lib/awspec/type/launch_configuration.rb
|