awspec 0.84.1 → 0.85.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/.rubocop.yml +3 -3
- data/.travis.yml +3 -3
- data/doc/_resource_types/autoscaling_group.md +9 -0
- data/doc/_resource_types/cloudformation_stack.md +8 -0
- data/doc/resource_types.md +25 -0
- data/lib/awspec/generator/doc/type/cloudformation_stack.rb +17 -0
- data/lib/awspec/helper/finder.rb +4 -1
- data/lib/awspec/helper/finder/cloudformation.rb +12 -0
- data/lib/awspec/helper/type.rb +1 -1
- data/lib/awspec/stub/cloudformation_stack.rb +49 -0
- data/lib/awspec/type/autoscaling_group.rb +4 -0
- data/lib/awspec/type/cloudformation_stack.rb +11 -0
- data/lib/awspec/version.rb +1 -1
- metadata +6 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ecc5bcbd50df3ba389eb54c44bdaf0f9eeaca97
|
|
4
|
+
data.tar.gz: 2b675e957707e721b63395384747effa950e9b7c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3dc3a7a3e8fd97051c647447765fcd98f6bb2a1c57867700420b47073726c5624266cddc913361f3fbca002031257b15ed879f7091473b7478d901778396823c
|
|
7
|
+
data.tar.gz: 01c4ea57979c011be6d80bcbef82a042868293f8a89ea8cf1cecfdc8b81284519846f64e27dccb564e7631ddd18e0b1631ff402457d1f5e2afa9dd7d41f90d30
|
data/.rubocop.yml
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
AllCops:
|
|
2
2
|
TargetRubyVersion: 2.1
|
|
3
3
|
|
|
4
|
-
Lint/Eval:
|
|
5
|
-
Enabled: false
|
|
6
|
-
|
|
7
4
|
Lint/HandleExceptions:
|
|
8
5
|
Enabled: false
|
|
9
6
|
|
|
@@ -38,6 +35,9 @@ Metrics/PerceivedComplexity:
|
|
|
38
35
|
Performance/StringReplacement:
|
|
39
36
|
Enabled: false
|
|
40
37
|
|
|
38
|
+
Security/Eval:
|
|
39
|
+
Enabled: false
|
|
40
|
+
|
|
41
41
|
Style/Alias:
|
|
42
42
|
Enabled: false
|
|
43
43
|
|
data/.travis.yml
CHANGED
|
@@ -5,6 +5,7 @@ describe autoscaling_group('my-auto-scaling-group') do
|
|
|
5
5
|
it { should exist }
|
|
6
6
|
end
|
|
7
7
|
```
|
|
8
|
+
|
|
8
9
|
### have_alb_target_group
|
|
9
10
|
|
|
10
11
|
```ruby
|
|
@@ -29,6 +30,14 @@ describe autoscaling_group('my-auto-scaling-group') do
|
|
|
29
30
|
end
|
|
30
31
|
```
|
|
31
32
|
|
|
33
|
+
### have_launch_configuration
|
|
34
|
+
|
|
35
|
+
```ruby
|
|
36
|
+
describe autoscaling_group('my-auto-scaling-group') do
|
|
37
|
+
it { should have_launch_configuration('my-lc') }
|
|
38
|
+
end
|
|
39
|
+
```
|
|
40
|
+
|
|
32
41
|
### have_tag
|
|
33
42
|
|
|
34
43
|
```ruby
|
data/doc/resource_types.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
| [alb_target_group](#alb_target_group)
|
|
7
7
|
| [ami](#ami)
|
|
8
8
|
| [autoscaling_group](#autoscaling_group)
|
|
9
|
+
| [cloudformation_stack](#cloudformation_stack)
|
|
9
10
|
| [cloudfront_distribution](#cloudfront_distribution)
|
|
10
11
|
| [cloudtrail](#cloudtrail)
|
|
11
12
|
| [cloudwatch_alarm](#cloudwatch_alarm)
|
|
@@ -241,6 +242,7 @@ describe autoscaling_group('my-auto-scaling-group') do
|
|
|
241
242
|
end
|
|
242
243
|
```
|
|
243
244
|
|
|
245
|
+
|
|
244
246
|
### have_alb_target_group
|
|
245
247
|
|
|
246
248
|
```ruby
|
|
@@ -268,6 +270,15 @@ end
|
|
|
268
270
|
```
|
|
269
271
|
|
|
270
272
|
|
|
273
|
+
### have_launch_configuration
|
|
274
|
+
|
|
275
|
+
```ruby
|
|
276
|
+
describe autoscaling_group('my-auto-scaling-group') do
|
|
277
|
+
it { should have_launch_configuration('my-lc') }
|
|
278
|
+
end
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
|
|
271
282
|
### have_suspended_process
|
|
272
283
|
|
|
273
284
|
### have_tag
|
|
@@ -279,6 +290,20 @@ end
|
|
|
279
290
|
```
|
|
280
291
|
|
|
281
292
|
### its(:auto_scaling_group_name), its(:auto_scaling_group_arn), its(:launch_configuration_name), its(:min_size), its(:max_size), its(:desired_capacity), its(:default_cooldown), its(:availability_zones), its(:load_balancer_names), its(:target_group_arns), its(:health_check_type), its(:health_check_grace_period), its(:created_time), its(:placement_group), its(:vpc_zone_identifier), its(:enabled_metrics), its(:status), its(:termination_policies), its(:new_instances_protected_from_scale_in)
|
|
293
|
+
## <a name="cloudformation_stack">cloudformation_stack</a>
|
|
294
|
+
|
|
295
|
+
CloudformationStack resource type.
|
|
296
|
+
|
|
297
|
+
### exist
|
|
298
|
+
|
|
299
|
+
```ruby
|
|
300
|
+
describe cloudformation_stack('my-cloudformation-stack') do
|
|
301
|
+
it { should exist }
|
|
302
|
+
its(:stack_status) { should eq 'UPDATE_COMPLETE' }
|
|
303
|
+
end
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### its(:stack_id), its(:stack_name), its(:change_set_id), its(:description), its(:parameters), its(:creation_time), its(:last_updated_time), its(:stack_status), its(:stack_status_reason), its(:disable_rollback), its(:notification_arns), its(:timeout_in_minutes), its(:capabilities), its(:role_arn)
|
|
282
307
|
## <a name="cloudfront_distribution">cloudfront_distribution</a>
|
|
283
308
|
|
|
284
309
|
CloudfrontDistribution resource type.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Awspec::Generator
|
|
2
|
+
module Doc
|
|
3
|
+
module Type
|
|
4
|
+
class CloudformationStack < Base
|
|
5
|
+
def initialize
|
|
6
|
+
super
|
|
7
|
+
@type_name = 'CloudformationStack'
|
|
8
|
+
@type = Awspec::Type::CloudformationStack.new('my-cloudformation-stack')
|
|
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
|
@@ -31,6 +31,7 @@ require 'awspec/helper/finder/acm'
|
|
|
31
31
|
require 'awspec/helper/finder/cloudwatch_logs'
|
|
32
32
|
require 'awspec/helper/finder/dynamodb'
|
|
33
33
|
require 'awspec/helper/finder/sqs'
|
|
34
|
+
require 'awspec/helper/finder/cloudformation'
|
|
34
35
|
|
|
35
36
|
require 'awspec/helper/finder/account_attributes'
|
|
36
37
|
|
|
@@ -69,6 +70,7 @@ module Awspec::Helper
|
|
|
69
70
|
include Awspec::Helper::Finder::CloudwatchLogs
|
|
70
71
|
include Awspec::Helper::Finder::Dynamodb
|
|
71
72
|
include Awspec::Helper::Finder::Sqs
|
|
73
|
+
include Awspec::Helper::Finder::Cloudformation
|
|
72
74
|
|
|
73
75
|
CLIENTS = {
|
|
74
76
|
ec2_client: Aws::EC2::Client,
|
|
@@ -98,7 +100,8 @@ module Awspec::Helper
|
|
|
98
100
|
acm_client: Aws::ACM::Client,
|
|
99
101
|
cloudwatch_logs_client: Aws::CloudWatchLogs::Client,
|
|
100
102
|
dynamodb_client: Aws::DynamoDB::Client,
|
|
101
|
-
sqs_client: Aws::SQS::Client
|
|
103
|
+
sqs_client: Aws::SQS::Client,
|
|
104
|
+
cloudformation_client: Aws::CloudFormation::Client
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
CLIENT_OPTIONS = {
|
data/lib/awspec/helper/type.rb
CHANGED
|
@@ -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 sqs alb_listener alb_target_group
|
|
18
|
+
cloudwatch_logs dynamodb_table eip sqs alb_listener alb_target_group cloudformation_stack
|
|
19
19
|
)
|
|
20
20
|
|
|
21
21
|
ACCOUNT_ATTRIBUTES = %w(
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# rubocop:disable Metrics/LineLength
|
|
2
|
+
Aws.config[:cloudformation] = {
|
|
3
|
+
stub_responses: {
|
|
4
|
+
describe_stacks: {
|
|
5
|
+
stacks: [
|
|
6
|
+
{
|
|
7
|
+
stack_id:
|
|
8
|
+
'arn:aws:cloudformation:ap-northeast-1:123456789012:stack/my-cloudformation-stack/8ksdf6d0-7jia-1lo7-a9j7-5dca9ff482',
|
|
9
|
+
stack_name: 'my-cloudformation-stack',
|
|
10
|
+
change_set_id: nil,
|
|
11
|
+
description: 'The AWS CloudFormation template for this Serverless application',
|
|
12
|
+
parameters: [],
|
|
13
|
+
creation_time: Time.new(2015, 1, 2, 10, 10, 00, '+00:00'),
|
|
14
|
+
last_updated_time: Time.new(2015, 1, 2, 10, 10, 00, '+00:00'),
|
|
15
|
+
stack_status: 'UPDATE_COMPLETE',
|
|
16
|
+
stack_status_reason: nil,
|
|
17
|
+
disable_rollback: false,
|
|
18
|
+
notification_arns: [],
|
|
19
|
+
timeout_in_minutes: nil,
|
|
20
|
+
capabilities: %w(CAPABILITY_IAM CAPABILITY_NAMED_IAM),
|
|
21
|
+
outputs:
|
|
22
|
+
[
|
|
23
|
+
{
|
|
24
|
+
output_key: 'HandlerLambdaFunctionQualifiedArn',
|
|
25
|
+
output_value:
|
|
26
|
+
'arn:aws:lambda:ap-northeast-1:123456789012:function:my-cloudformation-stack-handler:1',
|
|
27
|
+
description: 'Current Lambda function version'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
output_key: 'ServerlessDeploymentBucketName',
|
|
31
|
+
output_value:
|
|
32
|
+
'bucket-serverlessdeploymentbuck-sdifase69cjs',
|
|
33
|
+
description: nil
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
role_arn: nil,
|
|
37
|
+
tags:
|
|
38
|
+
[
|
|
39
|
+
{
|
|
40
|
+
key: 'STAGE',
|
|
41
|
+
value: 'production'
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
next_token: nil
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -31,6 +31,10 @@ module Awspec::Type
|
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
def has_launch_configuration?(name)
|
|
35
|
+
@resource_via_client.launch_configuration_name == name
|
|
36
|
+
end
|
|
37
|
+
|
|
34
38
|
def has_alb_target_group?(id)
|
|
35
39
|
target_group = find_alb_target_group(id)
|
|
36
40
|
target_groups = select_alb_target_group_by_autoscaling_group_name(@resource_via_client.auto_scaling_group_name)
|
data/lib/awspec/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: awspec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.85.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- k1LoW
|
|
@@ -212,6 +212,7 @@ files:
|
|
|
212
212
|
- doc/_resource_types/alb_target_group.md
|
|
213
213
|
- doc/_resource_types/ami.md
|
|
214
214
|
- doc/_resource_types/autoscaling_group.md
|
|
215
|
+
- doc/_resource_types/cloudformation_stack.md
|
|
215
216
|
- doc/_resource_types/cloudfront_distribution.md
|
|
216
217
|
- doc/_resource_types/cloudtrail.md
|
|
217
218
|
- doc/_resource_types/cloudwatch_alarm.md
|
|
@@ -284,6 +285,7 @@ files:
|
|
|
284
285
|
- lib/awspec/generator/doc/type/ami.rb
|
|
285
286
|
- lib/awspec/generator/doc/type/autoscaling_group.rb
|
|
286
287
|
- lib/awspec/generator/doc/type/base.rb
|
|
288
|
+
- lib/awspec/generator/doc/type/cloudformation_stack.rb
|
|
287
289
|
- lib/awspec/generator/doc/type/cloudfront_distribution.rb
|
|
288
290
|
- lib/awspec/generator/doc/type/cloudtrail.rb
|
|
289
291
|
- lib/awspec/generator/doc/type/cloudwatch_alarm.rb
|
|
@@ -373,6 +375,7 @@ files:
|
|
|
373
375
|
- lib/awspec/helper/finder/alb.rb
|
|
374
376
|
- lib/awspec/helper/finder/ami.rb
|
|
375
377
|
- lib/awspec/helper/finder/autoscaling.rb
|
|
378
|
+
- lib/awspec/helper/finder/cloudformation.rb
|
|
376
379
|
- lib/awspec/helper/finder/cloudfront.rb
|
|
377
380
|
- lib/awspec/helper/finder/cloudtrail.rb
|
|
378
381
|
- lib/awspec/helper/finder/cloudwatch.rb
|
|
@@ -441,6 +444,7 @@ files:
|
|
|
441
444
|
- lib/awspec/stub/alb_target_group.rb
|
|
442
445
|
- lib/awspec/stub/ami.rb
|
|
443
446
|
- lib/awspec/stub/autoscaling_group.rb
|
|
447
|
+
- lib/awspec/stub/cloudformation_stack.rb
|
|
444
448
|
- lib/awspec/stub/cloudfront_distribution.rb
|
|
445
449
|
- lib/awspec/stub/cloudtrail.rb
|
|
446
450
|
- lib/awspec/stub/cloudwatch_alarm.rb
|
|
@@ -502,6 +506,7 @@ files:
|
|
|
502
506
|
- lib/awspec/type/ami.rb
|
|
503
507
|
- lib/awspec/type/autoscaling_group.rb
|
|
504
508
|
- lib/awspec/type/base.rb
|
|
509
|
+
- lib/awspec/type/cloudformation_stack.rb
|
|
505
510
|
- lib/awspec/type/cloudfront_distribution.rb
|
|
506
511
|
- lib/awspec/type/cloudtrail.rb
|
|
507
512
|
- lib/awspec/type/cloudwatch_alarm.rb
|