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 ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.INetworkAcl
INetworkAcl.Jsii$Default, INetworkAcl.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNetworkAcl(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedNetworkAcl(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.voidassociateWithSubnet(String id, SubnetSelection selection) Associate the ACL with a given set of subnets.static INetworkAclfromNetworkAclId(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, isResourceMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.constructs.Construct
toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.core.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStackMethods 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:
addEntryin 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:
getNetworkAclIdin interfaceINetworkAcl
-
getNetworkAclVpcId
The VPC ID for this NetworkACL.
-