1. Packages
  2. AWS
  3. API Docs
  4. ec2
  5. getManagedPrefixList
AWS v6.78.0 published on Thursday, Apr 24, 2025 by Pulumi

aws.ec2.getManagedPrefixList

Explore with Pulumi AI

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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const current = aws.getRegion({});
const example = current.then(current => aws.ec2.getManagedPrefixList({
    name: `com.amazonaws.${current.name}.dynamodb`,
}));
Copy
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")
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v6/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, &aws.GetRegionArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = ec2.LookupManagedPrefixList(ctx, &ec2.LookupManagedPrefixListArgs{
			Name: pulumi.StringRef(fmt.Sprintf("com.amazonaws.%v.dynamodb", current.Name)),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var current = Aws.GetRegion.Invoke();

    var example = Aws.Ec2.GetManagedPrefixList.Invoke(new()
    {
        Name = $"com.amazonaws.{current.Apply(getRegionResult => getRegionResult.Name)}.dynamodb",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetRegionArgs;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetManagedPrefixListArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var current = AwsFunctions.getRegion(GetRegionArgs.builder()
            .build());

        final var example = Ec2Functions.getManagedPrefixList(GetManagedPrefixListArgs.builder()
            .name(String.format("com.amazonaws.%s.dynamodb", current.name()))
            .build());

    }
}
Copy
variables:
  current:
    fn::invoke:
      function: aws:getRegion
      arguments: {}
  example:
    fn::invoke:
      function: aws:ec2:getManagedPrefixList
      arguments:
        name: com.amazonaws.${current.name}.dynamodb
Copy

Find a managed prefix list using filters

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = aws.ec2.getManagedPrefixList({
    filters: [{
        name: "prefix-list-name",
        values: ["my-prefix-list"],
    }],
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.ec2.get_managed_prefix_list(filters=[{
    "name": "prefix-list-name",
    "values": ["my-prefix-list"],
}])
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/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{
				{
					Name: "prefix-list-name",
					Values: []string{
						"my-prefix-list",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.Ec2.GetManagedPrefixList.Invoke(new()
    {
        Filters = new[]
        {
            new Aws.Ec2.Inputs.GetManagedPrefixListFilterInputArgs
            {
                Name = "prefix-list-name",
                Values = new[]
                {
                    "my-prefix-list",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetManagedPrefixListArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Ec2Functions.getManagedPrefixList(GetManagedPrefixListArgs.builder()
            .filters(GetManagedPrefixListFilterArgs.builder()
                .name("prefix-list-name")
                .values("my-prefix-list")
                .build())
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: aws:ec2:getManagedPrefixList
      arguments:
        filters:
          - name: prefix-list-name
            values:
              - my-prefix-list
Copy

Using getManagedPrefixList

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getManagedPrefixList(args: GetManagedPrefixListArgs, opts?: InvokeOptions): Promise<GetManagedPrefixListResult>
function getManagedPrefixListOutput(args: GetManagedPrefixListOutputArgs, opts?: InvokeOptions): Output<GetManagedPrefixListResult>
Copy
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
def get_managed_prefix_list_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetManagedPrefixListFilterArgs]]]] = None,
                            id: Optional[pulumi.Input[str]] = None,
                            name: Optional[pulumi.Input[str]] = None,
                            tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetManagedPrefixListResult]
Copy
func LookupManagedPrefixList(ctx *Context, args *LookupManagedPrefixListArgs, opts ...InvokeOption) (*LookupManagedPrefixListResult, error)
func LookupManagedPrefixListOutput(ctx *Context, args *LookupManagedPrefixListOutputArgs, opts ...InvokeOption) LookupManagedPrefixListResultOutput
Copy

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

public static class GetManagedPrefixList 
{
    public static Task<GetManagedPrefixListResult> InvokeAsync(GetManagedPrefixListArgs args, InvokeOptions? opts = null)
    public static Output<GetManagedPrefixListResult> Invoke(GetManagedPrefixListInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetManagedPrefixListResult> getManagedPrefixList(GetManagedPrefixListArgs args, InvokeOptions options)
public static Output<GetManagedPrefixListResult> getManagedPrefixList(GetManagedPrefixListArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:ec2/getManagedPrefixList:getManagedPrefixList
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filters List<GetManagedPrefixListFilter>
Configuration block(s) for filtering. Detailed below.
Id string
ID of the prefix list to select.
Name string
Name of the prefix list to select.
Tags Dictionary<string, string>
Map of tags assigned to the resource.
Filters []GetManagedPrefixListFilter
Configuration block(s) for filtering. Detailed below.
Id string
ID of the prefix list to select.
Name string
Name of the prefix list to select.
Tags map[string]string
Map of tags assigned to the resource.
filters List<GetManagedPrefixListFilter>
Configuration block(s) for filtering. Detailed below.
id String
ID of the prefix list to select.
name String
Name of the prefix list to select.
tags Map<String,String>
Map of tags assigned to the resource.
filters GetManagedPrefixListFilter[]
Configuration block(s) for filtering. Detailed below.
id string
ID of the prefix list to select.
name string
Name of the prefix list to select.
tags {[key: string]: string}
Map of tags assigned to the resource.
filters Sequence[GetManagedPrefixListFilter]
Configuration block(s) for filtering. Detailed below.
id str
ID of the prefix list to select.
name str
Name of the prefix list to select.
tags Mapping[str, str]
Map of tags assigned to the resource.
filters List<Property Map>
Configuration block(s) for filtering. Detailed below.
id String
ID of the prefix list to select.
name String
Name of the prefix list to select.
tags Map<String>
Map of tags assigned to the resource.

getManagedPrefixList Result

The following output properties are available:

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

Supporting Types

GetManagedPrefixListEntry

Cidr This property is required. string
Description This property is required. string
Cidr This property is required. string
Description This property is required. string
cidr This property is required. String
description This property is required. String
cidr This property is required. string
description This property is required. string
cidr This property is required. str
description This property is required. str
cidr This property is required. String
description This property is required. String

GetManagedPrefixListFilter

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

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.