Class NetworkAcl

All Implemented Interfaces:
IConstruct, IDependable, IResource, INetworkAcl,, 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.


 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 Subnet subnet;
 SubnetFilter subnetFilter;
 Vpc vpc;
 NetworkAcl networkAcl = NetworkAcl.Builder.create(this, "MyNetworkAcl")
         // the properties below are optional
  • Constructor Details

    • NetworkAcl

      protected NetworkAcl( objRef)
    • NetworkAcl

      protected NetworkAcl( initializationMode)
    • NetworkAcl

      @Stability(Stable) public NetworkAcl(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull NetworkAclProps props)
      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.

      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 interface INetworkAcl
      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.

      id - This parameter is required.
      selection - This parameter is required.
    • getNetworkAclId

      @Stability(Stable) @NotNull public String getNetworkAclId()
      The ID of the NetworkACL.
      Specified by:
      getNetworkAclId in interface INetworkAcl
    • getNetworkAclVpcId

      @Stability(Stable) @NotNull public String getNetworkAclVpcId()
      The VPC ID for this NetworkACL.