ManagedPrefixList class

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 maxEntries: 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

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

const example = new aws.ec2.ManagedPrefixList("example", {
    entries: [
        {
            cidr: exampleAwsVpc.cidrBlock,
            description: "Primary",
        },
        {
            cidr: exampleAwsVpcIpv4CidrBlockAssociation.cidrBlock,
            description: "Secondary",
        },
    ],
    name: "All VPC CIDR-s",
    addressFamily: "IPv4",
    maxEntries: 5,
    tags: {
        Env: "live",
    },
});
import pulumi
import pulumi_aws as aws

example = aws.ec2.ManagedPrefixList("example",
    entries=[
        {
            "cidr": example_aws_vpc["cidrBlock"],
            "description": "Primary",
        },
        {
            "cidr": example_aws_vpc_ipv4_cidr_block_association["cidrBlock"],
            "description": "Secondary",
        },
    ],
    name="All VPC CIDR-s",
    address_family="IPv4",
    max_entries=5,
    tags={
        "Env": "live",
    })
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()
    {
        Entries = new[]
        {
            new Aws.Ec2.Inputs.ManagedPrefixListEntryArgs
            {
                Cidr = exampleAwsVpc.CidrBlock,
                Description = "Primary",
            },
            new Aws.Ec2.Inputs.ManagedPrefixListEntryArgs
            {
                Cidr = exampleAwsVpcIpv4CidrBlockAssociation.CidrBlock,
                Description = "Secondary",
            },
        },
        Name = "All VPC CIDR-s",
        AddressFamily = "IPv4",
        MaxEntries = 5,
        Tags =
        {
            { "Env", "live" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/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{
			Entries: ec2.ManagedPrefixListEntryTypeArray{
				&ec2.ManagedPrefixListEntryTypeArgs{
					Cidr:        pulumi.Any(exampleAwsVpc.CidrBlock),
					Description: pulumi.String("Primary"),
				},
				&ec2.ManagedPrefixListEntryTypeArgs{
					Cidr:        pulumi.Any(exampleAwsVpcIpv4CidrBlockAssociation.CidrBlock),
					Description: pulumi.String("Secondary"),
				},
			},
			Name:          pulumi.String("All VPC CIDR-s"),
			AddressFamily: pulumi.String("IPv4"),
			MaxEntries:    pulumi.Int(5),
			Tags: pulumi.StringMap{
				"Env": pulumi.String("live"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_ec2_managedprefixlist" "example" {
  entries {
    cidr        = exampleAwsVpc.cidrBlock
    description = "Primary"
  }
  entries {
    cidr        = exampleAwsVpcIpv4CidrBlockAssociation.cidrBlock
    description = "Secondary"
  }
  name           = "All VPC CIDR-s"
  address_family = "IPv4"
  max_entries    = 5
  tags = {
    "Env" = "live"
  }
}
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.ArrayList;
import java.util.Arrays;
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()
            .entries(
                ManagedPrefixListEntryArgs.builder()
                    .cidr(exampleAwsVpc.cidrBlock())
                    .description("Primary")
                    .build(),
                ManagedPrefixListEntryArgs.builder()
                    .cidr(exampleAwsVpcIpv4CidrBlockAssociation.cidrBlock())
                    .description("Secondary")
                    .build())
            .name("All VPC CIDR-s")
            .addressFamily("IPv4")
            .maxEntries(5)
            .tags(Map.of("Env", "live"))
            .build());

    }
}
resources:
  example:
    type: aws:ec2:ManagedPrefixList
    properties:
      entries:
        - cidr: ${exampleAwsVpc.cidrBlock}
          description: Primary
        - cidr: ${exampleAwsVpcIpv4CidrBlockAssociation.cidrBlock}
          description: Secondary
      name: All VPC CIDR-s
      addressFamily: IPv4
      maxEntries: 5
      tags:
        Env: live

Import

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

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

Constructors

ManagedPrefixList(String name, {ManagedPrefixListArgs? args, CustomResourceOptions? options})
Creates a new ManagedPrefixList. name The Pulumi resource name. args Arguments used to configure this ManagedPrefixList. The set of arguments for ManagedPrefixList. options Resource options controlling this resource's behavior.
ManagedPrefixList.reference(String urn)
Creates a typed reference to an existing ManagedPrefixList resource.

Properties

addressFamily ↔ Output<String>
Address family (IPv4 or IPv6) of this prefix list.
latefinal
arn ↔ Output<String>
ARN of the prefix list.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
entries ↔ Output<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.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
maxEntries ↔ Output<int>
Maximum number of entries that this prefix list can contain.
latefinal
name ↔ Output<String>
Name of this resource. The name must not start with com.amazonaws.
latefinal
ownerId ↔ Output<String>
ID of the AWS account that owns this prefix list.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tags ↔ Output<Map<String, String>?>
Map of tags to assign to this resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
version ↔ Output<int>
Latest version of this prefix list.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ManagedPrefixListState? state, CustomResourceOptions? options}) → ManagedPrefixList
Gets an existing ManagedPrefixList resource's state with the given name and id.