Class: Aws::EC2::NetworkAcl
- Inherits:
-
Object
- Object
- Aws::EC2::NetworkAcl
- Extended by:
- Deprecations
- Defined in:
- sig/network_acl.rbs,
lib/aws-sdk-ec2/network_acl.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#associations ⇒ Array<Types::NetworkAclAssociation>
Any associations between the network ACL and your subnets.
-
#entries ⇒ Array<Types::NetworkAclEntry>
The 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.
-
#owner_id ⇒ String
The ID of the Amazon Web Services account that owns the network ACL.
-
#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
- #delete_tags(options = {}) ⇒ Tag::Collection
- #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
trueif 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.
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::EC2::Client] #wait_until instead
Constructor Details
#initialize(id, options = {}) ⇒ NetworkAcl #initialize(options = {}) ⇒ NetworkAcl
Returns a new instance of NetworkAcl.
13 14 15 |
# File 'sig/network_acl.rbs', line 13
def initialize: (String id, Hash[Symbol, untyped] options) -> void
| (id: String, ?client: Client) -> void
| (Hash[Symbol, untyped] args) -> void
|
Instance Method Details
#associations ⇒ Array<Types::NetworkAclAssociation>
Any associations between the network ACL and your subnets
22 |
# File 'sig/network_acl.rbs', line 22
def associations: () -> ::Array[Types::NetworkAclAssociation]
|
#create_entry(options = {}) ⇒ EmptyStructure
53 |
# File 'sig/network_acl.rbs', line 53
def create_entry: (
|
#create_tags(options = {}) ⇒ Tag::Collection
73 |
# File 'sig/network_acl.rbs', line 73
def create_tags: (
|
#data ⇒ Types::NetworkAcl
Returns the data for this Aws::EC2::NetworkAcl. Calls
Client#describe_network_acls if #data_loaded? is false.
46 |
# File 'sig/network_acl.rbs', line 46
def data: () -> Types::NetworkAcl
|
#data_loaded? ⇒ Boolean
49 |
# File 'sig/network_acl.rbs', line 49
def data_loaded?: () -> bool
|
#delete(options = {}) ⇒ EmptyStructure
97 |
# File 'sig/network_acl.rbs', line 97
def delete: (
|
#delete_entry(options = {}) ⇒ EmptyStructure
103 |
# File 'sig/network_acl.rbs', line 103
def delete_entry: (
|
#delete_tags(options = {}) ⇒ Tag::Collection
85 |
# File 'sig/network_acl.rbs', line 85
def delete_tags: (
|
#entries ⇒ Array<Types::NetworkAclEntry>
The entries (rules) in the network ACL.
25 |
# File 'sig/network_acl.rbs', line 25
def entries: () -> ::Array[Types::NetworkAclEntry]
|
#id ⇒ String Also known as: network_acl_id
18 |
# File 'sig/network_acl.rbs', line 18
def id: () -> String
|
#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.
517 518 519 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 517 def identifiers { id: @id } end |
#is_default ⇒ Boolean
Indicates whether this is the default network ACL for the VPC.
28 |
# File 'sig/network_acl.rbs', line 28
def is_default: () -> bool
|
#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
42 |
# File 'sig/network_acl.rbs', line 42
def load: () -> self
|
#owner_id ⇒ String
The ID of the Amazon Web Services account that owns the network ACL.
37 |
# File 'sig/network_acl.rbs', line 37
def owner_id: () -> ::String
|
#replace_association(options = {}) ⇒ Types::ReplaceNetworkAclAssociationResult
111 |
# File 'sig/network_acl.rbs', line 111
def replace_association: (
|
#replace_entry(options = {}) ⇒ EmptyStructure
118 |
# File 'sig/network_acl.rbs', line 118
def replace_entry: (
|
#tags ⇒ Array<Types::Tag>
Any tags assigned to the network ACL.
31 |
# File 'sig/network_acl.rbs', line 31
def tags: () -> ::Array[Types::Tag]
|
#vpc_id ⇒ String
The ID of the VPC for the network ACL.
34 |
# File 'sig/network_acl.rbs', line 34
def vpc_id: () -> ::String
|
#wait_until(options = {}) {|resource| ... } ⇒ Resource
Use [Aws::EC2::Client] #wait_until instead
The waiting operation is performed on a copy. The original resource remains unchanged.
Waiter polls an API operation until a resource enters a desired state.
Basic Usage
Waiter will polls until it is successful, it fails by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop until condition is true
resource.wait_until() {|resource| condition}
Example
instance.wait_until(max_attempts:10, delay:5) do |instance|
instance.state.name == 'running'
end
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. The waiting condition is set by passing a block to #wait_until:
# poll for ~25 seconds
resource.wait_until(max_attempts:5,delay:5) {|resource|...}
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success or :failure from these callbacks,
it will terminate the waiter.
started_at = Time.now
# poll for 1 hour, instead of a number of attempts
proc = Proc.new do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
# disable max attempts
instance.wait_until(before_wait:proc, max_attempts:nil) {...}
Handling Errors
When a waiter is successful, it returns the Resource. When a waiter fails, it raises an error.
begin
resource.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
attempts attempt in seconds invoked before each attempt invoked before each wait
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/aws-sdk-ec2/network_acl.rb', line 191 def wait_until( = {}, &block) self_copy = self.dup attempts = 0 [:max_attempts] = 10 unless .key?(:max_attempts) [:delay] ||= 10 [:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == [:max_attempts] :retry end end Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do Aws::Waiters::Waiter.new().wait({}) end end |