@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:43.127Z") public class NetworkAcl extends Resource implements INetworkAcl
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();
Modifier and Type | Class and Description |
---|---|
static class |
NetworkAcl.Builder
A fluent builder for
NetworkAcl . |
INetworkAcl.Jsii$Default, INetworkAcl.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
NetworkAcl(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
NetworkAcl(software.amazon.jsii.JsiiObjectRef objRef) |
|
NetworkAcl(software.constructs.Construct scope,
java.lang.String id,
NetworkAclProps props) |
Modifier and Type | Method and Description |
---|---|
NetworkAclEntry |
addEntry(java.lang.String id,
CommonNetworkAclEntryOptions options)
Add a new entry to the ACL.
|
void |
associateWithSubnet(java.lang.String id,
SubnetSelection selection)
Associate the ACL with a given set of subnets.
|
static INetworkAcl |
fromNetworkAclId(software.constructs.Construct scope,
java.lang.String id,
java.lang.String networkAclId)
Import an existing NetworkAcl into this app.
|
java.lang.String |
getNetworkAclId()
The ID of the NetworkACL.
|
java.lang.String |
getNetworkAclVpcId()
The VPC ID for this NetworkACL.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected NetworkAcl(software.amazon.jsii.JsiiObjectRef objRef)
protected NetworkAcl(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public NetworkAcl(software.constructs.Construct scope, java.lang.String id, NetworkAclProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public static INetworkAcl fromNetworkAclId(software.constructs.Construct scope, java.lang.String id, java.lang.String networkAclId)
scope
- This parameter is required.id
- This parameter is required.networkAclId
- This parameter is required.public NetworkAclEntry addEntry(java.lang.String id, CommonNetworkAclEntryOptions options)
addEntry
in interface INetworkAcl
id
- This parameter is required.options
- This parameter is required.public void associateWithSubnet(java.lang.String id, SubnetSelection selection)
id
- This parameter is required.selection
- This parameter is required.public java.lang.String getNetworkAclId()
getNetworkAclId
in interface INetworkAcl
public java.lang.String getNetworkAclVpcId()