Class GetNetworkAcls
Inheritance
System.Object
GetNetworkAcls
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public static class GetNetworkAcls
Methods
View SourceInvokeAsync(GetNetworkAclsArgs, InvokeOptions)
{{% examples %}}
Example Usage
{{% example %}}
The following shows outputing all network ACL ids in a vpc.
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleNetworkAcls = Output.Create(Aws.Ec2.GetNetworkAcls.InvokeAsync(new Aws.Ec2.GetNetworkAclsArgs
{
VpcId = @var.Vpc_id,
}));
this.Example = exampleNetworkAcls.Apply(exampleNetworkAcls => exampleNetworkAcls.Ids);
}
[Output("example")]
public Output<string> Example { get; set; }
}
The following example retrieves a list of all network ACL ids in a VPC with a custom
tag of Tier set to a value of "Private".
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Aws.Ec2.GetNetworkAcls.InvokeAsync(new Aws.Ec2.GetNetworkAclsArgs
{
Tags =
{
{ "Tier", "Private" },
},
VpcId = @var.Vpc_id,
}));
}
}
The following example retrieves a network ACL id in a VPC which associated with specific subnet.
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Aws.Ec2.GetNetworkAcls.InvokeAsync(new Aws.Ec2.GetNetworkAclsArgs
{
Filters =
{
new Aws.Ec2.Inputs.GetNetworkAclsFilterArgs
{
Name = "association.subnet-id",
Values =
{
aws_subnet.Test.Id,
},
},
},
VpcId = @var.Vpc_id,
}));
}
}
{{% /example %}} {{% /examples %}}
Declaration
public static Task<GetNetworkAclsResult> InvokeAsync(GetNetworkAclsArgs args = null, InvokeOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetNetworkAclsArgs | args | |
| InvokeOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GetNetworkAclsResult> |