awspec 0.62.1 → 0.63.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: e39a73e41965600fce45012b4d6e7488162a9989
4
- data.tar.gz: 8b1f51e39b8f834bf1bc76589288fbd135dc1f6a
3
+ metadata.gz: 250424ea88776f99a58159344fa91efa8e7c82b3
4
+ data.tar.gz: a77fc4a531bdf685d6d7ed2b667e0085d7e2adbc
5
5
  SHA512:
6
- metadata.gz: 1ea9915dbc828828e0c8854243062dae403d811b85e22ec53f2f88baaeed01d8a95b314bb08c20fca206ec39e7b6df06cf057fd4380e174360cd6e9091b0c9d0
7
- data.tar.gz: 902e0ad0f05da4ab1ec57412d580689d0cbdcbe5e82dfb1452462787a97e2a5e8b6464ae1d6ef41dfe53a1aa60dfbee2102e82a32d3f63fe7747ae33c99f84f9
6
+ metadata.gz: a5342d1aeacb08257e0847b07f6f5162128db5c95d0d41e075719fb3b3d654bcb177347737fc61447ff703f6f964765a2ea667001ca575f135da535b2cff58b2
7
+ data.tar.gz: 177df9e1160a4fbee7b03dba71e585d5cf9b28b1db12e0057c3f8d0775b8bb9984e1ee8cbde427b7c13e0924dd56cec283cb934105ad0e7757dd3aeb6f5fb530
@@ -0,0 +1 @@
1
+ # exist
@@ -1,6 +1,7 @@
1
1
  # Resource Types
2
2
 
3
- [ami](#ami)
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
@@ -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,
@@ -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
@@ -0,0 +1,12 @@
1
+ Aws.config[:elasticloadbalancingv2] = {
2
+ stub_responses: {
3
+ describe_load_balancers: {
4
+ load_balancers: [
5
+ {
6
+ load_balancer_name: 'my-alb',
7
+ dns_name: 'my-load-balancer-123456789.us-west-1.elb.amazonaws.com'
8
+ }
9
+ ]
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,11 @@
1
+ module Awspec::Type
2
+ class Alb < Base
3
+ def resource_via_client
4
+ @resource_via_client ||= find_alb(@display_name)
5
+ end
6
+
7
+ def id
8
+ @id = resource_via_client.load_balancer_name if resource_via_client
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.62.1'
2
+ VERSION = '0.63.0'
3
3
  end
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.62.1
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