awspec 0.81.1 → 0.82.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56466cd39f5a8aefbc705c2cb8b5352ae18c9691
4
- data.tar.gz: 6a6fb6651bd61ca56c0e2acfddcd4471bd202a29
3
+ metadata.gz: 7bf3b3b5b1169aa506af43ab8313049de7108685
4
+ data.tar.gz: 288116aac0f59e7afc2140c62991d4fcebd0c6d8
5
5
  SHA512:
6
- metadata.gz: e9f23efd10847ac1542b8daef0ed0fd14950fd8f2744a1ca347b17fe1fba99214bf6332e9093388f409ba4fc4b6c8094965b59eba73ce259ab55f1f0a5703040
7
- data.tar.gz: 4927d95c31066bca4d88984f8c48dc6a34a9070fa52caddaa92f6373c39611d4b9318434412053e8d2b5c8dce7b60e53354139ef991b6b0ef8deea67efa51c93
6
+ metadata.gz: eb0ee16cbc5441eb85bf1ee0d1e6fc38175064abb48ac105ce93e68635af85ab878ccb42814b06168ad487d6dd48ecad924ed9211cf44edaa9f797170849b64a
7
+ data.tar.gz: b6c4783251da19a5ba6a15b57122cdd35f5d46645efad4f97f082ac557eaa88b2abb975aab8ee26742b13b95460d210dd6c02a850fd7dd8231abc02ee4010a6c
@@ -79,6 +79,8 @@ describe s3_bucket('my-bucket') do
79
79
  should have_lifecycle_rule(
80
80
  id: 'MyRuleName',
81
81
  noncurrent_version_expiration: { noncurrent_days: 1 },
82
+ expiration: { days: 2 },
83
+ transitions: { days: 3, storage_class: 'GLACIER' },
82
84
  status: 'Enabled'
83
85
  )
84
86
  end
@@ -0,0 +1,9 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe sqs('my-queue') do
5
+ it { should exist }
6
+ its(:queue_url) { should eq 'https://sqs.ap-northeast-1.amazonaws.com/123456789012/my-queue' }
7
+ its(:queue_arn) { should eq 'arn:aws:sqs:ap-northeast-1:123456789012:my-queue' }
8
+ end
9
+ ```
@@ -45,6 +45,7 @@
45
45
  | [s3_bucket](#s3_bucket)
46
46
  | [security_group](#security_group)
47
47
  | [ses_identity](#ses_identity)
48
+ | [sqs](#sqs)
48
49
  | [subnet](#subnet)
49
50
  | [vpc](#vpc)
50
51
  | [vpn_connection](#vpn_connection)
@@ -123,7 +124,7 @@ end
123
124
  ```
124
125
 
125
126
 
126
- ### its(:image_id), its(:image_location), its(:state), its(:owner_id), its(:creation_date), its(:public), its(:architecture), its(:image_type), its(:kernel_id), its(:ramdisk_id), its(:platform), its(:sriov_net_support), its(:ena_support), its(:state_reason), its(:image_owner_alias), its(:name), its(:description), its(:root_device_type), its(:root_device_name), its(:virtualization_type), its(:tags), its(:hypervisor)
127
+ ### its(:architecture), its(:creation_date), its(:image_id), its(:image_location), its(:image_type), its(:public), its(:kernel_id), its(:owner_id), its(:platform), its(:ramdisk_id), its(:state), its(:description), its(:ena_support), its(:hypervisor), its(:image_owner_alias), its(:name), its(:root_device_name), its(:root_device_type), its(:sriov_net_support), its(:state_reason), its(:tags), its(:virtualization_type)
127
128
  ### :unlock: Advanced use
128
129
 
129
130
  `ami` can use `Aws::EC2::Image` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Image.html).
@@ -413,7 +414,7 @@ end
413
414
  ```
414
415
 
415
416
 
416
- ### its(:customer_gateway_id), its(:state), its(:type), its(:ip_address), its(:bgp_asn), its(:tags)
417
+ ### its(:bgp_asn), its(:customer_gateway_id), its(:ip_address), its(:state), its(:type), its(:tags)
417
418
  ## <a name="directconnect_virtual_interface">directconnect_virtual_interface</a>
418
419
 
419
420
  DirectconnectVirtualInterface resource type.
@@ -545,7 +546,7 @@ end
545
546
  ```
