Class: Aws::EC2::NetworkAcl
- Inherits:
-
Object
- Object
- Aws::EC2::NetworkAcl
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-ec2/network_acl.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#associations ⇒ Array<Types::NetworkAclAssociation>
Any associations between the network ACL and one or more subnets.
-
#entries ⇒ Array<Types::NetworkAclEntry>
One or more entries (rules) in the network ACL.
- #id ⇒ String (also: #network_acl_id)
-
#is_default ⇒ Boolean
Indicates whether this is the default network ACL for the VPC.
-
#tags ⇒ Array<Types::Tag>
Any tags assigned to the network ACL.
-
#vpc_id ⇒ String
The ID of the VPC for the network ACL.
Actions collapse
- #create_entry(options = {}) ⇒ EmptyStructure
- #create_tags(options = {}) ⇒ Tag::Collection
- #delete(options = {}) ⇒ EmptyStructure
- #delete_entry(options = {}) ⇒ EmptyStructure
- #replace_association(options = {}) ⇒ Types::ReplaceNetworkAclAssociationResult
- #replace_entry(options = {}) ⇒ EmptyStructure
Associations collapse
- #identifiers ⇒ Object deprecated private Deprecated.
- #vpc ⇒ Vpc?
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::NetworkAcl
Returns the data for this NetworkAcl.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ NetworkAcl
constructor
A new instance of NetworkAcl.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current NetworkAcl.
Constructor Details
#initialize(id, options = {}) ⇒ NetworkAcl #initialize(options = {}) ⇒ NetworkAcl
Returns a new instance of NetworkAcl.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 19 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @id = extract_id(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() end |
Instance Method Details
#associations ⇒ Array<Types::NetworkAclAssociation>
Any associations between the network ACL and one or more subnets
36 37 38 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 36 def associations data.associations end |
#create_entry(options = {}) ⇒ EmptyStructure
159 160 161 162 163 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 159 def create_entry( = {}) = .merge(network_acl_id: @id) resp = @client.create_network_acl_entry() resp.data end |
#create_tags(options = {}) ⇒ Tag::Collection
187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 187 def ( = {}) batch = [] = Aws::Util.deep_merge(, resources: [@id]) resp = @client.() [:tags].each do |t| batch << Tag.new( resource_id: @id, key: t[:key], value: t[:value], client: @client ) end Tag::Collection.new([batch], size: batch.size) end |
#data ⇒ Types::NetworkAcl
Returns the data for this Aws::EC2::NetworkAcl. Calls Client#describe_network_acls if #data_loaded? is ‘false`.
87 88 89 90 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 87 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
95 96 97 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 95 def data_loaded? !!@data end |
#delete(options = {}) ⇒ EmptyStructure
214 215 216 217 218 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 214 def delete( = {}) = .merge(network_acl_id: @id) resp = @client.delete_network_acl() resp.data end |
#delete_entry(options = {}) ⇒ EmptyStructure
238 239 240 241 242 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 238 def delete_entry( = {}) = .merge(network_acl_id: @id) resp = @client.delete_network_acl_entry() resp.data end |
#entries ⇒ Array<Types::NetworkAclEntry>
One or more entries (rules) in the network ACL.
42 43 44 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 42 def entries data.entries end |
#id ⇒ String Also known as: network_acl_id
29 30 31 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 29 def id @id end |
#identifiers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
344 345 346 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 344 def identifiers { id: @id } end |
#is_default ⇒ Boolean
Indicates whether this is the default network ACL for the VPC.
48 49 50 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 48 def is_default data.is_default end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::EC2::NetworkAcl. Returns ‘self` making it possible to chain methods.
network_acl.reload.data
77 78 79 80 81 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 77 def load resp = @client.describe_network_acls(network_acl_ids: [@id]) @data = resp.network_acls[0] self end |
#replace_association(options = {}) ⇒ Types::ReplaceNetworkAclAssociationResult
260 261 262 263 264 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 260 def replace_association( = {}) = .merge(network_acl_id: @id) resp = @client.replace_network_acl_association() resp.data end |
#replace_entry(options = {}) ⇒ EmptyStructure
322 323 324 325 326 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 322 def replace_entry( = {}) = .merge(network_acl_id: @id) resp = @client.replace_network_acl_entry() resp.data end |
#tags ⇒ Array<Types::Tag>
Any tags assigned to the network ACL.
54 55 56 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 54 def data. end |
#vpc ⇒ Vpc?
331 332 333 334 335 336 337 338 339 340 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 331 def vpc if data.vpc_id Vpc.new( id: data.vpc_id, client: @client ) else nil end end |
#vpc_id ⇒ String
The ID of the VPC for the network ACL.
60 61 62 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 60 def vpc_id data.vpc_id end |