awspec 1.14.1 → 1.15.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/doc/_resource_types/codedeploy.md +1 -0
- data/doc/_resource_types/codedeploy_deployment_group.md +17 -0
- data/doc/_resource_types/s3_bucket.md +9 -0
- data/doc/resource_types.md +44 -1
- data/lib/awspec/generator/doc/type/codedeploy.rb +17 -0
- data/lib/awspec/generator/doc/type/codedeploy_deployment_group.rb +17 -0
- data/lib/awspec/helper/finder.rb +4 -1
- data/lib/awspec/helper/finder/codedeploy.rb +15 -0
- data/lib/awspec/helper/finder/s3.rb +7 -0
- data/lib/awspec/helper/finder/sns_topic.rb +42 -6
- data/lib/awspec/helper/type.rb +1 -1
- data/lib/awspec/shared_context.rb +6 -0
- data/lib/awspec/stub/codedeploy.rb +12 -0
- data/lib/awspec/stub/codedeploy_deployment_group.rb +39 -0
- data/lib/awspec/stub/s3_bucket.rb +12 -0
- data/lib/awspec/type/apigateway.rb +2 -70
- data/lib/awspec/type/base.rb +4 -0
- data/lib/awspec/type/codedeploy.rb +11 -0
- data/lib/awspec/type/codedeploy_deployment_group.rb +33 -0
- data/lib/awspec/type/s3_bucket.rb +8 -0
- data/lib/awspec/type/sns_topic.rb +2 -0
- data/lib/awspec/version.rb +1 -1
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99821166663477fdaeb236adf9ae2f2a3aa679044addb41584e754a69efd640a
|
4
|
+
data.tar.gz: 7e688bd35ab82536e943bb94864444d120378fc0503447c3df4c6608c0d7b48f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 693cafd9749700b9f7d38a28b90d1fa3d1cab165e3a91d4823ed47d43e762ef6df529a7e37743fdfd58fefd22316acccd765eaec0284ae6ab69ac4c5dc1acba6
|
7
|
+
data.tar.gz: 4e7872a74027c078d7a360f019aebe16d601e8b1fe9311acb5c736c1079c286beadf746aec3fc16b635547f75dfd6a8d2de02ee5f90f5cbc9532b029eb9f4099
|
@@ -0,0 +1 @@
|
|
1
|
+
### exist
|
@@ -0,0 +1,17 @@
|
|
1
|
+
### exist
|
2
|
+
|
3
|
+
You can set the `application_name` (default: `default`).
|
4
|
+
|
5
|
+
```ruby
|
6
|
+
describe codedeploy_deployment_group('my-codedeploy-deployment-group'), application_name: 'my-codedeploy-application' do
|
7
|
+
it { should exist }
|
8
|
+
end
|
9
|
+
```
|
10
|
+
|
11
|
+
### have_autoscaling_group
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
describe codedeploy_deployment_group('my-codedeploy-deployment-group'), application_name: 'my-codedeploy-application' do
|
15
|
+
it { should have_autoscaling_group('my-autoscaling-group') }
|
16
|
+
end
|
17
|
+
```
|
@@ -130,6 +130,15 @@ describe s3_bucket('my-bucket') do
|
|
130
130
|
end
|
131
131
|
```
|
132
132
|
|
133
|
+
### have_server_side_encryption
|
134
|
+
|
135
|
+
```
|
136
|
+
describe s3_bucket('my-bucket') do
|
137
|
+
it { should have_server_side_encryption(algorithm: "AES256") }
|
138
|
+
it { should have_server_side_encryption(algorithm: "aws:kms") }
|
139
|
+
end
|
140
|
+
```
|
141
|
+
|
133
142
|
### advanced
|
134
143
|
|
135
144
|
`s3_bucket` can use `Aws::S3::Bucket` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Bucket.html).
|
data/doc/resource_types.md
CHANGED
@@ -17,6 +17,8 @@
|
|
17
17
|
| [cloudwatch_event](#cloudwatch_event)
|
18
18
|
| [cloudwatch_logs](#cloudwatch_logs)
|
19
19
|
| [codebuild](#codebuild)
|
20
|
+
| [codedeploy](#codedeploy)
|
21
|
+
| [codedeploy_deployment_group](#codedeploy_deployment_group)
|
20
22
|
| [customer_gateway](#customer_gateway)
|
21
23
|
| [directconnect_virtual_interface](#directconnect_virtual_interface)
|
22
24
|
| [dynamodb_table](#dynamodb_table)
|
@@ -668,6 +670,37 @@ Codebuild resource type.
|
|
668
670
|
### exist
|
669
671
|
|
670
672
|
|
673
|
+
## <a name="codedeploy">codedeploy</a>
|
674
|
+
|
675
|
+
Codedeploy resource type.
|
676
|
+
|
677
|
+
### exist
|
678
|
+
|
679
|
+
### its(:application_id), its(:application_name), its(:create_time), its(:linked_to_git_hub), its(:git_hub_account_name), its(:compute_platform)
|
680
|
+
## <a name="codedeploy_deployment_group">codedeploy_deployment_group</a>
|
681
|
+
|
682
|
+
CodedeployDeploymentGroup resource type.
|
683
|
+
|
684
|
+
### exist
|
685
|
+
|
686
|
+
You can set the `application_name` (default: `default`).
|
687
|
+
|
688
|
+
```ruby
|
689
|
+
describe codedeploy_deployment_group('my-codedeploy-deployment-group'), application_name: 'my-codedeploy-application' do
|
690
|
+
it { should exist }
|
691
|
+
end
|
692
|
+
```
|
693
|
+
|
694
|
+
|
695
|
+
### have_autoscaling_group
|
696
|
+
|
697
|
+
```ruby
|
698
|
+
describe codedeploy_deployment_group('my-codedeploy-deployment-group'), application_name: 'my-codedeploy-application' do
|
699
|
+
it { should have_autoscaling_group('my-autoscaling-group') }
|
700
|
+
end
|
701
|
+
```
|
702
|
+
|
703
|
+
### its(:application_name), its(:deployment_group_id), its(:deployment_group_name), its(:deployment_config_name), its(:on_premises_instance_tag_filters), its(:service_role_arn), its(:target_revision), its(:trigger_configurations), its(:alarm_configuration), its(:deployment_style), its(:load_balancer_info), its(:last_successful_deployment), its(:last_attempted_deployment), its(:ec2_tag_set), its(:on_premises_tag_set), its(:compute_platform), its(:ecs_services)
|
671
704
|
## <a name="customer_gateway">customer_gateway</a>
|
672
705
|
|
673
706
|
CustomerGateway resource type.
|
@@ -2551,7 +2584,7 @@ end
|
|
2551
2584
|
```
|
2552
2585
|
|
2553
2586
|
|
2554
|
-
### its(:vpc_id), its(:db_instance_identifier), its(:db_instance_class), its(:engine), its(:db_instance_status), its(:master_username), its(:db_name), its(:endpoint), its(:allocated_storage), its(:instance_create_time), its(:preferred_backup_window), its(:backup_retention_period), its(:db_security_groups), its(:availability_zone), its(:preferred_maintenance_window), its(:pending_modified_values), its(:latest_restorable_time), its(:multi_az), its(:engine_version), its(:auto_minor_version_upgrade), its(:read_replica_source_db_instance_identifier), its(:read_replica_db_instance_identifiers), its(:read_replica_db_cluster_identifiers), its(:license_model), its(:iops), its(:character_set_name), its(:secondary_availability_zone), its(:publicly_accessible), its(:status_infos), its(:storage_type), its(:tde_credential_arn), its(:db_instance_port), its(:db_cluster_identifier), its(:storage_encrypted), its(:kms_key_id), its(:dbi_resource_id), its(:ca_certificate_identifier), its(:domain_memberships), its(:copy_tags_to_snapshot), its(:monitoring_interval), its(:enhanced_monitoring_resource_arn), its(:monitoring_role_arn), its(:promotion_tier), its(:db_instance_arn), its(:timezone), its(:iam_database_authentication_enabled), its(:performance_insights_enabled), its(:performance_insights_kms_key_id), its(:performance_insights_retention_period), its(:enabled_cloudwatch_logs_exports), its(:processor_features), its(:deletion_protection), its(:listener_endpoint)
|
2587
|
+
### its(:vpc_id), its(:db_instance_identifier), its(:db_instance_class), its(:engine), its(:db_instance_status), its(:master_username), its(:db_name), its(:endpoint), its(:allocated_storage), its(:instance_create_time), its(:preferred_backup_window), its(:backup_retention_period), its(:db_security_groups), its(:availability_zone), its(:preferred_maintenance_window), its(:pending_modified_values), its(:latest_restorable_time), its(:multi_az), its(:engine_version), its(:auto_minor_version_upgrade), its(:read_replica_source_db_instance_identifier), its(:read_replica_db_instance_identifiers), its(:read_replica_db_cluster_identifiers), its(:license_model), its(:iops), its(:character_set_name), its(:secondary_availability_zone), its(:publicly_accessible), its(:status_infos), its(:storage_type), its(:tde_credential_arn), its(:db_instance_port), its(:db_cluster_identifier), its(:storage_encrypted), its(:kms_key_id), its(:dbi_resource_id), its(:ca_certificate_identifier), its(:domain_memberships), its(:copy_tags_to_snapshot), its(:monitoring_interval), its(:enhanced_monitoring_resource_arn), its(:monitoring_role_arn), its(:promotion_tier), its(:db_instance_arn), its(:timezone), its(:iam_database_authentication_enabled), its(:performance_insights_enabled), its(:performance_insights_kms_key_id), its(:performance_insights_retention_period), its(:enabled_cloudwatch_logs_exports), its(:processor_features), its(:deletion_protection), its(:associated_roles), its(:listener_endpoint)
|
2555
2588
|
### :unlock: Advanced use
|
2556
2589
|
|
2557
2590
|
`rds` can use `Aws::RDS::DBInstance` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/RDS/DBInstance.html).
|
@@ -2929,6 +2962,16 @@ end
|
|
2929
2962
|
```
|
2930
2963
|
|
2931
2964
|
|
2965
|
+
### have_server_side_encryption
|
2966
|
+
|
2967
|
+
```
|
2968
|
+
describe s3_bucket('my-bucket') do
|
2969
|
+
it { should have_server_side_encryption(algorithm: "AES256") }
|
2970
|
+
it { should have_server_side_encryption(algorithm: "aws:kms") }
|
2971
|
+
end
|
2972
|
+
```
|
2973
|
+
|
2974
|
+
|
2932
2975
|
### have_tag
|
2933
2976
|
|
2934
2977
|
```ruby
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Awspec::Generator
|
2
|
+
module Doc
|
3
|
+
module Type
|
4
|
+
class Codedeploy < Base
|
5
|
+
def initialize
|
6
|
+
super
|
7
|
+
@type_name = 'Codedeploy'
|
8
|
+
@type = Awspec::Type::Codedeploy.new('my-codedeploy')
|
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,17 @@
|
|
1
|
+
module Awspec::Generator
|
2
|
+
module Doc
|
3
|
+
module Type
|
4
|
+
class CodedeployDeploymentGroup < Base
|
5
|
+
def initialize
|
6
|
+
super
|
7
|
+
@type_name = 'CodedeployDeploymentGroup'
|
8
|
+
@type = Awspec::Type::CodedeployDeploymentGroup.new('my-codedeploy-deployment-group')
|
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/finder.rb
CHANGED
@@ -43,6 +43,7 @@ require 'awspec/helper/finder/eks'
|
|
43
43
|
require 'awspec/helper/finder/sns_topic'
|
44
44
|
require 'awspec/helper/finder/emr'
|
45
45
|
require 'awspec/helper/finder/redshift'
|
46
|
+
require 'awspec/helper/finder/codedeploy'
|
46
47
|
|
47
48
|
require 'awspec/helper/finder/account_attributes'
|
48
49
|
|
@@ -95,6 +96,7 @@ module Awspec::Helper
|
|
95
96
|
include Awspec::Helper::Finder::SNSTopic
|
96
97
|
include Awspec::Helper::Finder::Emr
|
97
98
|
include Awspec::Helper::Finder::Redshift
|
99
|
+
include Awspec::Helper::Finder::Codedeploy
|
98
100
|
|
99
101
|
CLIENTS = {
|
100
102
|
ec2_client: Aws::EC2::Client,
|
@@ -135,7 +137,8 @@ module Awspec::Helper
|
|
135
137
|
eks_client: Aws::EKS::Client,
|
136
138
|
sns_client: Aws::SNS::Client,
|
137
139
|
emr_client: Aws::EMR::Client,
|
138
|
-
redshift_client: Aws::Redshift::Client
|
140
|
+
redshift_client: Aws::Redshift::Client,
|
141
|
+
codedeploy_client: Aws::CodeDeploy::Client
|
139
142
|
}
|
140
143
|
|
141
144
|
CLIENT_OPTIONS = {
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Awspec::Helper
|
2
|
+
module Finder
|
3
|
+
module Codedeploy
|
4
|
+
def find_codedeploy_app(name)
|
5
|
+
res = codedeploy_client.get_application(application_name: name)
|
6
|
+
res.application
|
7
|
+
end
|
8
|
+
|
9
|
+
def find_codedeploy_deployment_group(application, group)
|
10
|
+
res = codedeploy_client.get_deployment_group(application_name: application, deployment_group_name: group)
|
11
|
+
res.deployment_group_info
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -56,6 +56,13 @@ module Awspec::Helper
|
|
56
56
|
nil
|
57
57
|
end
|
58
58
|
|
59
|
+
def find_bucket_server_side_encryption(id)
|
60
|
+
res = s3_client.get_bucket_encryption(bucket: id)
|
61
|
+
res.server_side_encryption_configuration
|
62
|
+
rescue Aws::S3::Errors::ServiceError
|
63
|
+
nil
|
64
|
+
end
|
65
|
+
|
59
66
|
def select_all_buckets
|
60
67
|
s3_client.list_buckets.buckets
|
61
68
|
end
|
@@ -30,16 +30,52 @@ module Awspec::Helper
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def find_sns_topic(topic_arn)
|
33
|
-
|
34
|
-
|
33
|
+
# Find a SNS topic by searching from it's ARN.
|
34
|
+
# Expects as parameter the SNS topic ARN.
|
35
|
+
# Returns a Awspec::Helper::Finder::SNSTopic::SnsTopic if the topic is
|
36
|
+
# found, nil otherwise.
|
37
|
+
# If the SNS topic does not exist, AWS SDK throws an exception
|
38
|
+
# which is acceptable in some cases, but in others will generate a
|
39
|
+
# NoMethodFound during tests execution.
|
40
|
+
# In order to avoid that and follow a uniform interface, the exception
|
41
|
+
# will be captured and nil will be returned instead.
|
42
|
+
# By convention, the returned object will be checked (see check_existence
|
43
|
+
# method from Awspec::Type::Base class for an example) and an exception
|
44
|
+
# Awspec::NoExistingResource will be raised.
|
45
|
+
begin
|
46
|
+
response = sns_client.get_topic_attributes({ topic_arn: topic_arn })
|
47
|
+
puts response
|
48
|
+
topic = SnsTopic.new(response.attributes)
|
49
|
+
rescue Aws::SNS::Errors::NotFound
|
50
|
+
topic = nil
|
51
|
+
end
|
52
|
+
|
53
|
+
topic
|
35
54
|
end
|
36
55
|
|
37
56
|
def find_sns_topic_subs(topic_arn)
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
57
|
+
# Find a SNS topic subscribers by searching from it's ARN.
|
58
|
+
# Expects as parameter the SNS topic ARN.
|
59
|
+
# Returns a map (with keys as the subscribed ARN and the value instances
|
60
|
+
# of respective objects) if the topic is found, nil otherwise.
|
61
|
+
# If the SNS topic does not exist, AWS SDK throws an exception
|
62
|
+
# which is acceptable in some cases, but in others will generate a
|
63
|
+
# NoMethodFound during tests execution.
|
64
|
+
# In order to avoid that and follow a uniform interface, the exception
|
65
|
+
# will be captured and nil will be returned instead.
|
66
|
+
# By convention, the returned object will be checked (see check_existence
|
67
|
+
# method from Awspec::Type::Base class for an example) and an exception
|
68
|
+
# Awspec::NoExistingResource will be raised.
|
69
|
+
begin
|
70
|
+
response = sns_client.list_subscriptions_by_topic({ topic_arn: topic_arn })
|
71
|
+
subscriptions = {}
|
72
|
+
response.subscriptions.each do |subscribed|
|
73
|
+
subscriptions[subscribed['subscription_arn'].to_sym] = subscribed
|
74
|
+
end
|
75
|
+
rescue Aws::SNS::Errors::NotFound
|
76
|
+
subscriptions = nil
|
42
77
|
end
|
78
|
+
|
43
79
|
subscriptions
|
44
80
|
end
|
45
81
|
end
|
data/lib/awspec/helper/type.rb
CHANGED
@@ -19,7 +19,7 @@ module Awspec
|
|
19
19
|
route_table s3_bucket security_group ses_identity subnet vpc cloudfront_distribution
|
20
20
|
elastictranscoder_pipeline waf_web_acl customer_gateway vpn_gateway vpn_connection internet_gateway acm
|
21
21
|
cloudwatch_logs dynamodb_table eip sqs ssm_parameter cloudformation_stack codebuild sns_topic redshift
|
22
|
-
redshift_cluster_parameter_group
|
22
|
+
redshift_cluster_parameter_group codedeploy codedeploy_deployment_group
|
23
23
|
)
|
24
24
|
|
25
25
|
ACCOUNT_ATTRIBUTES = %w(
|
@@ -29,3 +29,9 @@ shared_context 'version', :version do
|
|
29
29
|
example.metadata[:described_class].version = example.metadata[:version]
|
30
30
|
end
|
31
31
|
end
|
32
|
+
|
33
|
+
shared_context 'application_name', :application_name do
|
34
|
+
before do |example|
|
35
|
+
example.metadata[:described_class].application_name = example.metadata[:application_name]
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Aws.config[:codedeploy] = {
|
2
|
+
stub_responses: {
|
3
|
+
get_application: {
|
4
|
+
application: {
|
5
|
+
application_id: 'd3be67e5-e7l6-457b-946b-7a457EXAMPLE',
|
6
|
+
application_name: 'my-codedeploy',
|
7
|
+
create_time: Time.at(1_446_229_001),
|
8
|
+
linked_to_git_hub: false
|
9
|
+
}
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Aws.config[:codedeploy] = {
|
2
|
+
stub_responses: {
|
3
|
+
get_deployment_group: {
|
4
|
+
deployment_group_info: {
|
5
|
+
application_name: 'my-codedeploy-application',
|
6
|
+
auto_scaling_groups: [
|
7
|
+
{
|
8
|
+
hook: 'my-autoscaling-group-hook',
|
9
|
+
name: 'my-autoscaling-group'
|
10
|
+
}
|
11
|
+
],
|
12
|
+
deployment_config_name: 'CodeDeployDefault.OneAtATime',
|
13
|
+
ec2_tag_filters: [
|
14
|
+
{
|
15
|
+
type: 'KEY_AND_VALUE',
|
16
|
+
value: 'CodeDeployDemo',
|
17
|
+
key: 'Name'
|
18
|
+
}
|
19
|
+
],
|
20
|
+
auto_rollback_configuration: {
|
21
|
+
enabled: false
|
22
|
+
},
|
23
|
+
blue_green_deployment_configuration: {
|
24
|
+
terminate_blue_instances_on_deployment_success: {
|
25
|
+
action: 'TERMINATE',
|
26
|
+
termination_wait_time_in_minutes: 5
|
27
|
+
},
|
28
|
+
deployment_ready_option: {
|
29
|
+
action_on_timeout: 'CONTINUE_DEPLOYMENT',
|
30
|
+
wait_time_in_minutes: 0
|
31
|
+
}
|
32
|
+
},
|
33
|
+
deployment_group_id: 'cdac3220-0e64-4d63-bb50-e68faEXAMPLE',
|
34
|
+
service_role_arn: 'arn:aws:iam::80398EXAMPLE:role/CodeDeployDemoRole',
|
35
|
+
deployment_group_name: 'my-codedeploy-deployment-group'
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
@@ -118,6 +118,18 @@ Aws.config[:s3] = {
|
|
118
118
|
}
|
119
119
|
}
|
120
120
|
]
|
121
|
+
},
|
122
|
+
get_bucket_encryption: {
|
123
|
+
server_side_encryption_configuration: {
|
124
|
+
rules: [
|
125
|
+
{
|
126
|
+
apply_server_side_encryption_by_default: {
|
127
|
+
sse_algorithm: 'aws:kms',
|
128
|
+
kms_master_key_id: '[FILTERED]'
|
129
|
+
}
|
130
|
+
}
|
131
|
+
]
|
132
|
+
}
|
121
133
|
}
|
122
134
|
}
|
123
135
|
}
|
@@ -2,82 +2,14 @@ module Awspec::Type
|
|
2
2
|
class Apigateway < ResourceBase
|
3
3
|
aws_resource Aws::APIGateway::Client
|
4
4
|
|
5
|
-
def cache_values(res)
|
6
|
-
@id = res.id
|
7
|
-
@name = res.name
|
8
|
-
@description = res.description
|
9
|
-
@created_date = res.created_date
|
10
|
-
@version = res.version
|
11
|
-
@warnings = res.warnings
|
12
|
-
@binary_media_types = res.binary_media_types
|
13
|
-
@minimum_compression_size = res.minimum_compression_size
|
14
|
-
@api_key_source = res.api_key_source
|
15
|
-
@policy = res.policy
|
16
|
-
@endpoint_configuration = res.endpoint_configuration
|
17
|
-
end
|
18
|
-
|
19
5
|
def resource_via_client
|
20
|
-
|
21
|
-
|
22
|
-
@resource_via_client = find_apigateway_by_id(@display_name)
|
6
|
+
@resource_via_client ||= find_apigateway_by_id(@display_name)
|
23
7
|
return @resource_via_client if @resource_via_client
|
24
|
-
|
25
8
|
@resource_via_client = find_apigateway_by_name(@display_name)
|
26
9
|
end
|
27
10
|
|
28
11
|
def id
|
29
|
-
|
30
|
-
@id
|
31
|
-
end
|
32
|
-
|
33
|
-
def name
|
34
|
-
cache_values(resource_via_client) if @name.nil?
|
35
|
-
@name
|
36
|
-
end
|
37
|
-
|
38
|
-
def description
|
39
|
-
cache_values(resource_via_client) if @description.nil?
|
40
|
-
@description
|
41
|
-
end
|
42
|
-
|
43
|
-
def created_date
|
44
|
-
cache_values(resource_via_client) if @created_date.nil?
|
45
|
-
@created_date
|
46
|
-
end
|
47
|
-
|
48
|
-
def version
|
49
|
-
cache_values(resource_via_client) if @version.nil?
|
50
|
-
@version
|
51
|
-
end
|
52
|
-
|
53
|
-
def warnings
|
54
|
-
cache_values(resource_via_client) if @warnings.nil?
|
55
|
-
@warnings
|
56
|
-
end
|
57
|
-
|
58
|
-
def binary_media_types
|
59
|
-
cache_values(resource_via_client) if @binary_media_types.nil?
|
60
|
-
@binary_media_types
|
61
|
-
end
|
62
|
-
|
63
|
-
def minimum_compression_size
|
64
|
-
cache_values(resource_via_client) if @minimum_compression_size.nil?
|
65
|
-
@minimum_compression_size
|
66
|
-
end
|
67
|
-
|
68
|
-
def api_key_source
|
69
|
-
cache_values(resource_via_client) if @api_key_source.nil?
|
70
|
-
@api_key_source
|
71
|
-
end
|
72
|
-
|
73
|
-
def policy
|
74
|
-
cache_values(resource_via_client) if @policy.nil?
|
75
|
-
@policy
|
76
|
-
end
|
77
|
-
|
78
|
-
def endpoint_configuration
|
79
|
-
cache_values(resource_via_client) if @endpoint_configuration.nil?
|
80
|
-
@endpoint_configuration
|
12
|
+
@id ||= resource_via_client.id if resource_via_client
|
81
13
|
end
|
82
14
|
end
|
83
15
|
end
|
data/lib/awspec/type/base.rb
CHANGED
@@ -22,6 +22,10 @@ module Awspec::Type
|
|
22
22
|
to_s
|
23
23
|
end
|
24
24
|
|
25
|
+
def respond_to_missing?(method, include_private = false)
|
26
|
+
resource_via_client.respond_to?(method) || super unless resource_via_client.nil?
|
27
|
+
end
|
28
|
+
|
25
29
|
def self.tags_allowed
|
26
30
|
define_method :has_tag? do |key, value|
|
27
31
|
begin
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class CodedeployDeploymentGroup < ResourceBase
|
3
|
+
attr_accessor :application_name
|
4
|
+
|
5
|
+
def initialize(group)
|
6
|
+
super
|
7
|
+
@display_name = group
|
8
|
+
end
|
9
|
+
|
10
|
+
def resource_via_client
|
11
|
+
@resource_via_client ||= find_codedeploy_deployment_group(application_name, @display_name)
|
12
|
+
end
|
13
|
+
|
14
|
+
def id
|
15
|
+
@id ||= resource_via_client.deployment_group_id if resource_via_client
|
16
|
+
end
|
17
|
+
|
18
|
+
def application_name
|
19
|
+
@application_name || 'default'
|
20
|
+
end
|
21
|
+
|
22
|
+
def has_autoscaling_group?(asg_name)
|
23
|
+
asgs = resource_via_client.auto_scaling_groups
|
24
|
+
res = asgs.find do |asg|
|
25
|
+
asg.name == asg_name
|
26
|
+
end
|
27
|
+
return true if res
|
28
|
+
asg2 = find_autoscaling_group(asg_name)
|
29
|
+
return true if asgs.include? asg2.auto_scaling_group_name
|
30
|
+
false
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -109,6 +109,14 @@ module Awspec::Type
|
|
109
109
|
bv ? (bv.mfa_delete == 'Enabled') : false
|
110
110
|
end
|
111
111
|
|
112
|
+
def has_server_side_encryption?(algorithm:)
|
113
|
+
configuration = find_bucket_server_side_encryption(id)
|
114
|
+
return false unless configuration
|
115
|
+
|
116
|
+
sse_algorithm = configuration.rules[0].apply_server_side_encryption_by_default.sse_algorithm
|
117
|
+
sse_algorithm ? (sse_algorithm == algorithm) : false
|
118
|
+
end
|
119
|
+
|
112
120
|
private
|
113
121
|
|
114
122
|
def cors_rules
|
@@ -34,6 +34,7 @@ module Awspec::Type
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def method_missing(method_name)
|
37
|
+
check_existence
|
37
38
|
# delegates the method invocation to Awspec::Helper::Finder::SnsTopic::SnsTopic class
|
38
39
|
@resource_via_client.send method_name
|
39
40
|
end
|
@@ -42,6 +43,7 @@ module Awspec::Type
|
|
42
43
|
|
43
44
|
def fetch_subscriptions
|
44
45
|
@subscriptions = find_sns_topic_subs(@topic_arn) if @subscriptions.nil?
|
46
|
+
raise Awspec::NoExistingResource.new(self.class, @display_name) if @subscriptions.nil?
|
45
47
|
@subscriptions
|
46
48
|
end
|
47
49
|
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: 1.
|
4
|
+
version: 1.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -230,6 +230,8 @@ files:
|
|
230
230
|
- doc/_resource_types/cloudwatch_alarm.md
|
231
231
|
- doc/_resource_types/cloudwatch_logs.md
|
232
232
|
- doc/_resource_types/codebuild.md
|
233
|
+
- doc/_resource_types/codedeploy.md
|
234
|
+
- doc/_resource_types/codedeploy_deployment_group.md
|
233
235
|
- doc/_resource_types/customer_gateway.md
|
234
236
|
- doc/_resource_types/directconnect_virtual_interface.md
|
235
237
|
- doc/_resource_types/dynamodb_table.md
|
@@ -322,6 +324,8 @@ files:
|
|
322
324
|
- lib/awspec/generator/doc/type/cloudwatch_event.rb
|
323
325
|
- lib/awspec/generator/doc/type/cloudwatch_logs.rb
|
324
326
|
- lib/awspec/generator/doc/type/codebuild.rb
|
327
|
+
- lib/awspec/generator/doc/type/codedeploy.rb
|
328
|
+
- lib/awspec/generator/doc/type/codedeploy_deployment_group.rb
|
325
329
|
- lib/awspec/generator/doc/type/customer_gateway.rb
|
326
330
|
- lib/awspec/generator/doc/type/directconnect_virtual_interface.rb
|
327
331
|
- lib/awspec/generator/doc/type/dynamodb_table.rb
|
@@ -437,6 +441,7 @@ files:
|
|
437
441
|
- lib/awspec/helper/finder/cloudwatch_event.rb
|
438
442
|
- lib/awspec/helper/finder/cloudwatch_logs.rb
|
439
443
|
- lib/awspec/helper/finder/codebuild.rb
|
444
|
+
- lib/awspec/helper/finder/codedeploy.rb
|
440
445
|
- lib/awspec/helper/finder/directconnect.rb
|
441
446
|
- lib/awspec/helper/finder/dynamodb.rb
|
442
447
|
- lib/awspec/helper/finder/ebs.rb
|
@@ -532,6 +537,8 @@ files:
|
|
532
537
|
- lib/awspec/stub/cloudwatch_event.rb
|
533
538
|
- lib/awspec/stub/cloudwatch_logs.rb
|
534
539
|
- lib/awspec/stub/codebuild.rb
|
540
|
+
- lib/awspec/stub/codedeploy.rb
|
541
|
+
- lib/awspec/stub/codedeploy_deployment_group.rb
|
535
542
|
- lib/awspec/stub/customer_gateway.rb
|
536
543
|
- lib/awspec/stub/directconnect_virtual_interface.rb
|
537
544
|
- lib/awspec/stub/duplicated_resource_type.rb
|
@@ -611,6 +618,8 @@ files:
|
|
611
618
|
- lib/awspec/type/cloudwatch_event.rb
|
612
619
|
- lib/awspec/type/cloudwatch_logs.rb
|
613
620
|
- lib/awspec/type/codebuild.rb
|
621
|
+
- lib/awspec/type/codedeploy.rb
|
622
|
+
- lib/awspec/type/codedeploy_deployment_group.rb
|
614
623
|
- lib/awspec/type/customer_gateway.rb
|
615
624
|
- lib/awspec/type/directconnect_virtual_interface.rb
|
616
625
|
- lib/awspec/type/dynamodb_table.rb
|