546
547
 
547
548
 
548
- ### its(:volume_id), its(:size), its(:snapshot_id), its(:availability_zone), its(:state), its(:create_time), its(:volume_type), its(:iops), its(:encrypted), its(:kms_key_id)
549
+ ### its(:availability_zone), its(:create_time), its(:encrypted), its(:kms_key_id), its(:size), its(:snapshot_id), its(:state), its(:volume_id), its(:iops), its(:volume_type)
549
550
  ### :unlock: Advanced use
550
551
 
551
552
  `ebs` can use `Aws::EC2::Volume` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Volume.html).
@@ -720,7 +721,7 @@ end
720
721
  ```
721
722
 
722
723
 
723
- ### its(:instance_id), its(:image_id), its(:private_dns_name), its(:public_dns_name), its(:state_transition_reason), its(:key_name), its(:ami_launch_index), its(:product_codes), its(:instance_type), its(:launch_time), its(:placement), its(:kernel_id), its(:ramdisk_id), its(:platform), its(:monitoring), its(:subnet_id), its(:vpc_id), its(:private_ip_address), its(:public_ip_address), its(:state_reason), its(:architecture), its(:root_device_type), its(:root_device_name), its(:virtualization_type), its(:instance_lifecycle), its(:spot_instance_request_id), its(:client_token), its(:source_dest_check), its(:hypervisor), its(:ebs_optimized), its(:sriov_net_support), its(:ena_support)
724
+ ### 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(: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)
724
725
  ### :unlock: Advanced use
725
726
 
726
727
  `ec2` can use `Aws::EC2::Instance` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Instance.html).
@@ -1600,7 +1601,7 @@ describe nat_gateway('nat-7ff7777f') do
1600
1601
  end
1601
1602
  ```
1602
1603
 
1603
- ### its(:vpc_id), its(:subnet_id), its(:nat_gateway_id), its(:create_time), its(:delete_time), its(:state), its(:failure_code), its(:failure_message), its(:provisioned_bandwidth)
1604
+ ### its(:create_time), its(:delete_time), its(:failure_code), its(:failure_message), its(:nat_gateway_id), its(:provisioned_bandwidth), its(:state), its(:subnet_id), its(:vpc_id)
1604
1605
  ## <a name="network_acl">network_acl</a>
1605
1606
 
1606
1607
  NetworkAcl resource type.
@@ -1654,7 +1655,7 @@ end
1654
1655
  ```
1655
1656
 
1656
1657
 
1657
- ### its(:inbound_entries_count), its(:outbound_entries_count), its(:network_acl_id), its(:vpc_id), its(:is_default)
1658
+ ### its(:inbound_entries_count), its(:outbound_entries_count), its(:is_default), its(:network_acl_id), its(:vpc_id)
1658
1659
  ### :unlock: Advanced use
1659
1660
 
1660
1661
  `network_acl` can use `Aws::EC2::NetworkAcl` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/NetworkAcl.html).
@@ -1751,7 +1752,7 @@ describe network_interface('eni-12ab3cde') do
1751
1752
  end
1752
1753
  ```
1753
1754
 
1754
- ### its(:network_interface_id), its(:subnet_id), its(:vpc_id), its(:availability_zone), its(:description), its(:owner_id), its(:requester_id), its(:requester_managed), its(:status), its(:mac_address), its(:private_ip_address), its(:private_dns_name), its(:source_dest_check), its(:association), its(:ipv_6_addresses), its(:interface_type)
1755
+ ### its(:association), its(:availability_zone), its(:description), its(:interface_type), its(:ipv_6_addresses), its(:mac_address), its(:network_interface_id), its(:owner_id), its(:private_dns_name), its(:private_ip_address), its(:requester_id), its(:requester_managed), its(:source_dest_check), its(:status), its(:subnet_id), its(:vpc_id)
1755
1756
  ## <a name="rds">rds</a>
1756
1757
 
1757
1758
  RDS resource type.
