Class: AWS::EC2::NetworkACL::Association

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/ec2/network_acl/association.rb

Overview

Represents the association between a AWS::EC2::NetworkACL and a Subnet.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(association_id, network_acl, subnet) ⇒ Association

Returns a new instance of Association.


21
22
23
24
25
# File 'lib/aws/ec2/network_acl/association.rb', line 21

def initialize association_id, network_acl, subnet
  @association_id = association_id
  @network_acl = network_acl
  @subnet = subnet
end

Instance Attribute Details

#association_idString (readonly)

Returns An identifier representing the association between the network ACL and subnet.

Returns:

  • (String)

    An identifier representing the association between the network ACL and subnet.


29
30
31
# File 'lib/aws/ec2/network_acl/association.rb', line 29

def association_id
  @association_id
end

#network_aclNetworkACL (readonly)

Returns:


32
33
34
# File 'lib/aws/ec2/network_acl/association.rb', line 32

def network_acl
  @network_acl
end

#subnetSubnet (readonly)

Returns:


35
36
37
# File 'lib/aws/ec2/network_acl/association.rb', line 35

def subnet
  @subnet
end

Instance Method Details

#replace_network_acl(network_acl) ⇒ nil

Replaces the network acl in the current association with a different one (a new network acl is assigned to the subnet).

Parameters:

Returns:

  • (nil)

45
46
47
48
49
50
51
# File 'lib/aws/ec2/network_acl/association.rb', line 45

def replace_network_acl network_acl
  acl_id = network_acl.is_a?(NetworkACL) ? network_acl.id : network_acl
  subnet.client.replace_network_acl_association(
    :association_id => association_id,
    :network_acl_id => acl_id)
  nil
end