awspec 1.12.4 → 1.12.5
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/doc/_resource_types/vpc.md +9 -0
- data/doc/resource_types.md +24 -14
- data/lib/awspec/generator/spec/vpc.rb +8 -0
- data/lib/awspec/helper/finder/vpc.rb +27 -0
- data/lib/awspec/stub/vpc.rb +9 -0
- data/lib/awspec/type/vpc.rb +4 -0
- data/lib/awspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 797c0a76eedaac924e9fae9b797ef5aa145db194897b20a71e4d8b1d8c61572c
|
|
4
|
+
data.tar.gz: ea9b100cac9a2e284add01af86f01b081cfdb95a2654c8fe938f3714eedcc778
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 52e51107ea7b8c30ab9500e416ecd7d058853c890a403b48d6a8154356bcce0109b3762da60fc7ca3e7045c79805bb012ac764b42df018f6a6f51434c188ca08
|
|
7
|
+
data.tar.gz: 2be23ba27f8cb3b5bd907749b0ba60075b4729ab8e8d4f4d0992a16eb7be784ea6dab2d69b408e736a3b652a1fbd985a598d00576bceb074076d42b5b845cd31
|
data/doc/_resource_types/vpc.md
CHANGED
|
@@ -60,6 +60,15 @@ describe vpc('vpc-ab123cde') do
|
|
|
60
60
|
end
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
+
### have_vpc_attribute
|
|
64
|
+
|
|
65
|
+
```ruby
|
|
66
|
+
describe vpc('vpc-ab123cde') do
|
|
67
|
+
it { should have_vpc_attribute('enableDnsHostnames') }
|
|
68
|
+
it { should_not have_vpc_attribute('enableDnsSupport') }
|
|
69
|
+
end
|
|
70
|
+
```
|
|
71
|
+
|
|
63
72
|
### advanced
|
|
64
73
|
|
|
65
74
|
`vpc` can use `Aws::EC2::Vpc` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Vpc.html).
|
data/doc/resource_types.md
CHANGED
|
@@ -225,7 +225,7 @@ end
|
|
|
225
225
|
```
|
|
226
226
|
|
|
227
227
|
|
|
228
|
-
### its(:target_group_arn), its(:target_group_name), its(:protocol), its(:port), its(:vpc_id), its(:health_check_protocol), its(:health_check_port), its(:health_check_interval_seconds), its(:health_check_timeout_seconds), its(:healthy_threshold_count), its(:unhealthy_threshold_count), its(:health_check_path), its(:load_balancer_arns), its(:target_type)
|
|
228
|
+
### its(:target_group_arn), its(:target_group_name), its(:protocol), its(:port), its(:vpc_id), its(:health_check_protocol), its(:health_check_port), its(:health_check_enabled), its(:health_check_interval_seconds), its(:health_check_timeout_seconds), its(:healthy_threshold_count), its(:unhealthy_threshold_count), its(:health_check_path), its(:load_balancer_arns), its(:target_type)
|
|
229
229
|
## <a name="ami">ami</a>
|
|
230
230
|
|
|
231
231
|
AMI resource type.
|
|
@@ -608,7 +608,7 @@ CloudwatchEvent resource type.
|
|
|
608
608
|
|
|
609
609
|
### be_scheduled
|
|
610
610
|
|
|
611
|
-
### its(:name), its(:arn), its(:event_pattern), its(:state), its(:description), its(:schedule_expression), its(:role_arn)
|
|
611
|
+
### its(:name), its(:arn), its(:event_pattern), its(:state), its(:description), its(:schedule_expression), its(:role_arn), its(:managed_by)
|
|
612
612
|
## <a name="cloudwatch_logs">cloudwatch_logs</a>
|
|
613
613
|
|
|
614
614
|
CloudwatchLogs resource type.
|
|
@@ -768,7 +768,7 @@ end
|
|
|
768
768
|
```
|
|
769
769
|
|
|
770
770
|
|
|
771
|
-
### its(:table_name), its(:table_status), its(:creation_date_time), its(:table_size_bytes), its(:item_count), its(:table_arn), its(:table_id), its(:local_secondary_indexes), its(:global_secondary_indexes), its(:stream_specification), its(:latest_stream_label), its(:latest_stream_arn), its(:restore_summary), its(:sse_description)
|
|
771
|
+
### its(:table_name), its(:table_status), its(:creation_date_time), its(:table_size_bytes), its(:item_count), its(:table_arn), its(:table_id), its(:billing_mode_summary), its(:local_secondary_indexes), its(:global_secondary_indexes), its(:stream_specification), its(:latest_stream_label), its(:latest_stream_arn), its(:restore_summary), its(:sse_description)
|
|
772
772
|
### :unlock: Advanced use
|
|
773
773
|
|
|
774
774
|
`dynamodb_table` can use `Aws::DynamoDB::Table` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/DynamoDB/Table.html).
|
|
@@ -1014,7 +1014,7 @@ end
|
|
|
1014
1014
|
```
|
|
1015
1015
|
|
|
1016
1016
|
|
|
1017
|
-
### its(:ami_launch_index), its(:image_id), its(:instance_id), its(:instance_type), its(:kernel_id), its(:key_name), its(:launch_time), its(:monitoring), its(:placement), its(:platform), its(:private_dns_name), its(:private_ip_address), its(:product_codes), its(:public_dns_name), its(:public_ip_address), its(:ramdisk_id), its(:state_transition_reason), its(:subnet_id), its(:vpc_id), its(:architecture), its(:client_token), its(:ebs_optimized), its(:ena_support), its(:hypervisor), its(:instance_lifecycle), its(:elastic_gpu_associations), its(:root_device_name), its(:root_device_type), its(:source_dest_check), its(:spot_instance_request_id), its(:sriov_net_support), its(:state_reason), its(:virtualization_type), its(:cpu_options), its(:capacity_reservation_id), its(:capacity_reservation_specification)
|
|
1017
|
+
### its(:ami_launch_index), its(:image_id), its(:instance_id), its(:instance_type), its(:kernel_id), its(:key_name), its(:launch_time), its(:monitoring), its(:placement), its(:platform), its(:private_dns_name), its(:private_ip_address), its(:product_codes), its(:public_dns_name), its(:public_ip_address), its(:ramdisk_id), its(:state_transition_reason), its(:subnet_id), its(:vpc_id), its(:architecture), its(:client_token), its(:ebs_optimized), its(:ena_support), its(:hypervisor), its(:instance_lifecycle), its(:elastic_gpu_associations), its(:elastic_inference_accelerator_associations), its(:root_device_name), its(:root_device_type), its(:source_dest_check), its(:spot_instance_request_id), its(:sriov_net_support), its(:state_reason), its(:virtualization_type), its(:cpu_options), its(:capacity_reservation_id), its(:capacity_reservation_specification), its(:hibernation_options), its(:licenses)
|
|
1018
1018
|
### :unlock: Advanced use
|
|
1019
1019
|
|
|
1020
1020
|
`ec2` can use `Aws::EC2::Instance` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Instance.html).
|
|
@@ -1157,7 +1157,7 @@ describe ecs_service('my-ecs-service') do
|
|
|
1157
1157
|
end
|
|
1158
1158
|
```
|
|
1159
1159
|
|
|
1160
|
-
### its(:service_arn), its(:service_name), its(:cluster_arn), its(:load_balancers), its(:service_registries), its(:status), its(:desired_count), its(:running_count), its(:pending_count), its(:launch_type), its(:platform_version), its(:task_definition), its(:role_arn), its(:created_at), its(:placement_constraints), its(:placement_strategy), its(:network_configuration), its(:health_check_grace_period_seconds), its(:scheduling_strategy), its(:tags), its(:created_by), its(:enable_ecs_managed_tags), its(:propagate_tags)
|
|
1160
|
+
### its(:service_arn), its(:service_name), its(:cluster_arn), its(:load_balancers), its(:service_registries), its(:status), its(:desired_count), its(:running_count), its(:pending_count), its(:launch_type), its(:platform_version), its(:task_definition), its(:task_sets), its(:role_arn), its(:created_at), its(:placement_constraints), its(:placement_strategy), its(:network_configuration), its(:health_check_grace_period_seconds), its(:scheduling_strategy), its(:deployment_controller), its(:tags), its(:created_by), its(:enable_ecs_managed_tags), its(:propagate_tags)
|
|
1161
1161
|
## <a name="ecs_task_definition">ecs_task_definition</a>
|
|
1162
1162
|
|
|
1163
1163
|
ECS Task Definition resource type.
|
|
@@ -1909,7 +1909,7 @@ describe internet_gateway('igw-1ab2cd3e') do
|
|
|
1909
1909
|
end
|
|
1910
1910
|
```
|
|
1911
1911
|
|
|
1912
|
-
### its(:internet_gateway_id)
|
|
1912
|
+
### its(:internet_gateway_id), its(:owner_id)
|
|
1913
1913
|
## <a name="kinesis">kinesis</a>
|
|
1914
1914
|
|
|
1915
1915
|
Kinesis resource type.
|
|
@@ -2000,7 +2000,7 @@ DOC
|
|
|
2000
2000
|
end
|
|
2001
2001
|
```
|
|
2002
2002
|
|
|
2003
|
-
### its(:aws_account_id), its(:key_id), its(:arn), its(:creation_date), its(:enabled), its(:description), its(:key_usage), its(:key_state), its(:deletion_date), its(:valid_to), its(:origin), its(:expiration_model), its(:key_manager)
|
|
2003
|
+
### its(:aws_account_id), its(:key_id), its(:arn), its(:creation_date), its(:enabled), its(:description), its(:key_usage), its(:key_state), its(:deletion_date), its(:valid_to), its(:origin), its(:custom_key_store_id), its(:cloud_hsm_cluster_id), its(:expiration_model), its(:key_manager)
|
|
2004
2004
|
## <a name="lambda">lambda</a>
|
|
2005
2005
|
|
|
2006
2006
|
Lambda resource type.
|
|
@@ -2018,7 +2018,7 @@ end
|
|
|
2018
2018
|
|
|
2019
2019
|
This matcher does not support Amazon S3 event sources. ( [See SDK doc](http://docs.aws.amazon.com/sdkforruby/api/Aws/Lambda/Client.html#list_event_source_mappings-instance_method) )
|
|
2020
2020
|
|
|
2021
|
-
### its(:function_name), its(:function_arn), its(:runtime), its(:role), its(:handler), its(:code_size), its(:description), its(:timeout), its(:memory_size), its(:last_modified), its(:code_sha_256), its(:version), its(:vpc_config), its(:dead_letter_config), its(:environment), its(:kms_key_arn), its(:tracing_config), its(:master_arn), its(:revision_id)
|
|
2021
|
+
### its(:function_name), its(:function_arn), its(:runtime), its(:role), its(:handler), its(:code_size), its(:description), its(:timeout), its(:memory_size), its(:last_modified), its(:code_sha_256), its(:version), its(:vpc_config), its(:dead_letter_config), its(:environment), its(:kms_key_arn), its(:tracing_config), its(:master_arn), its(:revision_id), its(:layers)
|
|
2022
2022
|
## <a name="launch_configuration">launch_configuration</a>
|
|
2023
2023
|
|
|
2024
2024
|
LaunchConfiguration resource type.
|
|
@@ -2136,7 +2136,7 @@ end
|
|
|
2136
2136
|
```
|
|
2137
2137
|
|
|
2138
2138
|
|
|
2139
|
-
### its(:inbound_entries_count), its(:outbound_entries_count), its(:is_default), its(:network_acl_id), its(:vpc_id)
|
|
2139
|
+
### its(:inbound_entries_count), its(:outbound_entries_count), its(:is_default), its(:network_acl_id), its(:vpc_id), its(:owner_id)
|
|
2140
2140
|
### :unlock: Advanced use
|
|
2141
2141
|
|
|
2142
2142
|
`network_acl` can use `Aws::EC2::NetworkAcl` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/NetworkAcl.html).
|
|
@@ -2364,7 +2364,7 @@ end
|
|
|
2364
2364
|
```
|
|
2365
2365
|
|
|
2366
2366
|
|
|
2367
|
-
### its(:target_group_arn), its(:target_group_name), its(:protocol), its(:port), its(:vpc_id), its(:health_check_protocol), its(:health_check_port), its(:health_check_interval_seconds), its(:health_check_timeout_seconds), its(:healthy_threshold_count), its(:unhealthy_threshold_count), its(:health_check_path), its(:load_balancer_arns), its(:target_type)
|
|
2367
|
+
### its(:target_group_arn), its(:target_group_name), its(:protocol), its(:port), its(:vpc_id), its(:health_check_protocol), its(:health_check_port), its(:health_check_enabled), its(:health_check_interval_seconds), its(:health_check_timeout_seconds), its(:healthy_threshold_count), its(:unhealthy_threshold_count), its(:health_check_path), its(:load_balancer_arns), its(:target_type)
|
|
2368
2368
|
## <a name="rds">rds</a>
|
|
2369
2369
|
|
|
2370
2370
|
RDS resource type.
|
|
@@ -2597,7 +2597,7 @@ end
|
|
|
2597
2597
|
```
|
|
2598
2598
|
|
|
2599
2599
|
|
|
2600
|
-
### its(:propagating_vgws), its(:route_table_id), its(:vpc_id)
|
|
2600
|
+
### its(:propagating_vgws), its(:route_table_id), its(:vpc_id), its(:owner_id)
|
|
2601
2601
|
### :unlock: Advanced use
|
|
2602
2602
|
|
|
2603
2603
|
`route_table` can use `Aws::EC2::RouteTable` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/RouteTable.html).
|
|
@@ -3033,7 +3033,7 @@ end
|
|
|
3033
3033
|
```
|
|
3034
3034
|
|
|
3035
3035
|
|
|
3036
|
-
### its(:availability_zone), its(:available_ip_address_count), its(:cidr_block), its(:default_for_az), its(:map_public_ip_on_launch), its(:state), its(:subnet_id), its(:vpc_id), its(:assign_ipv_6_address_on_creation), its(:ipv_6_cidr_block_association_set)
|
|
3036
|
+
### its(:availability_zone), its(:availability_zone_id), its(:available_ip_address_count), its(:cidr_block), its(:default_for_az), its(:map_public_ip_on_launch), its(:state), its(:subnet_id), its(:vpc_id), its(:owner_id), its(:assign_ipv_6_address_on_creation), its(:ipv_6_cidr_block_association_set), its(:subnet_arn)
|
|
3037
3037
|
### :unlock: Advanced use
|
|
3038
3038
|
|
|
3039
3039
|
`subnet` can use `Aws::EC2::Subnet` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Subnet.html).
|
|
@@ -3114,6 +3114,16 @@ end
|
|
|
3114
3114
|
```
|
|
3115
3115
|
|
|
3116
3116
|
|
|
3117
|
+
### have_vpc_attribute
|
|
3118
|
+
|
|
3119
|
+
```ruby
|
|
3120
|
+
describe vpc('vpc-ab123cde') do
|
|
3121
|
+
it { should have_vpc_attribute('enableDnsHostnames') }
|
|
3122
|
+
it { should_not have_vpc_attribute('enableDnsSupport') }
|
|
3123
|
+
end
|
|
3124
|
+
```
|
|
3125
|
+
|
|
3126
|
+
|
|
3117
3127
|
### have_vpc_peering_connection
|
|
3118
3128
|
|
|
3119
3129
|
```ruby
|
|
@@ -3125,7 +3135,7 @@ end
|
|
|
3125
3135
|
```
|
|
3126
3136
|
|
|
3127
3137
|
|
|
3128
|
-
### its(:cidr_block), its(:dhcp_options_id), its(:state), its(:vpc_id), its(:instance_tenancy), its(:ipv_6_cidr_block_association_set), its(:cidr_block_association_set), its(:is_default)
|
|
3138
|
+
### its(:cidr_block), its(:dhcp_options_id), its(:state), its(:vpc_id), its(:owner_id), its(:instance_tenancy), its(:ipv_6_cidr_block_association_set), its(:cidr_block_association_set), its(:is_default)
|
|
3129
3139
|
### :unlock: Advanced use
|
|
3130
3140
|
|
|
3131
3141
|
`vpc` can use `Aws::EC2::Vpc` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Vpc.html).
|
|
@@ -3175,7 +3185,7 @@ end
|
|
|
3175
3185
|
```
|
|
3176
3186
|
|
|
3177
3187
|
|
|
3178
|
-
### its(:customer_gateway_configuration), its(:customer_gateway_id), its(:category), its(:state), its(:type), its(:vpn_connection_id), its(:vpn_gateway_id), its(:options), its(:routes), its(:vgw_telemetry)
|
|
3188
|
+
### its(:customer_gateway_configuration), its(:customer_gateway_id), its(:category), its(:state), its(:type), its(:vpn_connection_id), its(:vpn_gateway_id), its(:transit_gateway_id), its(:options), its(:routes), its(:vgw_telemetry)
|
|
3179
3189
|
## <a name="vpn_gateway">vpn_gateway</a>
|
|
3180
3190
|
|
|
3181
3191
|
VpnGateway resource type.
|
|
@@ -12,6 +12,7 @@ module Awspec::Generator
|
|
|
12
12
|
@vpc_tag_name = vpc.tag_name
|
|
13
13
|
route_tables = select_route_table_by_vpc_id(@vpc_id)
|
|
14
14
|
network_acls = select_network_acl_by_vpc_id(@vpc_id)
|
|
15
|
+
vpc_attributes = select_vpc_attribute(@vpc_id)
|
|
15
16
|
spec = ERB.new(vpc_spec_template, nil, '-').result(binding).gsub(/^\n/, '')
|
|
16
17
|
end
|
|
17
18
|
|
|
@@ -48,6 +49,13 @@ describe vpc('<%= @vpc_id %>') do
|
|
|
48
49
|
it { should have_network_acl('<%= network_acl.network_acl_id %>') }
|
|
49
50
|
<%- end -%>
|
|
50
51
|
<% end %>
|
|
52
|
+
<% vpc_attributes.each do |vpc_attribute| %>
|
|
53
|
+
<%- if vpc_attribute[1] -%>
|
|
54
|
+
it { should have_vpc_attribute('<%= vpc_attribute[0] %>') }
|
|
55
|
+
<%- else -%>
|
|
56
|
+
it { should_not have_vpc_attribute('<%= vpc_attribute[0] %>') }
|
|
57
|
+
<%- end -%>
|
|
58
|
+
<% end %>
|
|
51
59
|
end
|
|
52
60
|
EOF
|
|
53
61
|
template
|
|
@@ -83,6 +83,33 @@ module Awspec::Helper
|
|
|
83
83
|
conn.accepter_vpc_info.vpc_id == vpc_id || conn.requester_vpc_info.vpc_id == vpc_id
|
|
84
84
|
end
|
|
85
85
|
end
|
|
86
|
+
|
|
87
|
+
def find_vpc_attribute(vpc_id, vpc_attribute)
|
|
88
|
+
res = ec2_client.describe_vpc_attribute({ vpc_id: vpc_id, attribute: vpc_attribute })
|
|
89
|
+
case vpc_attribute
|
|
90
|
+
when 'enableDnsSupport' then
|
|
91
|
+
res.enable_dns_support.value
|
|
92
|
+
when 'enableDnsHostnames' then
|
|
93
|
+
res.enable_dns_hostnames.value
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def select_vpc_attribute(vpc_id)
|
|
98
|
+
attributes = {}
|
|
99
|
+
vpc_attributes = %w(
|
|
100
|
+
enableDnsHostnames enableDnsSupport
|
|
101
|
+
)
|
|
102
|
+
vpc_attributes.each do |vpc_attribute|
|
|
103
|
+
res = ec2_client.describe_vpc_attribute({ vpc_id: vpc_id, attribute: vpc_attribute })
|
|
104
|
+
attributes[vpc_attribute] = case vpc_attribute
|
|
105
|
+
when 'enableDnsHostnames' then
|
|
106
|
+
res.enable_dns_hostnames.value
|
|
107
|
+
when 'enableDnsSupport' then
|
|
108
|
+
res.enable_dns_support.value
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
attributes
|
|
112
|
+
end
|
|
86
113
|
end
|
|
87
114
|
end
|
|
88
115
|
end
|
data/lib/awspec/stub/vpc.rb
CHANGED
data/lib/awspec/type/vpc.rb
CHANGED
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: 1.12.
|
|
4
|
+
version: 1.12.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- k1LoW
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-12-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sdk
|