@@ -1976,7 +1977,7 @@ end
1976
1977
  ```
1977
1978
 
1978
1979
 
1979
- ### its(:route_table_id), its(:vpc_id), its(:propagating_vgws)
1980
+ ### its(:propagating_vgws), its(:route_table_id), its(:vpc_id)
1980
1981
  ### :unlock: Advanced use
1981
1982
 
1982
1983
  `route_table` can use `Aws::EC2::RouteTable` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/RouteTable.html).
@@ -2052,6 +2053,8 @@ describe s3_bucket('my-bucket') do
2052
2053
  should have_lifecycle_rule(
2053
2054
  id: 'MyRuleName',
2054
2055
  noncurrent_version_expiration: { noncurrent_days: 1 },
2056
+ expiration: { days: 2 },
2057
+ transitions: { days: 3, storage_class: 'GLACIER' },
2055
2058
  status: 'Enabled'
2056
2059
  )
2057
2060
  end
@@ -2178,7 +2181,7 @@ end
2178
2181
  ```
2179
2182
 
2180
2183
 
2181
- ### its(:inbound_rule_count), its(:outbound_rule_count), its(:inbound_permissions_count), its(:outbound_permissions_count), its(:owner_id), its(:group_name), its(:group_id), its(:description), its(:vpc_id)
2184
+ ### its(:inbound_rule_count), its(:outbound_rule_count), its(:inbound_permissions_count), its(:outbound_permissions_count), its(:description), its(:group_name), its(:owner_id), its(:group_id), its(:vpc_id)
2182
2185
  ### :unlock: Advanced use
2183
2186
 
2184
2187
  `security_group` can use `Aws::EC2::SecurityGroup` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/SecurityGroup.html).
@@ -2222,6 +2225,21 @@ end
2222
2225
  ```
2223
2226
 
2224
2227
  ### its(:dkim_enabled), its(:dkim_verification_status), its(:bounce_topic), its(:complaint_topic), its(:delivery_topic), its(:forwarding_enabled), its(:verification_status), its(:verification_token)
2228
+ ## <a name="sqs">sqs</a>
2229
+
2230
+ SQS resource type.
2231
+
2232
+ ### exist
2233
+
2234
+ ```ruby
2235
+ describe sqs('my-queue') do
2236
+ it { should exist }
2237
+ its(:queue_url) { should eq 'https://sqs.ap-northeast-1.amazonaws.com/123456789012/my-queue' }
2238
+ its(:queue_arn) { should eq 'arn:aws:sqs:ap-northeast-1:123456789012:my-queue' }
2239
+ end
2240
+ ```
2241
+
2242
+
2225
2243
  ## <a name="subnet">subnet</a>
2226
2244
 
2227
2245
  Subnet resource type.
@@ -2255,7 +2273,7 @@ end
2255
2273
  ```
2256
2274
 
2257
2275
 
2258
- ### its(:subnet_id), its(:state), its(:vpc_id), its(:cidr_block), its(:ipv_6_cidr_block_association_set), its(:assign_ipv_6_address_on_creation), its(:available_ip_address_count), its(:availability_zone), its(:default_for_az), its(:map_public_ip_on_launch)
2276
+ ### 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)
2259
2277
  ### :unlock: Advanced use
2260
2278
 
2261
2279
  `subnet` can use `Aws::EC2::Subnet` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Subnet.html).
@@ -2325,7 +2343,7 @@ end
2325
2343
  ```
2326
2344
 
2327
2345
 
2328
- ### its(:vpc_id), its(:state), its(:cidr_block), its(:dhcp_options_id), its(:instance_tenancy), its(:is_default), its(:ipv_6_cidr_block_association_set)
2346
+ ### its(:cidr_block), its(:dhcp_options_id), its(:state), its(:vpc_id), its(:instance_tenancy), its(:ipv_6_cidr_block_association_set), its(:is_default)
2329
2347
  ### :unlock: Advanced use
2330
2348
 
2331
2349
  `vpc` can use `Aws::EC2::Vpc` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Vpc.html).
@@ -2375,7 +2393,7 @@ end
2375
2393
  ```
2376
2394
 
2377
2395
 
