Class: Serverspec::Type::AWS::EC2::NetworkInterface
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::AWS::EC2::NetworkInterface
- Defined in:
- lib/resources/ec2/network_interface.rb
Overview
The NetworkInterface class exposes the EC2::NetworkInterface resources
Instance Method Summary collapse
-
#association ⇒ Hash
The association information for an Elastic IP associated to the NetworkInterface.
-
#attached? ⇒ Boolean
Returns whether the NetworkInterface is attached.
-
#attachment ⇒ Hash
The NetworkInterface attachment.
-
#availability_zone ⇒ String
The availability zone.
-
#description ⇒ String
The description.
-
#groups ⇒ Array(Hash)
Any SecurityGroups for the NetworkInterface.
-
#in_use? ⇒ Boolean
Indicates whether the status is in-use.
-
#initialize(ni_id, instance = nil) ⇒ NetworkInterface
constructor
AWS SDK for Ruby v2 Aws::EC2::Client wrapper for initializing a NetworkInterface resource.
-
#mac_address ⇒ String
The MAC address.
-
#owner_id ⇒ String
The AWS account ID of the owner of the NetworkInterface.
-
#private_dns_name ⇒ String
The private DNS name.
-
#private_ip_address ⇒ String
The private IP address within the Subnet.
-
#private_ip_addresses ⇒ Array(Hash)
The private IP addresses associated with the NetworkInterface.
-
#requester_id ⇒ String
The ID of the entity that launched the instance on your behalf (eg: AWS Management Console, Auto Scaling).
-
#requester_managed? ⇒ Boolean
Indicates whether the NetworkInterface is being managed by AWS.
-
#source_dest_checked? ⇒ Boolean
Indicates whether traffic to or from the Instance is validated.
-
#status ⇒ String
The status.
-
#subnet_id ⇒ String
The ID of the Subnet.
-
#tags ⇒ Array(Hash)
Any tags associated to the NetworkInterface.
-
#to_s ⇒ String
Returns the string representation of EC2::NetworkInterface.
-
#vpc_id ⇒ String
The ID of the VPC.
Constructor Details
#initialize(ni_id, instance = nil) ⇒ NetworkInterface
AWS SDK for Ruby v2 Aws::EC2::Client wrapper for initializing a NetworkInterface resource
15 16 17 18 19 20 |
# File 'lib/resources/ec2/network_interface.rb', line 15 def initialize(ni_id, instance = nil) check_init_arg 'ni_id', 'EC2::NetworkInterface', ni_id @ni_id = ni_id @aws = instance.nil? ? Aws::EC2::Client.new : instance get_ni ni_id end |
Instance Method Details
#association ⇒ Hash
The association information for an Elastic IP associated to the NetworkInterface
124 125 126 |
# File 'lib/resources/ec2/network_interface.rb', line 124 def association @ni.association end |
#attached? ⇒ Boolean
Returns whether the NetworkInterface is attached
29 30 31 |
# File 'lib/resources/ec2/network_interface.rb', line 29 def attached? @ni..status == 'attached' end |
#attachment ⇒ Hash
The NetworkInterface attachment
117 118 119 |
# File 'lib/resources/ec2/network_interface.rb', line 117 def @ni. end |
#availability_zone ⇒ String
The availability zone
62 63 64 |
# File 'lib/resources/ec2/network_interface.rb', line 62 def availability_zone @ni.availability_zone end |
#description ⇒ String
The description
68 69 70 |
# File 'lib/resources/ec2/network_interface.rb', line 68 def description @ni.description end |
#groups ⇒ Array(Hash)
Any SecurityGroups for the NetworkInterface
111 112 113 |
# File 'lib/resources/ec2/network_interface.rb', line 111 def groups @ni.groups end |
#in_use? ⇒ Boolean
Indicates whether the status is in-use
39 40 41 |
# File 'lib/resources/ec2/network_interface.rb', line 39 def in_use? @ni.status == 'in-use' end |
#mac_address ⇒ String
The MAC address
93 94 95 |
# File 'lib/resources/ec2/network_interface.rb', line 93 def mac_address @ni.mac_address end |
#owner_id ⇒ String
The AWS account ID of the owner of the NetworkInterface
74 75 76 |
# File 'lib/resources/ec2/network_interface.rb', line 74 def owner_id @ni.owner_id end |
#private_dns_name ⇒ String
The private DNS name
105 106 107 |
# File 'lib/resources/ec2/network_interface.rb', line 105 def private_dns_name @ni.private_dns_name end |
#private_ip_address ⇒ String
The private IP address within the Subnet
99 100 101 |
# File 'lib/resources/ec2/network_interface.rb', line 99 def private_ip_address @ni.private_ip_address end |
#private_ip_addresses ⇒ Array(Hash)
The private IP addresses associated with the NetworkInterface
136 137 138 |
# File 'lib/resources/ec2/network_interface.rb', line 136 def private_ip_addresses @ni.private_ip_addresses end |
#requester_id ⇒ String
The ID of the entity that launched the instance on your behalf (eg: AWS Management Console, Auto Scaling)
81 82 83 |
# File 'lib/resources/ec2/network_interface.rb', line 81 def requester_id @ni.requester_id end |
#requester_managed? ⇒ Boolean
Indicates whether the NetworkInterface is being managed by AWS
34 35 36 |
# File 'lib/resources/ec2/network_interface.rb', line 34 def requester_managed? @ni.requester_managed end |
#source_dest_checked? ⇒ Boolean
Indicates whether traffic to or from the Instance is validated
44 45 46 |
# File 'lib/resources/ec2/network_interface.rb', line 44 def source_dest_checked? @ni.source_dest_check end |
#status ⇒ String
The status
87 88 89 |
# File 'lib/resources/ec2/network_interface.rb', line 87 def status @ni.status end |
#subnet_id ⇒ String
The ID of the Subnet
50 51 52 |
# File 'lib/resources/ec2/network_interface.rb', line 50 def subnet_id @ni.subnet_id end |
#tags ⇒ Array(Hash)
Any tags associated to the NetworkInterface
130 131 132 |
# File 'lib/resources/ec2/network_interface.rb', line 130 def @ni.tag_set end |
#to_s ⇒ String
Returns the string representation of EC2::NetworkInterface
24 25 26 |
# File 'lib/resources/ec2/network_interface.rb', line 24 def to_s "EC2 NetworkInterface: #{@ni_id}" end |
#vpc_id ⇒ String
The ID of the VPC
56 57 58 |
# File 'lib/resources/ec2/network_interface.rb', line 56 def vpc_id @ni.vpc_id end |