AWS v6.73.0 published on Wednesday, Mar 19, 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`,
}));
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")
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
	})
}
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",
    });
});
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();
        final var example = Ec2Functions.getManagedPrefixList(GetManagedPrefixListArgs.builder()
            .name(String.format("com.amazonaws.%s.dynamodb", current.applyValue(getRegionResult -> getRegionResult.name())))
            .build());
    }
}
variables:
  current:
    fn::invoke:
      function: aws:getRegion
      arguments: {}
  example:
    fn::invoke:
      function: aws:ec2:getManagedPrefixList
      arguments:
        name: com.amazonaws.${current.name}.dynamodb
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"],
    }],
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.get_managed_prefix_list(filters=[{
    "name": "prefix-list-name",
    "values": ["my-prefix-list"],
}])
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
	})
}
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",
                },
            },
        },
    });
});
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());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:ec2:getManagedPrefixList
      arguments:
        filters:
          - name: prefix-list-name
            values:
              - my-prefix-list
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>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]func LookupManagedPrefixList(ctx *Context, args *LookupManagedPrefixListArgs, opts ...InvokeOption) (*LookupManagedPrefixListResult, error)
func LookupManagedPrefixListOutput(ctx *Context, args *LookupManagedPrefixListOutputArgs, opts ...InvokeOption) LookupManagedPrefixListResultOutput> 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)
}public static CompletableFuture<GetManagedPrefixListResult> getManagedPrefixList(GetManagedPrefixListArgs args, InvokeOptions options)
public static Output<GetManagedPrefixListResult> getManagedPrefixList(GetManagedPrefixListArgs args, InvokeOptions options)
fn::invoke:
  function: aws:ec2/getManagedPrefixList:getManagedPrefixList
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Filters
List<GetManaged Prefix List Filter> 
- 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.
- Dictionary<string, string>
- Map of tags assigned to the resource.
- Filters
[]GetManaged Prefix List Filter 
- 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.
- map[string]string
- Map of tags assigned to the resource.
- filters
List<GetManaged Prefix List Filter> 
- 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.
- Map<String,String>
- Map of tags assigned to the resource.
- filters
GetManaged Prefix List Filter[] 
- 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.
- {[key: string]: string}
- Map of tags assigned to the resource.
- filters
Sequence[GetManaged Prefix List Filter] 
- 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.
- 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.
- 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 IPv4andIPv6.
- Arn string
- ARN of the selected prefix list.
- Entries
List<GetManaged Prefix List Entry> 
- Set of entries in this prefix list. Each entry is an object with cidranddescription.
- 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 AWSotherwise.
- Dictionary<string, string>
- Map of tags assigned to the resource.
- Version int
- Filters
List<GetManaged Prefix List Filter> 
- AddressFamily string
- Address family of the prefix list. Valid values are IPv4andIPv6.
- Arn string
- ARN of the selected prefix list.
- Entries
[]GetManaged Prefix List Entry Type 
- Set of entries in this prefix list. Each entry is an object with cidranddescription.
- 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 AWSotherwise.
- map[string]string
- Map of tags assigned to the resource.
- Version int
- Filters
[]GetManaged Prefix List Filter 
- addressFamily String
- Address family of the prefix list. Valid values are IPv4andIPv6.
- arn String
- ARN of the selected prefix list.
- entries
List<GetManaged Prefix List Entry> 
- Set of entries in this prefix list. Each entry is an object with cidranddescription.
- 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 AWSotherwise.
- Map<String,String>
- Map of tags assigned to the resource.
- version Integer
- filters
List<GetManaged Prefix List Filter> 
- addressFamily string
- Address family of the prefix list. Valid values are IPv4andIPv6.
- arn string
- ARN of the selected prefix list.
- entries
GetManaged Prefix List Entry[] 
- Set of entries in this prefix list. Each entry is an object with cidranddescription.
- 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 AWSotherwise.
- {[key: string]: string}
- Map of tags assigned to the resource.
- version number
- filters
GetManaged Prefix List Filter[] 
- address_family str
- Address family of the prefix list. Valid values are IPv4andIPv6.
- arn str
- ARN of the selected prefix list.
- entries
Sequence[GetManaged Prefix List Entry] 
- Set of entries in this prefix list. Each entry is an object with cidranddescription.
- 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 AWSotherwise.
- Mapping[str, str]
- Map of tags assigned to the resource.
- version int
- filters
Sequence[GetManaged Prefix List Filter] 
- addressFamily String
- Address family of the prefix list. Valid values are IPv4andIPv6.
- 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 cidranddescription.
- 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 AWSotherwise.
- Map<String>
- Map of tags assigned to the resource.
- version Number
- filters List<Property Map>
Supporting Types
GetManagedPrefixListEntry    
- Cidr string
- Description string
- Cidr string
- Description string
- cidr String
- description String
- cidr string
- description string
- cidr str
- description str
- cidr String
- description String
GetManagedPrefixListFilter    
- Name string
- 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
- 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
- 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
- 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
- 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.
- name String
- 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.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.