awspec 0.62.1 → 0.63.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/alb.md +1 -0
- data/doc/resource_types.md +9 -1
- data/lib/awspec/generator/doc/type/alb.rb +17 -0
- data/lib/awspec/helper/finder/alb.rb +19 -0
- data/lib/awspec/helper/finder.rb +3 -0
- data/lib/awspec/helper/type.rb +1 -1
- data/lib/awspec/stub/alb.rb +12 -0
- data/lib/awspec/type/alb.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: 250424ea88776f99a58159344fa91efa8e7c82b3
|
4
|
+
data.tar.gz: a77fc4a531bdf685d6d7ed2b667e0085d7e2adbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5342d1aeacb08257e0847b07f6f5162128db5c95d0d41e075719fb3b3d654bcb177347737fc61447ff703f6f964765a2ea667001ca575f135da535b2cff58b2
|
7
|
+
data.tar.gz: 177df9e1160a4fbee7b03dba71e585d5cf9b28b1db12e0057c3f8d0775b8bb9984e1ee8cbde427b7c13e0924dd56cec283cb934105ad0e7757dd3aeb6f5fb530
|
@@ -0,0 +1 @@
|
|
1
|
+
# exist
|
data/doc/resource_types.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Resource Types
|
2
2
|
|
3
|
-
[
|
3
|
+
[alb](#alb)
|
4
|
+
| [ami](#ami)
|
4
5
|
| [autoscaling_group](#autoscaling_group)
|
5
6
|
| [cloudtrail](#cloudtrail)
|
6
7
|
| [cloudwatch_alarm](#cloudwatch_alarm)
|
@@ -44,6 +45,13 @@
|
|
44
45
|
| [vpn_gateway](#vpn_gateway)
|
45
46
|
| [vpn_connection](#vpn_connection)
|
46
47
|
|
48
|
+
## <a name="alb">alb</a>
|
49
|
+
|
50
|
+
ALB resource type.
|
51
|
+
|
52
|
+
### exist
|
53
|
+
|
54
|
+
### its(:load_balancer_arn), its(:dns_name), its(:canonical_hosted_zone_id), its(:created_time), its(:load_balancer_name), its(:scheme), its(:vpc_id), its(:state), its(:type)
|
47
55
|
## <a name="ami">ami</a>
|
48
56
|
|
49
57
|
AMI resource type.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Awspec::Generator
|
2
|
+
module Doc
|
3
|
+
module Type
|
4
|
+
class Alb < Base
|
5
|
+
def initialize
|
6
|
+
super
|
7
|
+
@type_name = 'ALB'
|
8
|
+
@type = Awspec::Type::Alb.new('my-alb')
|
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,19 @@
|
|
1
|
+
module Awspec::Helper
|
2
|
+
module Finder
|
3
|
+
module Alb
|
4
|
+
def find_alb(id)
|
5
|
+
res = elbv2_client.describe_load_balancers({ names: [id] })
|
6
|
+
res.load_balancers.single_resource(id)
|
7
|
+
rescue
|
8
|
+
return nil
|
9
|
+
end
|
10
|
+
|
11
|
+
def select_alb_by_vpc_id(vpc_id)
|
12
|
+
res = elbv2_client.describe_load_balancers
|
13
|
+
res.load_balancer_descriptions.select do |lb|
|
14
|
+
lb.vpc_id == vpc_id
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/awspec/helper/finder.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'aws-sdk'
|
2
|
+
require 'awspec/helper/finder/alb'
|
2
3
|
require 'awspec/helper/finder/vpc'
|
3
4
|
require 'awspec/helper/finder/subnet'
|
4
5
|
require 'awspec/helper/finder/ec2'
|
@@ -28,6 +29,7 @@ require 'awspec/helper/finder/waf'
|
|
28
29
|
|
29
30
|
module Awspec::Helper
|
30
31
|
module Finder
|
32
|
+
include Awspec::Helper::Finder::Alb
|
31
33
|
include Awspec::Helper::Finder::Vpc
|
32
34
|
include Awspec::Helper::Finder::Subnet
|
33
35
|
include Awspec::Helper::Finder::Ec2
|
@@ -64,6 +66,7 @@ module Awspec::Helper
|
|
64
66
|
s3_client: Aws::S3::Client,
|
65
67
|
autoscaling_client: Aws::AutoScaling::Client,
|
66
68
|
elb_client: Aws::ElasticLoadBalancing::Client,
|
69
|
+
elbv2_client: Aws::ElasticLoadBalancingV2::Client,
|
67
70
|
lambda_client: Aws::Lambda::Client,
|
68
71
|
iam_client: Aws::IAM::Client,
|
69
72
|
kms_client: Aws::KMS::Client,
|
data/lib/awspec/helper/type.rb
CHANGED
@@ -4,7 +4,7 @@ module Awspec
|
|
4
4
|
require 'awspec/type/base'
|
5
5
|
|
6
6
|
TYPES = %w(
|
7
|
-
ami autoscaling_group cloudtrail cloudwatch_alarm cloudwatch_event directconnect_virtual_interface
|
7
|
+
alb ami autoscaling_group cloudtrail cloudwatch_alarm cloudwatch_event directconnect_virtual_interface
|
8
8
|
ebs ec2 ecr_repository ecs_cluster ecs_container_instance ecs_service ecs_task_definition
|
9
9
|
elasticache elasticache_cache_parameter_group elasticsearch elb iam_group
|
10
10
|
iam_policy iam_role iam_user kms lambda launch_configuration nat_gateway
|
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.63.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
@@ -206,6 +206,7 @@ files:
|
|
206
206
|
- bin/console
|
207
207
|
- bin/setup
|
208
208
|
- bin/toolbox
|
209
|
+
- doc/_resource_types/alb.md
|
209
210
|
- doc/_resource_types/ami.md
|
210
211
|
- doc/_resource_types/autoscaling_group.md
|
211
212
|
- doc/_resource_types/cloudfront_distribution.md
|
@@ -255,6 +256,7 @@ files:
|
|
255
256
|
- lib/awspec/ext/struct.rb
|
256
257
|
- lib/awspec/generator.rb
|
257
258
|
- lib/awspec/generator/doc/type.rb
|
259
|
+
- lib/awspec/generator/doc/type/alb.rb
|
258
260
|
- lib/awspec/generator/doc/type/ami.rb
|
259
261
|
- lib/awspec/generator/doc/type/autoscaling_group.rb
|
260
262
|
- lib/awspec/generator/doc/type/base.rb
|
@@ -326,6 +328,7 @@ files:
|
|
326
328
|
- lib/awspec/helper.rb
|
327
329
|
- lib/awspec/helper/color.rb
|
328
330
|
- lib/awspec/helper/finder.rb
|
331
|
+
- lib/awspec/helper/finder/alb.rb
|
329
332
|
- lib/awspec/helper/finder/ami.rb
|
330
333
|
- lib/awspec/helper/finder/autoscaling.rb
|
331
334
|
- lib/awspec/helper/finder/cloudfront.rb
|
@@ -379,6 +382,7 @@ files:
|
|
379
382
|
- lib/awspec/setup.rb
|
380
383
|
- lib/awspec/shared_context.rb
|
381
384
|
- lib/awspec/stub.rb
|
385
|
+
- lib/awspec/stub/alb.rb
|
382
386
|
- lib/awspec/stub/ami.rb
|
383
387
|
- lib/awspec/stub/autoscaling_group.rb
|
384
388
|
- lib/awspec/stub/cloudfront_distribution.rb
|
@@ -425,6 +429,7 @@ files:
|
|
425
429
|
- lib/awspec/stub/vpn_gateway.rb
|
426
430
|
- lib/awspec/stub/waf_web_acl.rb
|
427
431
|
- lib/awspec/toolbox.rb
|
432
|
+
- lib/awspec/type/alb.rb
|
428
433
|
- lib/awspec/type/ami.rb
|
429
434
|
- lib/awspec/type/autoscaling_group.rb
|
430
435
|
- lib/awspec/type/base.rb
|