awspec 1.7.0 → 1.8.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: e556799c2201a9daccf7462ad8f9ca83d59bbe10
4
- data.tar.gz: 650f89151631592d2d5b4adaf07e1d4f2968624e
3
+ metadata.gz: 64449644204e71a922ed923381de44b9c291ba51
4
+ data.tar.gz: 54c5bbf0733d7e21263b76be8a3a9cdbaf083cd6
5
5
  SHA512:
6
- metadata.gz: 7d4c5c36524c93a129ab2fcf110c210121759f49e953f5ff547b2bec6ae6d3a6849fd8348fda7129b0420c9ece46df56fcaf9cb2e2934de5b5257bbb168dc0ee
7
- data.tar.gz: d6c628e4ca7ddf3baf3a24facb92dd528afdf96d184520ae5ff6600e26e3fe4b49fdb47870041d6dfb08c52075f58dd92bf6bbdef7162086080b49cc3ea68605
6
+ metadata.gz: 5abce1a08eab0d540f3fbafbdb63fffaa34c2eb7f8cd48fef8685f790717d335e2bd9084e0219ac122d80ce54529cfec3c41a6614b48a5291b3fd1e373914631
7
+ data.tar.gz: 026ca40acff663122f710de7e7c7c6014033594b093711b3f2a4153eed5ce7e14e9daeffeffe3f0b4384eebb246d17075444a04149d2e9f58f8a65e74ce14b1e
@@ -0,0 +1 @@
1
+ ### exist
@@ -12,6 +12,7 @@
12
12
  | [cloudwatch_alarm](#cloudwatch_alarm)
13
13
  | [cloudwatch_event](#cloudwatch_event)
14
14
  | [cloudwatch_logs](#cloudwatch_logs)
15
+ | [codebuild](#codebuild)
15
16
  | [customer_gateway](#customer_gateway)
16
17
  | [directconnect_virtual_interface](#directconnect_virtual_interface)
17
18
  | [dynamodb_table](#dynamodb_table)
@@ -547,6 +548,13 @@ end
547
548
  ```
548
549
 
549
550
  ### its(:log_group_name), its(:creation_time), its(:retention_in_days), its(:metric_filter_count), its(:arn), its(:stored_bytes), its(:kms_key_id)
551
+ ## <a name="codebuild">codebuild</a>
552
+
553
+ Codebuild resource type.
554
+
555
+ ### exist
556
+
557
+
550
558
  ## <a name="customer_gateway">customer_gateway</a>
551
559
 
552
560
  CustomerGateway resource type.
@@ -614,7 +622,7 @@ describe directconnect_virtual_interface('my-directconnect-virtual-interface') d
614
622
  end
615
623
  ```
616
624
 
617
- ### its(:owner_account), its(:virtual_interface_id), its(:location), its(:connection_id), its(:virtual_interface_type), its(:virtual_interface_name), its(:vlan), its(:asn), its(:amazon_side_asn), its(:auth_key), its(:amazon_address), its(:customer_address), its(:address_family), its(:virtual_interface_state), its(:customer_router_config), its(:virtual_gateway_id), its(:direct_connect_gateway_id), its(:route_filter_prefixes), its(:bgp_peers)
625
+ ### its(:owner_account), its(:virtual_interface_id), its(:location), its(:connection_id), its(:virtual_interface_type), its(:virtual_interface_name), its(:vlan), its(:asn), its(:amazon_side_asn), its(:auth_key), its(:amazon_address), its(:customer_address), its(:address_family), its(:virtual_interface_state), its(:customer_router_config), its(:virtual_gateway_id), its(:direct_connect_gateway_id), its(:route_filter_prefixes), its(:bgp_peers), its(:region), its(:aws_device_v2)
618
626
  ## <a name="dynamodb_table">dynamodb_table</a>
619
627
 
620
628
  DynamodbTable resource type.
@@ -1032,7 +1040,7 @@ describe efs('my-efs') do
1032
1040
  end
1033
1041
  ```
1034
1042
 
1035
- ### its(:owner_id), its(:creation_token), its(:file_system_id), its(:creation_time), its(:life_cycle_state), its(:name), its(:number_of_mount_targets), its(:performance_mode), its(:encrypted), its(:kms_key_id)
1043
+ ### its(:owner_id), its(:creation_token), its(:file_system_id), its(:creation_time), its(:life_cycle_state), its(:name), its(:number_of_mount_targets), its(:performance_mode), its(:encrypted), its(:kms_key_id), its(:throughput_mode), its(:provisioned_throughput_in_mibps)
1036
1044
  ## <a name="elastic_ip">elastic_ip</a>
1037
1045
 
1038
1046
  Elastic IP resource type.
@@ -1451,7 +1459,7 @@ describe iam_policy('my-iam-user') do
1451
1459
  end
1452
1460
  ```
1453
1461
 
1454
- ### its(:policy_name), its(:policy_id), its(:arn), its(:path), its(:default_version_id), its(:attachment_count), its(:is_attachable), its(:description), its(:create_date), its(:update_date)
1462
+ ### its(:policy_name), its(:policy_id), its(:arn), its(:path), its(:default_version_id), its(:attachment_count), its(:permissions_boundary_usage_count), its(:is_attachable), its(:description), its(:create_date), its(:update_date)
1455
1463
  ## <a name="iam_role">iam_role</a>
1456
1464
 
1457
1465
  IamRole resource type.
@@ -1513,7 +1521,7 @@ end
1513
1521
  ```
1514
1522
 
1515
1523
 
1516
- ### its(:path), its(:role_name), its(:role_id), its(:arn), its(:create_date), its(:assume_role_policy_document), its(:description), its(:max_session_duration)
1524
+ ### its(:path), its(:role_name), its(:role_id), its(:arn), its(:create_date), its(:assume_role_policy_document), its(:description), its(:max_session_duration), its(:permissions_boundary)
1517
1525
  ### :unlock: Advanced use
1518
1526
 
1519
1527
  `iam_role` can use `Aws::IAM::Role` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/IAM/Role.html).
@@ -1602,7 +1610,7 @@ end
1602
1610
  ```
1603
1611
 
1604
1612
 
1605
- ### its(:path), its(:user_name), its(:user_id), its(:arn), its(:create_date), its(:password_last_used)
1613
+ ### its(:path), its(:user_name), its(:user_id), its(:arn), its(:create_date), its(:password_last_used), its(:permissions_boundary)
1606
1614
  ### :unlock: Advanced use
1607
1615
 
1608
1616
  `iam_user` can use `Aws::IAM::User` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/IAM/User.html).
@@ -51,7 +51,7 @@ module Awspec
51
51
  types_for_generate_all = %w(
52
52
  cloudwatch_alarm cloudwatch_event directconnect ebs efs
53
53
  elasticsearch iam_group iam_policy iam_role iam_user kms lambda
54
- acm cloudwatch_logs eip
54
+ acm cloudwatch_logs eip codebuild
55
55
  )
56
56
 
57
57
  types_for_generate_all.each do |type|
@@ -31,6 +31,7 @@ require 'awspec/generator/spec/elasticsearch'
31
31
  require 'awspec/generator/spec/eip'
32
32
  require 'awspec/generator/spec/rds_db_parameter_group'
33
33
  require 'awspec/generator/spec/rds_db_cluster_parameter_group'
34
+ require 'awspec/generator/spec/codebuild'
34
35
 
35
36
  # Doc
36
37
  require 'awspec/generator/doc/type'
@@ -0,0 +1,17 @@
1
+ module Awspec::Generator
2
+ module Doc
3
+ module Type
4
+ class Codebuild < Base
5
+ def initialize
6
+ super
7
+ @type_name = 'Codebuild'
8
+ @type = Awspec::Type::Codebuild.new('my-codebuild')
9
+ @ret = @type.resource_via_client
10
+ @matchers = []
11
+ @ignore_matchers = []
12
+ @describes = []
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,23 @@
1
+ module Awspec::Generator
2
+ module Spec
3
+ class Codebuild
4
+ include Awspec::Helper::Finder
5
+ def generate_all
6
+ projects = select_all_codebuild_projects
7
+ raise 'Not Found CodeBuild Project' if projects.empty?
8
+ ERB.new(codebuild_spec_template, nil, '-').result(binding).chomp
9
+ end
10
+
11
+ def codebuild_spec_template
12
+ template = <<-'EOF'
13
+ <% projects.each do |project| %>
14
+ describe codebuild('<%= project %>') do
15
+ it { should exist }
16
+ end
17
+ <% end %>
18
+ EOF
19
+ template
20
+ end
21
+ end
22
+ end
23
+ end
@@ -35,6 +35,7 @@ require 'awspec/helper/finder/dynamodb'
35
35
  require 'awspec/helper/finder/sqs'
36
36
  require 'awspec/helper/finder/cloudformation'
37
37
  require 'awspec/helper/finder/ssm_parameter'
38
+ require 'awspec/helper/finder/codebuild'
38
39
 
39
40
  require 'awspec/helper/finder/account_attributes'
40
41
 
@@ -79,6 +80,7 @@ module Awspec::Helper
79
80
  include Awspec::Helper::Finder::Sqs
80
81
  include Awspec::Helper::Finder::SsmParameter
81
82
  include Awspec::Helper::Finder::Cloudformation
83
+ include Awspec::Helper::Finder::Codebuild
82
84
 
83
85
  CLIENTS = {
84
86
  ec2_client: Aws::EC2::Client,
@@ -111,7 +113,8 @@ module Awspec::Helper
111
113
  dynamodb_client: Aws::DynamoDB::Client,
112
114
  sqs_client: Aws::SQS::Client,
113
115
  ssm_client: Aws::SSM::Client,
114
- cloudformation_client: Aws::CloudFormation::Client
116
+ cloudformation_client: Aws::CloudFormation::Client,
117
+ codebuild_client: Aws::CodeBuild::Client
115
118
  }
116
119
 
117
120
  CLIENT_OPTIONS = {
@@ -0,0 +1,25 @@
1
+ module Awspec::Helper
2
+ module Finder
3
+ module Codebuild
4
+ def find_codebuild_project(id)
5
+ res = codebuild_client.list_projects({ sort_by: id })
6
+ projects = res.projects.select do |project|
7
+ project == id
8
+ end
9
+ projects.single_resource(id)
10
+ end
11
+
12
+ def select_all_codebuild_projects
13
+ req = {}
14
+ projects = []
15
+ loop do
16
+ res = codebuild_client.list_projects(req)
17
+ projects.push(*res.projects)
18
+ break if res.next_token.nil?
19
+ req[:next_token] = res.next_token
20
+ end
21
+ projects
22
+ end
23
+ end
24
+ end
25
+ end
@@ -17,7 +17,7 @@ module Awspec
17
17
  rds rds_db_cluster_parameter_group rds_db_parameter_group route53_hosted_zone
18
18
  route_table s3_bucket security_group ses_identity subnet vpc cloudfront_distribution
19
19
  elastictranscoder_pipeline waf_web_acl customer_gateway vpn_gateway vpn_connection internet_gateway acm
20
- cloudwatch_logs dynamodb_table eip sqs ssm_parameter cloudformation_stack
20
+ cloudwatch_logs dynamodb_table eip sqs ssm_parameter cloudformation_stack codebuild
21
21
  )
22
22
 
23
23
  ACCOUNT_ATTRIBUTES = %w(
@@ -0,0 +1,10 @@
1
+ Aws.config[:codebuild] = {
2
+ stub_responses: {
3
+ list_projects: {
4
+ projects: [
5
+ 'my-codebuild1',
6
+ 'my-codebuild2'
7
+ ]
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,11 @@
1
+ module Awspec::Type
2
+ class Codebuild < ResourceBase
3
+ def resource_via_client
4
+ @resource_via_client ||= find_codebuild_project(@display_name)
5
+ end
6
+
7
+ def id
8
+ @id ||= resource_via_client if resource_via_client
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '1.7.0'
2
+ VERSION = '1.8.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: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-28 00:00:00.000000000 Z
11
+ date: 2018-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -225,6 +225,7 @@ files:
225
225
  - doc/_resource_types/cloudtrail.md
226
226
  - doc/_resource_types/cloudwatch_alarm.md
227
227
  - doc/_resource_types/cloudwatch_logs.md
228
+ - doc/_resource_types/codebuild.md
228
229
  - doc/_resource_types/customer_gateway.md
229
230
  - doc/_resource_types/directconnect_virtual_interface.md
230
231
  - doc/_resource_types/dynamodb_table.md
@@ -305,6 +306,7 @@ files:
305
306
  - lib/awspec/generator/doc/type/cloudwatch_alarm.rb
306
307
  - lib/awspec/generator/doc/type/cloudwatch_event.rb
307
308
  - lib/awspec/generator/doc/type/cloudwatch_logs.rb
309
+ - lib/awspec/generator/doc/type/codebuild.rb
308
310
  - lib/awspec/generator/doc/type/customer_gateway.rb
309
311
  - lib/awspec/generator/doc/type/directconnect_virtual_interface.rb
310
312
  - lib/awspec/generator/doc/type/dynamodb_table.rb
@@ -361,6 +363,7 @@ files:
361
363
  - lib/awspec/generator/spec/cloudwatch_alarm.rb
362
364
  - lib/awspec/generator/spec/cloudwatch_event.rb
363
365
  - lib/awspec/generator/spec/cloudwatch_logs.rb
366
+ - lib/awspec/generator/spec/codebuild.rb
364
367
  - lib/awspec/generator/spec/directconnect.rb
365
368
  - lib/awspec/generator/spec/ebs.rb
366
369
  - lib/awspec/generator/spec/ec2.rb
@@ -404,6 +407,7 @@ files:
404
407
  - lib/awspec/helper/finder/cloudwatch.rb
405
408
  - lib/awspec/helper/finder/cloudwatch_event.rb
406
409
  - lib/awspec/helper/finder/cloudwatch_logs.rb
410
+ - lib/awspec/helper/finder/codebuild.rb
407
411
  - lib/awspec/helper/finder/directconnect.rb
408
412
  - lib/awspec/helper/finder/dynamodb.rb
409
413
  - lib/awspec/helper/finder/ebs.rb
@@ -482,6 +486,7 @@ files:
482
486
  - lib/awspec/stub/cloudwatch_alarm.rb
483
487
  - lib/awspec/stub/cloudwatch_event.rb
484
488
  - lib/awspec/stub/cloudwatch_logs.rb
489
+ - lib/awspec/stub/codebuild.rb
485
490
  - lib/awspec/stub/customer_gateway.rb
486
491
  - lib/awspec/stub/directconnect_virtual_interface.rb
487
492
  - lib/awspec/stub/duplicated_resource_type.rb
@@ -549,6 +554,7 @@ files:
549
554
  - lib/awspec/type/cloudwatch_alarm.rb
550
555
  - lib/awspec/type/cloudwatch_event.rb
551
556
  - lib/awspec/type/cloudwatch_logs.rb
557
+ - lib/awspec/type/codebuild.rb
552
558
  - lib/awspec/type/customer_gateway.rb
553
559
  - lib/awspec/type/directconnect_virtual_interface.rb
554
560
  - lib/awspec/type/dynamodb_table.rb