Class: AWSCDK::EC2::NetworkAclProps

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

Overview

Properties to create NetworkAcl.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vpc:, network_acl_name: nil, subnet_selection: nil) ⇒ NetworkAclProps

Returns a new instance of NetworkAclProps.

Parameters:

  • vpc (AWSCDK::EC2::IVPC)

    The VPC in which to create the NetworkACL.

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

    The name of the NetworkAcl.

  • subnet_selection (AWSCDK::EC2::SubnetSelection, nil) (defaults to: nil)

    Subnets in the given VPC to associate the ACL with.



10
11
12
13
14
15
16
17
# File 'ec2/network_acl_props.rb', line 10

def initialize(vpc:, network_acl_name: nil, subnet_selection: nil)
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc")
  @network_acl_name = network_acl_name
  Jsii::Type.check_type(@network_acl_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "networkAclName") unless @network_acl_name.nil?
  @subnet_selection = subnet_selection.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**subnet_selection.transform_keys(&:to_sym)) : subnet_selection
  Jsii::Type.check_type(@subnet_selection, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "subnetSelection") unless @subnet_selection.nil?
end

Instance Attribute Details

#network_acl_nameString? (readonly)

Note:

Default: CDK generated name

The name of the NetworkAcl.

Since the NetworkAcl resource doesn't support providing a physical name, the value provided here will be recorded in the Name tag.

Returns:

  • (String, nil)


29
30
31
# File 'ec2/network_acl_props.rb', line 29

def network_acl_name
  @network_acl_name
end

#subnet_selectionAWSCDK::EC2::SubnetSelection? (readonly)

Note:

Default: - No subnets associated

Subnets in the given VPC to associate the ACL with.

More subnets can always be added later by calling associate_with_subnets().



37
38
39
# File 'ec2/network_acl_props.rb', line 37

def subnet_selection
  @subnet_selection
end

#vpcAWSCDK::EC2::IVPC (readonly)

The VPC in which to create the NetworkACL.

Returns:



22
23
24
# File 'ec2/network_acl_props.rb', line 22

def vpc
  @vpc
end

Class Method Details

.jsii_propertiesObject



39
40
41
42
43
44
45
# File 'ec2/network_acl_props.rb', line 39

def self.jsii_properties
  {
    :vpc => "vpc",
    :network_acl_name => "networkAclName",
    :subnet_selection => "subnetSelection",
  }
end

Instance Method Details

#to_jsiiObject



47
48
49
50
51
52
53
54
55
# File 'ec2/network_acl_props.rb', line 47

def to_jsii
  result = {}
  result.merge!({
    "vpc" => @vpc,
    "networkAclName" => @network_acl_name,
    "subnetSelection" => @subnet_selection,
  })
  result.compact
end