Class: AWSCDK::EC2::NetworkAclEntryProps

Inherits:
CommonNetworkAclEntryOptions
  • Object
show all
Defined in:
ec2/network_acl_entry_props.rb

Overview

Properties to create NetworkAclEntry.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cidr:, rule_number:, traffic:, direction: nil, network_acl_entry_name: nil, rule_action: nil, network_acl:) ⇒ NetworkAclEntryProps

Returns a new instance of NetworkAclEntryProps.

Parameters:

  • cidr (AWSCDK::EC2::AclCIDR)

    The CIDR range to allow or deny.

  • rule_number (Numeric)

    Rule number to assign to the entry, such as 100.

  • traffic (AWSCDK::EC2::AclTraffic)

    What kind of traffic this ACL rule applies to.

  • direction (AWSCDK::EC2::TrafficDirection, nil) (defaults to: nil)

    Traffic direction, with respect to the subnet, this rule applies to.

  • network_acl_entry_name (String, nil) (defaults to: nil)

    The name of the NetworkAclEntry.

  • rule_action (AWSCDK::EC2::Action, nil) (defaults to: nil)

    Whether to allow or deny traffic that matches the rule; valid values are "allow" or "deny".

  • network_acl (AWSCDK::EC2::INetworkAcl)

    The network ACL this entry applies to.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'ec2/network_acl_entry_props.rb', line 14

def initialize(cidr:, rule_number:, traffic:, direction: nil, network_acl_entry_name: nil, rule_action: nil, network_acl:)
  @cidr = cidr
  Jsii::Type.check_type(@cidr, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkFjbENpZHIifQ==")), "cidr")
  @rule_number = rule_number
  Jsii::Type.check_type(@rule_number, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "ruleNumber")
  @traffic = traffic
  Jsii::Type.check_type(@traffic, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkFjbFRyYWZmaWMifQ==")), "traffic")
  @direction = direction
  Jsii::Type.check_type(@direction, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlRyYWZmaWNEaXJlY3Rpb24ifQ==")), "direction") unless @direction.nil?
  @network_acl_entry_name = network_acl_entry_name
  Jsii::Type.check_type(@network_acl_entry_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "networkAclEntryName") unless @network_acl_entry_name.nil?
  @rule_action = rule_action
  Jsii::Type.check_type(@rule_action, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkFjdGlvbiJ9")), "ruleAction") unless @rule_action.nil?
  @network_acl = network_acl
  Jsii::Type.check_type(@network_acl, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklOZXR3b3JrQWNsIn0=")), "networkAcl")
end

Instance Attribute Details

#cidrAWSCDK::EC2::AclCIDR (readonly)

The CIDR range to allow or deny.



34
35
36
# File 'ec2/network_acl_entry_props.rb', line 34

def cidr
  @cidr
end

#directionAWSCDK::EC2::TrafficDirection? (readonly)

Note:

Default: TrafficDirection.INGRESS

Traffic direction, with respect to the subnet, this rule applies to.



50
51
52
# File 'ec2/network_acl_entry_props.rb', line 50

def direction
  @direction
end

#network_aclAWSCDK::EC2::INetworkAcl (readonly)

The network ACL this entry applies to.



69
70
71
# File 'ec2/network_acl_entry_props.rb', line 69

def network_acl
  @network_acl
end

#network_acl_entry_nameString? (readonly)

Note:

Default: If you don't specify a NetworkAclName, AWS CloudFormation generates a unique physical ID and uses that ID for the group name.

The name of the NetworkAclEntry.

It is not recommended to use an explicit group name.

Returns:

  • (String, nil)


57
58
59
# File 'ec2/network_acl_entry_props.rb', line 57

def network_acl_entry_name
  @network_acl_entry_name
end

#rule_actionAWSCDK::EC2::Action? (readonly)

Note:

Default: ALLOW

Whether to allow or deny traffic that matches the rule; valid values are "allow" or "deny".

Any traffic that is not explicitly allowed is automatically denied in a custom ACL, all traffic is automatically allowed in a default ACL.

Returns:



65
66
67
# File 'ec2/network_acl_entry_props.rb', line 65

def rule_action
  @rule_action
end

#rule_numberNumeric (readonly)

Rule number to assign to the entry, such as 100.

ACL entries are processed in ascending order by rule number. Entries can't use the same rule number unless one is an egress rule and the other is an ingress rule.

Returns:

  • (Numeric)


41
42
43
# File 'ec2/network_acl_entry_props.rb', line 41

def rule_number
  @rule_number
end

#trafficAWSCDK::EC2::AclTraffic (readonly)

What kind of traffic this ACL rule applies to.



45
46
47
# File 'ec2/network_acl_entry_props.rb', line 45

def traffic
  @traffic
end

Class Method Details

.jsii_propertiesObject



71
72
73
74
75
76
77
78
79
80
81
# File 'ec2/network_acl_entry_props.rb', line 71

def self.jsii_properties
  {
    :cidr => "cidr",
    :rule_number => "ruleNumber",
    :traffic => "traffic",
    :direction => "direction",
    :network_acl_entry_name => "networkAclEntryName",
    :rule_action => "ruleAction",
    :network_acl => "networkAcl",
  }
end

Instance Method Details

#to_jsiiObject



83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'ec2/network_acl_entry_props.rb', line 83

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "cidr" => @cidr,
    "ruleNumber" => @rule_number,
    "traffic" => @traffic,
    "direction" => @direction,
    "networkAclEntryName" => @network_acl_entry_name,
    "ruleAction" => @rule_action,
    "networkAcl" => @network_acl,
  })
  result.compact
end