awspec 0.55.0 → 0.56.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 +4 -4
- data/lib/awspec.rb +1 -0
- data/lib/awspec/generator/template.rb +6 -3
- data/lib/awspec/shared_context.rb +11 -0
- data/lib/awspec/type/ami.rb +7 -5
- data/lib/awspec/type/autoscaling_group.rb +8 -6
- data/lib/awspec/type/base.rb +15 -7
- data/lib/awspec/type/cloudfront_distribution.rb +8 -6
- data/lib/awspec/type/cloudtrail.rb +10 -8
- data/lib/awspec/type/cloudwatch_alarm.rb +9 -7
- data/lib/awspec/type/cloudwatch_event.rb +8 -6
- data/lib/awspec/type/directconnect_virtual_interface.rb +11 -4
- data/lib/awspec/type/ebs.rb +14 -7
- data/lib/awspec/type/ec2.rb +20 -13
- data/lib/awspec/type/elasticache.rb +13 -6
- data/lib/awspec/type/elasticache_cache_parameter_group.rb +15 -8
- data/lib/awspec/type/elasticsearch.rb +9 -7
- data/lib/awspec/type/elastictranscoder_pipeline.rb +7 -5
- data/lib/awspec/type/elb.rb +11 -9
- data/lib/awspec/type/iam_group.rb +8 -6
- data/lib/awspec/type/iam_policy.rb +8 -6
- data/lib/awspec/type/iam_role.rb +8 -6
- data/lib/awspec/type/iam_user.rb +8 -6
- data/lib/awspec/type/kms.rb +8 -6
- data/lib/awspec/type/lambda.rb +8 -6
- data/lib/awspec/type/launch_configuration.rb +7 -5
- data/lib/awspec/type/nat_gateway.rb +8 -6
- data/lib/awspec/type/network_acl.rb +10 -8
- data/lib/awspec/type/network_interface.rb +14 -12
- data/lib/awspec/type/rds.rb +14 -12
- data/lib/awspec/type/rds_db_cluster_parameter_group.rb +13 -9
- data/lib/awspec/type/rds_db_parameter_group.rb +13 -9
- data/lib/awspec/type/route53_hosted_zone.rb +11 -7
- data/lib/awspec/type/route_table.rb +8 -6
- data/lib/awspec/type/s3_bucket.rb +15 -13
- data/lib/awspec/type/security_group.rb +14 -13
- data/lib/awspec/type/ses_identity.rb +15 -13
- data/lib/awspec/type/subnet.rb +7 -5
- data/lib/awspec/type/vpc.rb +13 -11
- data/lib/awspec/type/waf_web_acl.rb +8 -6
- data/lib/awspec/version.rb +1 -1
- metadata +3 -2
@@ -1,14 +1,16 @@
|
|
1
1
|
module Awspec::Type
|
2
2
|
class SesIdentity < Base
|
3
|
-
def
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
def resource_via_client
|
4
|
+
@resource_via_client ||= find_ses_identity(@display_name)
|
5
|
+
end
|
6
|
+
|
7
|
+
def id
|
8
|
+
@id ||= resource_via_client if resource_via_client
|
7
9
|
end
|
8
10
|
|
9
11
|
def has_identity_policy?(name)
|
10
12
|
res = ses_client.list_identity_policies({
|
11
|
-
identity:
|
13
|
+
identity: id
|
12
14
|
})
|
13
15
|
res.policy_names.find do |policy_name|
|
14
16
|
policy_name == name
|
@@ -23,17 +25,17 @@ module Awspec::Type
|
|
23
25
|
dkim_attributes.each do |attribute|
|
24
26
|
define_method attribute do
|
25
27
|
res = ses_client.get_identity_dkim_attributes({
|
26
|
-
identities: [
|
28
|
+
identities: [id]
|
27
29
|
})
|
28
|
-
res.dkim_attributes[
|
30
|
+
res.dkim_attributes[id][attribute.to_sym]
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
32
34
|
def has_dkim_tokens?(token)
|
33
35
|
res = ses_client.get_identity_dkim_attributes({
|
34
|
-
identities: [
|
36
|
+
identities: [id]
|
35
37
|
})
|
36
|
-
res.dkim_attributes[
|
38
|
+
res.dkim_attributes[id][:tokens].include?(token)
|
37
39
|
end
|
38
40
|
|
39
41
|
# notification_attributes
|
@@ -45,9 +47,9 @@ module Awspec::Type
|
|
45
47
|
notification_attributes.each do |attribute|
|
46
48
|
define_method attribute do
|
47
49
|
res = ses_client.get_identity_notification_attributes({
|
48
|
-
identities: [
|
50
|
+
identities: [id]
|
49
51
|
})
|
50
|
-
res.notification_attributes[
|
52
|
+
res.notification_attributes[id][attribute.to_sym]
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
@@ -59,9 +61,9 @@ module Awspec::Type
|
|
59
61
|
verification_attributes.each do |attribute|
|
60
62
|
define_method attribute do
|
61
63
|
res = ses_client.get_identity_verification_attributes({
|
62
|
-
identities: [
|
64
|
+
identities: [id]
|
63
65
|
})
|
64
|
-
res.verification_attributes[
|
66
|
+
res.verification_attributes[id][attribute.to_sym]
|
65
67
|
end
|
66
68
|
end
|
67
69
|
end
|
data/lib/awspec/type/subnet.rb
CHANGED
@@ -3,10 +3,12 @@ module Awspec::Type
|
|
3
3
|
aws_resource Aws::EC2::Subnet
|
4
4
|
tags_allowed
|
5
5
|
|
6
|
-
def
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
def resource_via_client
|
7
|
+
@resource_via_client ||= find_subnet(@display_name)
|
8
|
+
end
|
9
|
+
|
10
|
+
def id
|
11
|
+
@id ||= resource_via_client.subnet_id if resource_via_client
|
10
12
|
end
|
11
13
|
|
12
14
|
STATES = %w(
|
@@ -15,7 +17,7 @@ module Awspec::Type
|
|
15
17
|
|
16
18
|
STATES.each do |state|
|
17
19
|
define_method state + '?' do
|
18
|
-
|
20
|
+
resource_via_client.state == state
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
data/lib/awspec/type/vpc.rb
CHANGED
@@ -3,10 +3,12 @@ module Awspec::Type
|
|
3
3
|
aws_resource Aws::EC2::Vpc
|
4
4
|
tags_allowed
|
5
5
|
|
6
|
-
def
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
def resource_via_client
|
7
|
+
@resource_via_client ||= find_vpc(@display_name)
|
8
|
+
end
|
9
|
+
|
10
|
+
def id
|
11
|
+
@id ||= resource_via_client.vpc_id if resource_via_client
|
10
12
|
end
|
11
13
|
|
12
14
|
STATES = %w(
|
@@ -15,20 +17,20 @@ module Awspec::Type
|
|
15
17
|
|
16
18
|
STATES.each do |state|
|
17
19
|
define_method state + '?' do
|
18
|
-
|
20
|
+
resource_via_client.state == state
|
19
21
|
end
|
20
22
|
end
|
21
23
|
|
22
|
-
def has_route_table?(
|
23
|
-
route_table = find_route_table(
|
24
|
+
def has_route_table?(table_id)
|
25
|
+
route_table = find_route_table(table_id)
|
24
26
|
return false unless route_table
|
25
|
-
route_table.vpc_id ==
|
27
|
+
route_table.vpc_id == id
|
26
28
|
end
|
27
29
|
|
28
|
-
def has_network_acl?(
|
29
|
-
n = find_network_acl(
|
30
|
+
def has_network_acl?(table_id)
|
31
|
+
n = find_network_acl(table_id)
|
30
32
|
return false unless n
|
31
|
-
n.vpc_id ==
|
33
|
+
n.vpc_id == id
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
@@ -1,17 +1,19 @@
|
|
1
1
|
module Awspec::Type
|
2
2
|
class WafWebAcl < Base
|
3
|
-
def
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
def resource_via_client
|
4
|
+
@resource_via_client ||= find_waf_web_acl(@display_name)
|
5
|
+
end
|
6
|
+
|
7
|
+
def id
|
8
|
+
@id ||= resource_via_client.web_acl_id if resource_via_client
|
7
9
|
end
|
8
10
|
|
9
11
|
def default_action
|
10
|
-
|
12
|
+
resource_via_client.default_action.type
|
11
13
|
end
|
12
14
|
|
13
15
|
def has_rule?(rule_id, priority = nil, action = nil)
|
14
|
-
|
16
|
+
resource_via_client.rules.find do |rule|
|
15
17
|
next false if !priority.nil? && rule.priority != priority
|
16
18
|
next false if !action.nil? && rule.action.type != action
|
17
19
|
next true if rule.rule_id == rule_id
|
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.56.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -364,6 +364,7 @@ files:
|
|
364
364
|
- lib/awspec/matcher/have_tag.rb
|
365
365
|
- lib/awspec/resource_reader.rb
|
366
366
|
- lib/awspec/setup.rb
|
367
|
+
- lib/awspec/shared_context.rb
|
367
368
|
- lib/awspec/stub.rb
|
368
369
|
- lib/awspec/stub/ami.rb
|
369
370
|
- lib/awspec/stub/autoscaling_group.rb
|