Class: AWSCDK::EC2::CommonNetworkAclEntryOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/common_network_acl_entry_options.rb

Overview

Basic NetworkACL entry props.

Direct Known Subclasses

NetworkAclEntryProps

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) ⇒ CommonNetworkAclEntryOptions

Returns a new instance of CommonNetworkAclEntryOptions.

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".



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'ec2/common_network_acl_entry_options.rb', line 13

def initialize(cidr:, rule_number:, traffic:, direction: nil, network_acl_entry_name: nil, rule_action: nil)
  @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?
end

Instance Attribute Details

#cidrAWSCDK::EC2::AclCIDR (readonly)

The CIDR range to allow or deny.



31
32
33
# File 'ec2/common_network_acl_entry_options.rb', line 31

def cidr
  @cidr
end

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

Note:

Default: TrafficDirection.INGRESS

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



47
48
49
# File 'ec2/common_network_acl_entry_options.rb', line 47

def direction
  @direction
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)


54
55
56
# File 'ec2/common_network_acl_entry_options.rb', line 54

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:



62
63
64
# File 'ec2/common_network_acl_entry_options.rb', line 62

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)


38
39
40
# File 'ec2/common_network_acl_entry_options.rb', line 38

def rule_number
  @rule_number
end

#trafficAWSCDK::EC2::AclTraffic (readonly)

What kind of traffic this ACL rule applies to.



42
43
44
# File 'ec2/common_network_acl_entry_options.rb', line 42

def traffic
  @traffic
end

Class Method Details

.jsii_propertiesObject



64
65
66
67
68
69
70
71
72
73
# File 'ec2/common_network_acl_entry_options.rb', line 64

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

Instance Method Details

#to_jsiiObject



75
76
77
78
79
80
81
82
83
84
85
86
# File 'ec2/common_network_acl_entry_options.rb', line 75

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