Class NetworkAcl
Provides an network ACL resource. You might set up network ACLs with rules similar to your security groups in order to add an additional layer of security to your VPC.
NOTE on Network ACLs and Network ACL Rules: This provider currently provides both a standalone Network ACL Rule resource and a Network ACL resource with rules defined in-line. At this time you cannot use a Network ACL with in-line rules in conjunction with any Network ACL Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var main = new Aws.Ec2.NetworkAcl("main", new Aws.Ec2.NetworkAclArgs
{
Egress =
{
new Aws.Ec2.Inputs.NetworkAclEgressArgs
{
Action = "allow",
CidrBlock = "10.3.0.0/18",
FromPort = 443,
Protocol = "tcp",
RuleNo = 200,
ToPort = 443,
},
},
Ingress =
{
new Aws.Ec2.Inputs.NetworkAclIngressArgs
{
Action = "allow",
CidrBlock = "10.3.0.0/18",
FromPort = 80,
Protocol = "tcp",
RuleNo = 100,
ToPort = 80,
},
},
Tags =
{
{ "Name", "main" },
},
VpcId = aws_vpc.Main.Id,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class NetworkAcl : CustomResource
Constructors
View SourceNetworkAcl(String, NetworkAclArgs, CustomResourceOptions)
Create a NetworkAcl resource with the given unique name, arguments, and options.
Declaration
public NetworkAcl(string name, NetworkAclArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| NetworkAclArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceEgress
Specifies an egress rule. Parameters defined below.
Declaration
public Output<ImmutableArray<NetworkAclEgress>> Egress { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<NetworkAclEgress>> |
Ingress
Specifies an ingress rule. Parameters defined below.
Declaration
public Output<ImmutableArray<NetworkAclIngress>> Ingress { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<NetworkAclIngress>> |
OwnerId
The ID of the AWS account that owns the network ACL.
Declaration
public Output<string> OwnerId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SubnetIds
A list of Subnet IDs to apply the ACL to
Declaration
public Output<ImmutableArray<string>> SubnetIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Tags
A mapping of tags to assign to the resource.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
VpcId
The ID of the associated VPC.
Declaration
public Output<string> VpcId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, NetworkAclState, CustomResourceOptions)
Get an existing NetworkAcl resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static NetworkAcl Get(string name, Input<string> id, NetworkAclState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| NetworkAclState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| NetworkAcl |