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, INetworkAclRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class NetworkAcl Inherits Resource Implements INetworkAcl, IResource, INetworkAclRef, IConstruct, IDependable, IEnvironmentAware
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(Construct, string, INetworkAclProps) | Define a new custom network ACL. |
Properties
| NetworkAclId | The ID of the NetworkACL. |
| NetworkAclRef | A reference to a NetworkAcl resource. |
| NetworkAclVpcId | The VPC ID for this NetworkACL. |
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
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(Construct, string, INetworkAclProps)
Define a new custom network ACL.
public NetworkAcl(Construct scope, string id, INetworkAclProps props)
Parameters
- scope Construct
- id string
- props INetworkAclProps
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
}
});
Properties
NetworkAclId
The ID of the NetworkACL.
public virtual string NetworkAclId { get; }
Property Value
Remarks
Attribute: true
NetworkAclRef
A reference to a NetworkAcl resource.
public virtual INetworkAclReference NetworkAclRef { get; }
Property Value
Remarks
By default, will deny all inbound and outbound traffic unless entries are added explicitly allowing it.
ExampleMetadata: fixture=_generated
NetworkAclVpcId
The VPC ID for this NetworkACL.
public virtual string NetworkAclVpcId { get; }
Property Value
Remarks
Attribute: true
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
By default, will deny all inbound and outbound traffic unless entries are added explicitly allowing it.
ExampleMetadata: fixture=_generated
Methods
AddEntry(string, ICommonNetworkAclEntryOptions)
Add a new entry to the ACL.
public virtual NetworkAclEntry AddEntry(string id, ICommonNetworkAclEntryOptions options)
Parameters
- id string
- options ICommonNetworkAclEntryOptions
Returns
Remarks
By default, will deny all inbound and outbound traffic unless entries are added explicitly allowing it.
ExampleMetadata: fixture=_generated
AssociateWithSubnet(string, ISubnetSelection)
Associate the ACL with a given set of subnets.
public virtual void AssociateWithSubnet(string id, ISubnetSelection selection)
Parameters
- id string
- selection ISubnetSelection
Remarks
By default, will deny all inbound and outbound traffic unless entries are added explicitly allowing it.
ExampleMetadata: fixture=_generated
FromNetworkAclId(Construct, string, string)
Import an existing NetworkAcl into this app.
public static INetworkAcl FromNetworkAclId(Construct scope, string id, string networkAclId)
Parameters
Returns
Remarks
By default, will deny all inbound and outbound traffic unless entries are added explicitly allowing it.
ExampleMetadata: fixture=_generated