2378
- ### its(:vpn_connection_id), its(:state), its(:customer_gateway_configuration), its(:type), its(:customer_gateway_id), its(:vpn_gateway_id), its(:tags), its(:vgw_telemetry), its(:options), its(:routes)
2396
+ ### its(:customer_gateway_configuration), its(:customer_gateway_id), its(:state), its(:type), its(:vpn_connection_id), its(:vpn_gateway_id), its(:options), its(:routes), its(:tags), its(:vgw_telemetry)
2379
2397
  ## <a name="vpn_gateway">vpn_gateway</a>
2380
2398
 
2381
2399
  VpnGateway resource type.
@@ -2407,7 +2425,7 @@ end
2407
2425
  ```
2408
2426
 
2409
2427
 
2410
- ### its(:vpn_gateway_id), its(:state), its(:type), its(:availability_zone), its(:vpc_attachments), its(:tags)
2428
+ ### its(:availability_zone), its(:state), its(:type), its(:vpc_attachments), its(:vpn_gateway_id), its(:tags)
2411
2429
  ## <a name="waf_web_acl">waf_web_acl</a>
2412
2430
 
2413
2431
  WafWebAcl resource type.
@@ -0,0 +1,17 @@
1
+ module Awspec::Generator
2
+ module Doc
3
+ module Type
4
+ class Sqs < Base
5
+ def initialize
6
+ super
7
+ @type_name = 'SQS'
8
+ @type = Awspec::Type::Sqs.new('my-queue')
9
+ @ret = @type.resource_via_client
10
+ @matchers = []
11
+ @ignore_matchers = []
12
+ @describes = []
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -30,6 +30,7 @@ require 'awspec/helper/finder/waf'
30
30
  require 'awspec/helper/finder/acm'
31
31
  require 'awspec/helper/finder/cloudwatch_logs'
32
32
  require 'awspec/helper/finder/dynamodb'
33
+ require 'awspec/helper/finder/sqs'
33
34
 
34
35
  require 'awspec/helper/finder/account_attributes'
35
36
 
@@ -67,6 +68,7 @@ module Awspec::Helper
67
68
  include Awspec::Helper::Finder::AccountAttributes
68
69
  include Awspec::Helper::Finder::CloudwatchLogs
69
70
  include Awspec::Helper::Finder::Dynamodb
71
+ include Awspec::Helper::Finder::Sqs
70
72
 
71
73
  CLIENTS = {
72
74
  ec2_client: Aws::EC2::Client,
@@ -95,7 +97,8 @@ module Awspec::Helper
95
97
  sts_client: Aws::STS::Client,
96
98
  acm_client: Aws::ACM::Client,
97
99
  cloudwatch_logs_client: Aws::CloudWatchLogs::Client,
98
- dynamodb_client: Aws::DynamoDB::Client
100
+ dynamodb_client: Aws::DynamoDB::Client,
101
+ sqs_client: Aws::SQS::Client
99
102
  }
100
103
 
101
104
  CLIENT_OPTIONS = {
@@ -0,0 +1,12 @@
1
+ module Awspec::Helper
2
+ module Finder
3
+ module Sqs
4
+ def find_queue(queue_name)
5
+ res = sqs_client.list_queues(queue_name_prefix: queue_name).queue_urls.select do |url|
6
+ url.split('/').last == queue_name
7
+ end
8
+ res.single_resource(queue_name)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -15,7 +15,7 @@ module Awspec
15
15
  network_acl network_interface rds rds_db_cluster_parameter_group rds_db_parameter_group route53_hosted_zone
16
16
  route_table s3_bucket security_group ses_identity subnet vpc cloudfront_distribution
17
17
  elastictranscoder_pipeline waf_web_acl customer_gateway vpn_gateway vpn_connection internet_gateway acm
18
- cloudwatch_logs dynamodb_table eip
18
+ cloudwatch_logs dynamodb_table eip sqs
19
19
  )
20
20
 
21
21
  ACCOUNT_ATTRIBUTES = %w(
@@ -0,0 +1,25 @@
1
+ Aws.config[:sqs] = {
2
+ stub_responses: {
3
+ list_queues: {
4
+ queue_urls: [
5
+ 'https://sqs.ap-northeast-1.amazonaws.com/123456789012/my-queue',
6
+ 'https://sqs.ap-northeast-1.amazonaws.com/123456789012/my-queue2'
7
+ ]
8
+ },
9
+ get_queue_attributes: {
10
+ attributes: {
11
+ 'QueueArn' => 'arn:aws:sqs:ap-northeast-1:123456789012:my-queue',
12
+ 'ApproximateNumberOfMessages' => '0',
13
+ 'ApproximateNumberOfMessagesNotVisible' => '0',
14
+ 'ApproximateNumberOfMessagesDelayed' => '0',
15
+ 'CreatedTimestamp' => '1499422322',
16
+ 'LastModifiedTimestamp' => '1499422322',
17
+ 'VisibilityTimeout' => '30',
18
+ 'MaximumMessageSize' => '262144',
19
+ 'MessageRetentionPeriod' => '345600',
20
+ 'DelaySeconds' => '0',
21
+ 'ReceiveMessageWaitTimeSeconds' => '0'
22
+ }
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,31 @@
1
+ module Awspec::Type
2
+ class Sqs < ResourceBase
3
+ def resource_via_client
4
+ return @resource_via_client if @resource_via_client
5
+ queue_url = id
6
+ attributes = {}
7
+ res = sqs_client.get_queue_attributes({
8
+ queue_url: queue_url,
9
+ attribute_names: ['All']
10
+ })
11
+ res.attributes.each do |key, value|
12
+ attributes[key.underscore] = value
13
+ end
14
+ attributes['queue_url'] = queue_url
15
+ @resource_via_client ||= attributes
16
+ end
17
+
18
+ def id
19
+ @id ||= find_queue(@display_name)
20
+ end
21
+
22
+ def method_missing(name)
23
+ param_name = name.to_s
24
+ if resource_via_client.include?(param_name)
25
+ resource_via_client[param_name]
26
+ else
27
+ super
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.81.1'
2
+ VERSION = '0.82.0'
3
3
  end
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.81.1
4
+ version: 0.82.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-06-05 00:00:00.000000000 Z
11
+ date: 2017-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -253,6 +253,7 @@ files:
253
253
  - doc/_resource_types/security_group.md
254
254
  - doc/_resource_types/ses_identity.md
255
255
  - doc/_resource_types/ses_send_quota.md
256
+ - doc/_resource_types/sqs.md
256
257
  - doc/_resource_types/subnet.md
257
258
  - doc/_resource_types/vpc.md
258
259
  - doc/_resource_types/vpn_connection.md
@@ -324,6 +325,7 @@ files:
324
325
  - lib/awspec/generator/doc/type/security_group.rb
325
326
  - lib/awspec/generator/doc/type/ses_identity.rb
326
327
  - lib/awspec/generator/doc/type/ses_send_quota.rb
328
+ - lib/awspec/generator/doc/type/sqs.rb
327
329
  - lib/awspec/generator/doc/type/subnet.rb
328
330
  - lib/awspec/generator/doc/type/vpc.rb
329
331
  - lib/awspec/generator/doc/type/vpn_connection.rb
@@ -391,6 +393,7 @@ files:
391
393
  - lib/awspec/helper/finder/s3.rb
392
394
  - lib/awspec/helper/finder/security_group.rb
393
395
  - lib/awspec/helper/finder/ses.rb
396
+ - lib/awspec/helper/finder/sqs.rb
394
397
  - lib/awspec/helper/finder/subnet.rb
395
398
  - lib/awspec/helper/finder/vpc.rb
396
399
  - lib/awspec/helper/finder/waf.rb
@@ -475,6 +478,7 @@ files:
475
478
  - lib/awspec/stub/s3_bucket.rb
476
479
  - lib/awspec/stub/security_group.rb
477
480
  - lib/awspec/stub/ses_identity.rb
481
+ - lib/awspec/stub/sqs.rb
478
482
  - lib/awspec/stub/subnet.rb
479
483
  - lib/awspec/stub/vpc.rb
480
484
  - lib/awspec/stub/vpn_connection.rb
@@ -535,6 +539,7 @@ files:
535
539
  - lib/awspec/type/security_group.rb
536
540
  - lib/awspec/type/ses_identity.rb
537
541
  - lib/awspec/type/ses_send_quota.rb
542
+ - lib/awspec/type/sqs.rb
538
543
  - lib/awspec/type/subnet.rb
539
544
  - lib/awspec/type/vpc.rb
540
545
  - lib/awspec/type/vpn_connection.rb