Class NetworkAcl
Define a new custom network ACL.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class NetworkAcl : Resource, INetworkAcl, IResource
Syntax (vb)
Public Class NetworkAcl
Inherits Resource
Implements INetworkAcl, IResource
Remarks
By default, will deny all inbound and outbound traffic unless entries are added explicitly allowing it.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
Subnet subnet;
SubnetFilter subnetFilter;
Vpc vpc;
var networkAcl = new NetworkAcl(this, "MyNetworkAcl", new NetworkAclProps {
Vpc = vpc,
// the properties below are optional
NetworkAclName = "networkAclName",
SubnetSelection = new SubnetSelection {
AvailabilityZones = new [] { "availabilityZones" },
OnePerAz = false,
SubnetFilters = new [] { subnetFilter },
SubnetGroupName = "subnetGroupName",
Subnets = new [] { subnet },
SubnetType = SubnetType.PRIVATE_ISOLATED
}
});
Synopsis
Constructors
NetworkAcl(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
NetworkAcl(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
NetworkAcl(Construct, String, INetworkAclProps) |
Properties
NetworkAclId | The ID of the NetworkACL. |
NetworkAclVpcId | The VPC ID for this NetworkACL. |
Methods
AddEntry(String, ICommonNetworkAclEntryOptions) | Add a new entry to the ACL. |
AssociateWithSubnet(String, ISubnetSelection) | Associate the ACL with a given set of subnets. |
FromNetworkAclId(Construct, String, String) | Import an existing NetworkAcl into this app. |
Constructors
NetworkAcl(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected NetworkAcl(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
NetworkAcl(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected NetworkAcl(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
NetworkAcl(Construct, String, INetworkAclProps)
public NetworkAcl(Construct scope, string id, INetworkAclProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props INetworkAclProps
Properties
NetworkAclId
The ID of the NetworkACL.
public virtual string NetworkAclId { get; }
Property Value
System.String
Remarks
Attribute: true
NetworkAclVpcId
The VPC ID for this NetworkACL.
public virtual string NetworkAclVpcId { get; }
Property Value
System.String
Remarks
Attribute: true
Methods
AddEntry(String, ICommonNetworkAclEntryOptions)
Add a new entry to the ACL.
public virtual NetworkAclEntry AddEntry(string id, ICommonNetworkAclEntryOptions options)
Parameters
- id System.String
- options ICommonNetworkAclEntryOptions
Returns
AssociateWithSubnet(String, ISubnetSelection)
Associate the ACL with a given set of subnets.
public virtual void AssociateWithSubnet(string id, ISubnetSelection selection)
Parameters
- id System.String
- selection ISubnetSelection
FromNetworkAclId(Construct, String, String)
Import an existing NetworkAcl into this app.
public static INetworkAcl FromNetworkAclId(Construct scope, string id, string networkAclId)
Parameters
- scope Constructs.Construct
- id System.String
- networkAclId System.String
Returns