Class: Serverspec::Type::AWS::EC2::InternetGateway
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::AWS::EC2::InternetGateway
- Defined in:
- lib/resources/ec2/internet_gateway.rb
Overview
The InternetGateway class exposes the EC2::InternetGateway resources
Instance Method Summary collapse
-
#attachments ⇒ Array(Hash)
Any VPCs attached to the InternetGateway.
-
#available? ⇒ Boolean
Returns whether the state of the attachment is available.
-
#initialize(igw_id, instance = nil) ⇒ InternetGateway
constructor
AWS SDK for Ruby v2 Aws::EC2::Client wrapper for initializing an InternetGateway resource.
-
#tags ⇒ Array(Hash)
Any tags assigned to the InternetGateway.
-
#to_s ⇒ String
Returns the string representation of EC2::InternetGateway.
-
#vpc_id ⇒ String
The ID of the VPC attached to the InternetGateway.
Constructor Details
#initialize(igw_id, instance = nil) ⇒ InternetGateway
AWS SDK for Ruby v2 Aws::EC2::Client wrapper for initializing an InternetGateway resource
15 16 17 18 19 20 |
# File 'lib/resources/ec2/internet_gateway.rb', line 15 def initialize(igw_id, instance = nil) check_init_arg 'igw_id', 'EC2::InternetGateway', igw_id @igw_id = igw_id @aws = instance.nil? ? Aws::EC2::Client.new : instance get_igw igw_id end |
Instance Method Details
#attachments ⇒ Array(Hash)
Any VPCs attached to the InternetGateway
41 42 43 44 45 46 |
# File 'lib/resources/ec2/internet_gateway.rb', line 41 def # usually you shouldn't use this as attachments is returned as # Array, but at least the AWS console doesn't allow more than one # VPC per InternetGateway @igw. end |
#available? ⇒ Boolean
Returns whether the state of the attachment is available
29 30 31 |
# File 'lib/resources/ec2/internet_gateway.rb', line 29 def available? @igw.[0].state == 'available' end |
#tags ⇒ Array(Hash)
Any tags assigned to the InternetGateway
50 51 52 |
# File 'lib/resources/ec2/internet_gateway.rb', line 50 def @igw. end |
#to_s ⇒ String
Returns the string representation of EC2::InternetGateway
24 25 26 |
# File 'lib/resources/ec2/internet_gateway.rb', line 24 def to_s "EC2 InternetGateway: #{@igw_id}" end |
#vpc_id ⇒ String
The ID of the VPC attached to the InternetGateway
35 36 37 |
# File 'lib/resources/ec2/internet_gateway.rb', line 35 def vpc_id @igw.[0].vpc_id end |