ManagedPrefixList

Provides a managed prefix list resource.

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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.Ec2.ManagedPrefixList("example", new Aws.Ec2.ManagedPrefixListArgs
        {
            AddressFamily = "IPv4",
            MaxEntries = 5,
            Entries = 
            {
                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/v4/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.ManagedPrefixListEntryArray{
				&ec2.ManagedPrefixListEntryArgs{
					Cidr:        pulumi.Any(aws_vpc.Example.Cidr_block),
					Description: pulumi.String("Primary"),
				},
				&ec2.ManagedPrefixListEntryArgs{
					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
	})
}
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",
    },
});

Create a 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,
                      tags_all: 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)
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.

ManagedPrefixList Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model 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<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 string
Name of this resource. The name must not start with com.amazonaws.
Tags Dictionary<string, string>
TagsAll Dictionary<string, string>
AddressFamily string
Address family (IPv4 or IPv6) of this prefix list.
MaxEntries int
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 map[string]string
TagsAll map[string]string
addressFamily string
Address family (IPv4 or IPv6) of this prefix list.
maxEntries number
Maximum number of entries that this prefix list can contain.
entries 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 string
Name of this resource. The name must not start with com.amazonaws.
tags {[key: string]: string}
tagsAll {[key: string]: string}
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]
tags_all Mapping[str, str]

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.
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.
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.
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.
version int
Latest version of this prefix list.

Look up an 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)
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.

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<ManagedPrefixListEntryArgs>
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>
TagsAll Dictionary<string, string>
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 []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 map[string]string
TagsAll map[string]string
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 ManagedPrefixListEntryArgs[]
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}
tagsAll {[key: string]: string}
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]
tags_all Mapping[str, str]
version int
Latest version of this prefix list.

Supporting Types

ManagedPrefixListEntry

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.

Import

Prefix Lists can be imported using the id, e.g.

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

Package Details

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