getManagedPrefixList

aws.ec2.ManagedPrefixList provides details about a specific AWS prefix list or customer-managed prefix list in the current region.

Example Usage

Find the regional DynamoDB prefix list

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var current = Output.Create(Aws.GetRegion.InvokeAsync());
        var example = current.Apply(current => Output.Create(Aws.Ec2.GetManagedPrefixList.InvokeAsync(new Aws.Ec2.GetManagedPrefixListArgs
        {
            Name = $"com.amazonaws.{current.Name}.dynamodb",
        })));
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		current, err := aws.GetRegion(ctx, nil, nil)
		if err != nil {
			return err
		}
		opt0 := fmt.Sprintf("%v%v%v", "com.amazonaws.", current.Name, ".dynamodb")
		_, err = ec2.LookupManagedPrefixList(ctx, &ec2.LookupManagedPrefixListArgs{
			Name: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

current = aws.get_region()
example = aws.ec2.get_managed_prefix_list(name=f"com.amazonaws.{current.name}.dynamodb")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const current = pulumi.output(aws.getRegion({ async: true }));
const example = current.apply(current => aws.ec2.getManagedPrefixList({
    name: `com.amazonaws.${current.name!}.dynamodb`,
}, { async: true }));

Find a managed prefix list using filters

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.Ec2.GetManagedPrefixList.InvokeAsync(new Aws.Ec2.GetManagedPrefixListArgs
        {
            Filters = 
            {
                new Aws.Ec2.Inputs.GetManagedPrefixListFilterArgs
                {
                    Name = "prefix-list-name",
                    Values = 
                    {
                        "my-prefix-list",
                    },
                },
            },
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.LookupManagedPrefixList(ctx, &ec2.LookupManagedPrefixListArgs{
			Filters: []ec2.GetManagedPrefixListFilter{
				ec2.GetManagedPrefixListFilter{
					Name: "prefix-list-name",
					Values: []string{
						"my-prefix-list",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example = aws.ec2.get_managed_prefix_list(filters=[aws.ec2.GetManagedPrefixListFilterArgs(
    name="prefix-list-name",
    values=["my-prefix-list"],
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.ec2.getManagedPrefixList({
    filters: [{
        name: "prefix-list-name",
        values: ["my-prefix-list"],
    }],
}, { async: true }));

Using getManagedPrefixList

function getManagedPrefixList(args: GetManagedPrefixListArgs, opts?: InvokeOptions): Promise<GetManagedPrefixListResult>
def get_managed_prefix_list(filters: Optional[Sequence[GetManagedPrefixListFilter]] = None,
                            id: Optional[str] = None,
                            name: Optional[str] = None,
                            tags: Optional[Mapping[str, str]] = None,
                            opts: Optional[InvokeOptions] = None) -> GetManagedPrefixListResult
func LookupManagedPrefixList(ctx *Context, args *LookupManagedPrefixListArgs, opts ...InvokeOption) (*LookupManagedPrefixListResult, error)

Note: This function is named LookupManagedPrefixList in the Go SDK.

public static class GetManagedPrefixList {
    public static Task<GetManagedPrefixListResult> InvokeAsync(GetManagedPrefixListArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Filters List<GetManagedPrefixListFilter>
Configuration block(s) for filtering. Detailed below.
Id string
The ID of the prefix list to select.
Name string
The name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
Tags Dictionary<string, string>
A map of tags assigned to the resource.
Filters []GetManagedPrefixListFilter
Configuration block(s) for filtering. Detailed below.
Id string
The ID of the prefix list to select.
Name string
The name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
Tags map[string]string
A map of tags assigned to the resource.
filters GetManagedPrefixListFilter[]
Configuration block(s) for filtering. Detailed below.
id string
The ID of the prefix list to select.
name string
The name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
tags {[key: string]: string}
A map of tags assigned to the resource.
filters Sequence[GetManagedPrefixListFilter]
Configuration block(s) for filtering. Detailed below.
id str
The ID of the prefix list to select.
name str
The name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
tags Mapping[str, str]
A map of tags assigned to the resource.

getManagedPrefixList Result

The following output properties are available:

AddressFamily string
The address family of the prefix list. Valid values are IPv4 and IPv6.
Arn string
The ARN of the selected prefix list.
Entries List<GetManagedPrefixListEntry>
The set of entries in this prefix list. Each entry is an object with cidr and description.
Id string
The ID of the selected prefix list.
MaxEntries int
When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
Name string
The name of the selected prefix list.
OwnerId string
The Account ID of the owner of a customer-managed prefix list, or AWS otherwise.
Tags Dictionary<string, string>
A map of tags assigned to the resource.
Version int
Filters List<GetManagedPrefixListFilter>
AddressFamily string
The address family of the prefix list. Valid values are IPv4 and IPv6.
Arn string
The ARN of the selected prefix list.
Entries []GetManagedPrefixListEntry
The set of entries in this prefix list. Each entry is an object with cidr and description.
Id string
The ID of the selected prefix list.
MaxEntries int
When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
Name string
The name of the selected prefix list.
OwnerId string
The Account ID of the owner of a customer-managed prefix list, or AWS otherwise.
Tags map[string]string
A map of tags assigned to the resource.
Version int
Filters []GetManagedPrefixListFilter
addressFamily string
The address family of the prefix list. Valid values are IPv4 and IPv6.
arn string
The ARN of the selected prefix list.
entries GetManagedPrefixListEntry[]
The set of entries in this prefix list. Each entry is an object with cidr and description.
id string
The ID of the selected prefix list.
maxEntries number
When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
name string
The name of the selected prefix list.
ownerId string
The Account ID of the owner of a customer-managed prefix list, or AWS otherwise.
tags {[key: string]: string}
A map of tags assigned to the resource.
version number
filters GetManagedPrefixListFilter[]
address_family str
The address family of the prefix list. Valid values are IPv4 and IPv6.
arn str
The ARN of the selected prefix list.
entries Sequence[GetManagedPrefixListEntry]
The set of entries in this prefix list. Each entry is an object with cidr and description.
id str
The ID of the selected prefix list.
max_entries int
When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
name str
The name of the selected prefix list.
owner_id str
The Account ID of the owner of a customer-managed prefix list, or AWS otherwise.
tags Mapping[str, str]
A map of tags assigned to the resource.
version int
filters Sequence[GetManagedPrefixListFilter]

Supporting Types

GetManagedPrefixListEntry

Cidr string
Description string
Cidr string
Description string
cidr string
description string

GetManagedPrefixListFilter

Name string
The name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
Values List<string>
Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
Name string
The name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
Values []string
Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
name string
The name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
values string[]
Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
name str
The name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
values Sequence[str]
Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.