Show / Hide Table of Contents

Class GetPrefixList

Inheritance
System.Object
GetPrefixList
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
Assembly: Pulumi.Aws.dll
Syntax
public static class GetPrefixList

Methods

View Source

InvokeAsync(GetPrefixListArgs, InvokeOptions)

aws..getPrefixList provides details about a specific prefix list (PL) in the current region.

This can be used both to validate a prefix list given in a variable and to obtain the CIDR blocks (IP address ranges) for the associated AWS service. The latter may be useful e.g. for adding network ACL rules.

{{% examples %}}

Example Usage

{{% example %}}

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var privateS3VpcEndpoint = new Aws.Ec2.VpcEndpoint("privateS3VpcEndpoint", new Aws.Ec2.VpcEndpointArgs
    {
        ServiceName = "com.amazonaws.us-west-2.s3",
        VpcId = aws_vpc.Foo.Id,
    });
    var privateS3PrefixList = privateS3VpcEndpoint.PrefixListId.Apply(prefixListId => Aws.GetPrefixList.InvokeAsync(new Aws.GetPrefixListArgs
    {
        PrefixListId = prefixListId,
    }));
    var bar = new Aws.Ec2.NetworkAcl("bar", new Aws.Ec2.NetworkAclArgs
    {
        VpcId = aws_vpc.Foo.Id,
    });
    var privateS3NetworkAclRule = new Aws.Ec2.NetworkAclRule("privateS3NetworkAclRule", new Aws.Ec2.NetworkAclRuleArgs
    {
        CidrBlock = privateS3PrefixList.Apply(privateS3PrefixList => privateS3PrefixList.CidrBlocks[0]),
        Egress = false,
        FromPort = 443,
        NetworkAclId = bar.Id,
        Protocol = "tcp",
        RuleAction = "allow",
        RuleNumber = 200,
        ToPort = 443,
    });
}

}

{{% /example %}} {{% example %}}

Filter

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var test = Output.Create(Aws.GetPrefixList.InvokeAsync(new Aws.GetPrefixListArgs
    {
        Filters = 
        {
            new Aws.Inputs.GetPrefixListFilterArgs
            {
                Name = "prefix-list-id",
                Values = 
                {
                    "pl-68a54001",
                },
            },
        },
    }));
}

}

{{% /example %}} {{% /examples %}}

Declaration
public static Task<GetPrefixListResult> InvokeAsync(GetPrefixListArgs args = null, InvokeOptions options = null)
Parameters
Type Name Description
GetPrefixListArgs args
InvokeOptions options
Returns
Type Description
System.Threading.Tasks.Task<GetPrefixListResult>
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.