Class NetworkAcl
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.ec2.NetworkAcl
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,INetworkAcl
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:39.479Z")
@Stability(Stable)
public class NetworkAcl
extends Resource
implements INetworkAcl
Define a new custom network ACL.
By default, will deny all inbound and outbound traffic unless entries are added explicitly allowing it.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.ec2.*; Subnet subnet; SubnetFilter subnetFilter; Vpc vpc; NetworkAcl networkAcl = NetworkAcl.Builder.create(this, "MyNetworkAcl") .vpc(vpc) // the properties below are optional .networkAclName("networkAclName") .subnetSelection(SubnetSelection.builder() .availabilityZones(List.of("availabilityZones")) .onePerAz(false) .subnetFilters(List.of(subnetFilter)) .subnetGroupName("subnetGroupName") .subnetName("subnetName") .subnets(List.of(subnet)) .subnetType(SubnetType.ISOLATED) .build()) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.INetworkAcl
INetworkAcl.Jsii$Default, INetworkAcl.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
NetworkAcl
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
NetworkAcl
(software.amazon.jsii.JsiiObjectRef objRef) NetworkAcl
(software.constructs.Construct scope, String id, NetworkAclProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddEntry
(String id, CommonNetworkAclEntryOptions options) Add a new entry to the ACL.void
associateWithSubnet
(String id, SubnetSelection selection) Associate the ACL with a given set of subnets.static INetworkAcl
fromNetworkAclId
(software.constructs.Construct scope, String id, String networkAclId) Import an existing NetworkAcl into this app.The ID of the NetworkACL.The VPC ID for this NetworkACL.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
NetworkAcl
protected NetworkAcl(software.amazon.jsii.JsiiObjectRef objRef) -
NetworkAcl
protected NetworkAcl(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
NetworkAcl
@Stability(Stable) public NetworkAcl(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull NetworkAclProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
fromNetworkAclId
@Stability(Stable) @NotNull public static INetworkAcl fromNetworkAclId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String networkAclId) Import an existing NetworkAcl into this app.- Parameters:
scope
- This parameter is required.id
- This parameter is required.networkAclId
- This parameter is required.
-
addEntry
@Stability(Stable) @NotNull public NetworkAclEntry addEntry(@NotNull String id, @NotNull CommonNetworkAclEntryOptions options) Add a new entry to the ACL.- Specified by:
addEntry
in interfaceINetworkAcl
- Parameters:
id
- This parameter is required.options
- This parameter is required.
-
associateWithSubnet
@Stability(Stable) public void associateWithSubnet(@NotNull String id, @NotNull SubnetSelection selection) Associate the ACL with a given set of subnets.- Parameters:
id
- This parameter is required.selection
- This parameter is required.
-
getNetworkAclId
The ID of the NetworkACL.- Specified by:
getNetworkAclId
in interfaceINetworkAcl
-
getNetworkAclVpcId
The VPC ID for this NetworkACL.
-