1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. getManagedPrefixList

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

aws.ec2.getManagedPrefixList

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

    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, nil, 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=[aws.ec2.GetManagedPrefixListFilterArgs(
        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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2/getManagedPrefixList:getManagedPrefixList
      arguments:
        # arguments dictionary

    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 string
    Description string
    Cidr string
    Description string
    cidr String
    description String
    cidr string
    description string
    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 aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi