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

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

AWS Classic v6.2.0 published on Monday, Sep 18, 2023 by Pulumi

aws.ec2.ManagedPrefixList

Explore with Pulumi AI

aws logo

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

AWS Classic v6.2.0 published on Monday, Sep 18, 2023 by Pulumi

    Provides a managed prefix list resource.

    NOTE on Managed Prefix Lists and Managed Prefix List Entries: The provider currently provides both a standalone Managed Prefix List Entry resource (a single entry), and a Managed Prefix List resource with entries defined in-line. At this time you cannot use a Managed Prefix List with in-line rules in conjunction with any Managed Prefix List Entry resources. Doing so will cause a conflict of entries and will overwrite entries.

    NOTE on max_entries: When you reference a Prefix List in a resource, the maximum number of entries for the prefix lists counts as the same number of rules or entries for the resource. For example, if you create a prefix list with a maximum of 20 entries and you reference that prefix list in a security group rule, this counts as 20 rules for the security group.

    Example Usage

    Basic usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Ec2.ManagedPrefixList("example", new()
        {
            AddressFamily = "IPv4",
            MaxEntries = 5,
            Entries = new[]
            {
                new Aws.Ec2.Inputs.ManagedPrefixListEntryArgs
                {
                    Cidr = aws_vpc.Example.Cidr_block,
                    Description = "Primary",
                },
                new Aws.Ec2.Inputs.ManagedPrefixListEntryArgs
                {
                    Cidr = aws_vpc_ipv4_cidr_block_association.Example.Cidr_block,
                    Description = "Secondary",
                },
            },
            Tags = 
            {
                { "Env", "live" },
            },
        });
    
    });
    
    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.NewManagedPrefixList(ctx, "example", &ec2.ManagedPrefixListArgs{
    			AddressFamily: pulumi.String("IPv4"),
    			MaxEntries:    pulumi.Int(5),
    			Entries: ec2.ManagedPrefixListEntryTypeArray{
    				&ec2.ManagedPrefixListEntryTypeArgs{
    					Cidr:        pulumi.Any(aws_vpc.Example.Cidr_block),
    					Description: pulumi.String("Primary"),
    				},
    				&ec2.ManagedPrefixListEntryTypeArgs{
    					Cidr:        pulumi.Any(aws_vpc_ipv4_cidr_block_association.Example.Cidr_block),
    					Description: pulumi.String("Secondary"),
    				},
    			},
    			Tags: pulumi.StringMap{
    				"Env": pulumi.String("live"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.ManagedPrefixList;
    import com.pulumi.aws.ec2.ManagedPrefixListArgs;
    import com.pulumi.aws.ec2.inputs.ManagedPrefixListEntryArgs;
    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) {
            var example = new ManagedPrefixList("example", ManagedPrefixListArgs.builder()        
                .addressFamily("IPv4")
                .maxEntries(5)
                .entries(            
                    ManagedPrefixListEntryArgs.builder()
                        .cidr(aws_vpc.example().cidr_block())
                        .description("Primary")
                        .build(),
                    ManagedPrefixListEntryArgs.builder()
                        .cidr(aws_vpc_ipv4_cidr_block_association.example().cidr_block())
                        .description("Secondary")
                        .build())
                .tags(Map.of("Env", "live"))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.ManagedPrefixList("example",
        address_family="IPv4",
        max_entries=5,
        entries=[
            aws.ec2.ManagedPrefixListEntryArgs(
                cidr=aws_vpc["example"]["cidr_block"],
                description="Primary",
            ),
            aws.ec2.ManagedPrefixListEntryArgs(
                cidr=aws_vpc_ipv4_cidr_block_association["example"]["cidr_block"],
                description="Secondary",
            ),
        ],
        tags={
            "Env": "live",
        })
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.ManagedPrefixList("example", {
        addressFamily: "IPv4",
        maxEntries: 5,
        entries: [
            {
                cidr: aws_vpc.example.cidr_block,
                description: "Primary",
            },
            {
                cidr: aws_vpc_ipv4_cidr_block_association.example.cidr_block,
                description: "Secondary",
            },
        ],
        tags: {
            Env: "live",
        },
    });
    
    resources:
      example:
        type: aws:ec2:ManagedPrefixList
        properties:
          addressFamily: IPv4
          maxEntries: 5
          entries:
            - cidr: ${aws_vpc.example.cidr_block}
              description: Primary
            - cidr: ${aws_vpc_ipv4_cidr_block_association.example.cidr_block}
              description: Secondary
          tags:
            Env: live
    

    Create ManagedPrefixList Resource

    new ManagedPrefixList(name: string, args: ManagedPrefixListArgs, opts?: CustomResourceOptions);
    @overload
    def ManagedPrefixList(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          address_family: Optional[str] = None,
                          entries: Optional[Sequence[ManagedPrefixListEntryArgs]] = None,
                          max_entries: Optional[int] = None,
                          name: Optional[str] = None,
                          tags: Optional[Mapping[str, str]] = None)
    @overload
    def ManagedPrefixList(resource_name: str,
                          args: ManagedPrefixListArgs,
                          opts: Optional[ResourceOptions] = None)
    func NewManagedPrefixList(ctx *Context, name string, args ManagedPrefixListArgs, opts ...ResourceOption) (*ManagedPrefixList, error)
    public ManagedPrefixList(string name, ManagedPrefixListArgs args, CustomResourceOptions? opts = null)
    public ManagedPrefixList(String name, ManagedPrefixListArgs args)
    public ManagedPrefixList(String name, ManagedPrefixListArgs args, CustomResourceOptions options)
    
    type: aws:ec2:ManagedPrefixList
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ManagedPrefixListArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ManagedPrefixListArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ManagedPrefixListArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ManagedPrefixListArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ManagedPrefixListArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ManagedPrefixList Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ManagedPrefixList resource accepts the following input properties:

    AddressFamily string

    Address family (IPv4 or IPv6) of this prefix list.

    MaxEntries int

    Maximum number of entries that this prefix list can contain.

    Entries List<ManagedPrefixListEntry>

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    Name string

    Name of this resource. The name must not start with com.amazonaws.

    Tags Dictionary<string, string>

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    AddressFamily string

    Address family (IPv4 or IPv6) of this prefix list.

    MaxEntries int

    Maximum number of entries that this prefix list can contain.

    Entries []ManagedPrefixListEntryTypeArgs

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    Name string

    Name of this resource. The name must not start with com.amazonaws.

    Tags map[string]string

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    addressFamily String

    Address family (IPv4 or IPv6) of this prefix list.

    maxEntries Integer

    Maximum number of entries that this prefix list can contain.

    entries List<ManagedPrefixListEntry>

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    name String

    Name of this resource. The name must not start with com.amazonaws.

    tags Map<String,String>

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    addressFamily string

    Address family (IPv4 or IPv6) of this prefix list.

    maxEntries number

    Maximum number of entries that this prefix list can contain.

    entries ManagedPrefixListEntry[]

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    name string

    Name of this resource. The name must not start with com.amazonaws.

    tags {[key: string]: string}

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    address_family str

    Address family (IPv4 or IPv6) of this prefix list.

    max_entries int

    Maximum number of entries that this prefix list can contain.

    entries Sequence[ManagedPrefixListEntryArgs]

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    name str

    Name of this resource. The name must not start with com.amazonaws.

    tags Mapping[str, str]

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    addressFamily String

    Address family (IPv4 or IPv6) of this prefix list.

    maxEntries Number

    Maximum number of entries that this prefix list can contain.

    entries List<Property Map>

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    name String

    Name of this resource. The name must not start with com.amazonaws.

    tags Map<String>

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ManagedPrefixList resource produces the following output properties:

    Arn string

    ARN of the prefix list.

    Id string

    The provider-assigned unique ID for this managed resource.

    OwnerId string

    ID of the AWS account that owns this prefix list.

    TagsAll Dictionary<string, string>

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Version int

    Latest version of this prefix list.

    Arn string

    ARN of the prefix list.

    Id string

    The provider-assigned unique ID for this managed resource.

    OwnerId string

    ID of the AWS account that owns this prefix list.

    TagsAll map[string]string

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Version int

    Latest version of this prefix list.

    arn String

    ARN of the prefix list.

    id String

    The provider-assigned unique ID for this managed resource.

    ownerId String

    ID of the AWS account that owns this prefix list.

    tagsAll Map<String,String>

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    version Integer

    Latest version of this prefix list.

    arn string

    ARN of the prefix list.

    id string

    The provider-assigned unique ID for this managed resource.

    ownerId string

    ID of the AWS account that owns this prefix list.

    tagsAll {[key: string]: string}

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    version number

    Latest version of this prefix list.

    arn str

    ARN of the prefix list.

    id str

    The provider-assigned unique ID for this managed resource.

    owner_id str

    ID of the AWS account that owns this prefix list.

    tags_all Mapping[str, str]

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    version int

    Latest version of this prefix list.

    arn String

    ARN of the prefix list.

    id String

    The provider-assigned unique ID for this managed resource.

    ownerId String

    ID of the AWS account that owns this prefix list.

    tagsAll Map<String>

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    version Number

    Latest version of this prefix list.

    Look up Existing ManagedPrefixList Resource

    Get an existing ManagedPrefixList resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ManagedPrefixListState, opts?: CustomResourceOptions): ManagedPrefixList
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            address_family: Optional[str] = None,
            arn: Optional[str] = None,
            entries: Optional[Sequence[ManagedPrefixListEntryArgs]] = None,
            max_entries: Optional[int] = None,
            name: Optional[str] = None,
            owner_id: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None,
            version: Optional[int] = None) -> ManagedPrefixList
    func GetManagedPrefixList(ctx *Context, name string, id IDInput, state *ManagedPrefixListState, opts ...ResourceOption) (*ManagedPrefixList, error)
    public static ManagedPrefixList Get(string name, Input<string> id, ManagedPrefixListState? state, CustomResourceOptions? opts = null)
    public static ManagedPrefixList get(String name, Output<String> id, ManagedPrefixListState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AddressFamily string

    Address family (IPv4 or IPv6) of this prefix list.

    Arn string

    ARN of the prefix list.

    Entries List<ManagedPrefixListEntry>

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    MaxEntries int

    Maximum number of entries that this prefix list can contain.

    Name string

    Name of this resource. The name must not start with com.amazonaws.

    OwnerId string

    ID of the AWS account that owns this prefix list.

    Tags Dictionary<string, string>

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    TagsAll Dictionary<string, string>

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Version int

    Latest version of this prefix list.

    AddressFamily string

    Address family (IPv4 or IPv6) of this prefix list.

    Arn string

    ARN of the prefix list.

    Entries []ManagedPrefixListEntryTypeArgs

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    MaxEntries int

    Maximum number of entries that this prefix list can contain.

    Name string

    Name of this resource. The name must not start with com.amazonaws.

    OwnerId string

    ID of the AWS account that owns this prefix list.

    Tags map[string]string

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    TagsAll map[string]string

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Version int

    Latest version of this prefix list.

    addressFamily String

    Address family (IPv4 or IPv6) of this prefix list.

    arn String

    ARN of the prefix list.

    entries List<ManagedPrefixListEntry>

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    maxEntries Integer

    Maximum number of entries that this prefix list can contain.

    name String

    Name of this resource. The name must not start with com.amazonaws.

    ownerId String

    ID of the AWS account that owns this prefix list.

    tags Map<String,String>

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll Map<String,String>

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    version Integer

    Latest version of this prefix list.

    addressFamily string

    Address family (IPv4 or IPv6) of this prefix list.

    arn string

    ARN of the prefix list.

    entries ManagedPrefixListEntry[]

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    maxEntries number

    Maximum number of entries that this prefix list can contain.

    name string

    Name of this resource. The name must not start with com.amazonaws.

    ownerId string

    ID of the AWS account that owns this prefix list.

    tags {[key: string]: string}

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll {[key: string]: string}

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    version number

    Latest version of this prefix list.

    address_family str

    Address family (IPv4 or IPv6) of this prefix list.

    arn str

    ARN of the prefix list.

    entries Sequence[ManagedPrefixListEntryArgs]

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    max_entries int

    Maximum number of entries that this prefix list can contain.

    name str

    Name of this resource. The name must not start with com.amazonaws.

    owner_id str

    ID of the AWS account that owns this prefix list.

    tags Mapping[str, str]

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tags_all Mapping[str, str]

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    version int

    Latest version of this prefix list.

    addressFamily String

    Address family (IPv4 or IPv6) of this prefix list.

    arn String

    ARN of the prefix list.

    entries List<Property Map>

    Configuration block for prefix list entry. Detailed below. Different entries may have overlapping CIDR blocks, but a particular CIDR should not be duplicated.

    maxEntries Number

    Maximum number of entries that this prefix list can contain.

    name String

    Name of this resource. The name must not start with com.amazonaws.

    ownerId String

    ID of the AWS account that owns this prefix list.

    tags Map<String>

    Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll Map<String>

    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    version Number

    Latest version of this prefix list.

    Supporting Types

    ManagedPrefixListEntry, ManagedPrefixListEntryArgs

    Cidr string

    CIDR block of this entry.

    Description string

    Description of this entry. Due to API limitations, updating only the description of an existing entry requires temporarily removing and re-adding the entry.

    Cidr string

    CIDR block of this entry.

    Description string

    Description of this entry. Due to API limitations, updating only the description of an existing entry requires temporarily removing and re-adding the entry.

    cidr String

    CIDR block of this entry.

    description String

    Description of this entry. Due to API limitations, updating only the description of an existing entry requires temporarily removing and re-adding the entry.

    cidr string

    CIDR block of this entry.

    description string

    Description of this entry. Due to API limitations, updating only the description of an existing entry requires temporarily removing and re-adding the entry.

    cidr str

    CIDR block of this entry.

    description str

    Description of this entry. Due to API limitations, updating only the description of an existing entry requires temporarily removing and re-adding the entry.

    cidr String

    CIDR block of this entry.

    description String

    Description of this entry. Due to API limitations, updating only the description of an existing entry requires temporarily removing and re-adding the entry.

    Import

    Using pulumi import, import Prefix Lists using the id. For example:

     $ pulumi import aws:ec2/managedPrefixList:ManagedPrefixList default pl-0570a1d2d725c16be
    

    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.2.0 published on Monday, Sep 18, 2023 by Pulumi