ManagedPrefixListEntryEc2 class

Use the aws.ec2.ManagedPrefixListEntry resource to manage a managed prefix list entry.

> NOTE: Pulumi currently provides two resources for managing Managed Prefix Lists and Managed Prefix List Entries. The standalone resource, Managed Prefix List Entry, is used to manage a single entry. The Managed Prefix List resource is used to manage multiple entries defined in-line. It is important to note that you cannot use a Managed Prefix List with in-line rules in conjunction with any Managed Prefix List Entry resources. This will result in a conflict of entries and will cause the entries to be overwritten.

> NOTE: To improve execution times on larger updates, it is recommended to use the inline entry block as part of the Managed Prefix List resource when creating a prefix list with more than 100 entries. You can find more information about the resource here.

Example Usage

Basic usage.

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

const example = new aws.ec2.ManagedPrefixList("example", {
    name: "All VPC CIDR-s",
    addressFamily: "IPv4",
    maxEntries: 5,
    tags: {
        Env: "live",
    },
});
const entry1 = new aws.ec2.ManagedPrefixListEntry("entry_1", {
    cidr: exampleAwsVpc.cidrBlock,
    description: "Primary",
    prefixListId: example.id,
});
import pulumi
import pulumi_aws as aws

example = aws.ec2.ManagedPrefixList("example",
    name="All VPC CIDR-s",
    address_family="IPv4",
    max_entries=5,
    tags={
        "Env": "live",
    })
entry1 = aws.ec2.ManagedPrefixListEntry("entry_1",
    cidr=example_aws_vpc["cidrBlock"],
    description="Primary",
    prefix_list_id=example.id)
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()
    {
        Name = "All VPC CIDR-s",
        AddressFamily = "IPv4",
        MaxEntries = 5,
        Tags =
        {
            { "Env", "live" },
        },
    });

    var entry1 = new Aws.Ec2.ManagedPrefixListEntry("entry_1", new()
    {
        Cidr = exampleAwsVpc.CidrBlock,
        Description = "Primary",
        PrefixListId = example.Id,
    });

});
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 {
		example, err := ec2.NewManagedPrefixList(ctx, "example", &ec2.ManagedPrefixListArgs{
			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
		}
		_, err = ec2.NewManagedPrefixListEntry(ctx, "entry_1", &ec2.ManagedPrefixListEntryArgs{
			Cidr:         pulumi.Any(exampleAwsVpc.CidrBlock),
			Description:  pulumi.String("Primary"),
			PrefixListId: example.ID().ToIDOutput().ToStringOutput(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_ec2_managedprefixlist" "example" {
  name           = "All VPC CIDR-s"
  address_family = "IPv4"
  max_entries    = 5
  tags = {
    "Env" = "live"
  }
}
resource "aws_ec2_managedprefixlistentry" "entry_1" {
  cidr           = exampleAwsVpc.cidrBlock
  description    = "Primary"
  prefix_list_id = aws_ec2_managedprefixlist.example.id
}
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.ManagedPrefixListEntry;
import com.pulumi.aws.ec2.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()
            .name("All VPC CIDR-s")
            .addressFamily("IPv4")
            .maxEntries(5)
            .tags(Map.of("Env", "live"))
            .build());

        var entry1 = new ManagedPrefixListEntry("entry1", ManagedPrefixListEntryArgs.builder()
            .cidr(exampleAwsVpc.cidrBlock())
            .description("Primary")
            .prefixListId(example.id())
            .build());

    }
}
resources:
  example:
    type: aws:ec2:ManagedPrefixList
    properties:
      name: All VPC CIDR-s
      addressFamily: IPv4
      maxEntries: 5
      tags:
        Env: live
  entry1:
    type: aws:ec2:ManagedPrefixListEntry
    name: entry_1
    properties:
      cidr: ${exampleAwsVpc.cidrBlock}
      description: Primary
      prefixListId: ${example.id}

Import

Using pulumi import, import prefix list entries using prefixListId and cidr separated by a comma (,). For example:

$ pulumi import aws:ec2/managedPrefixListEntry:ManagedPrefixListEntry default pl-0570a1d2d725c16be,10.0.3.0/24

Constructors

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

Properties

childResources → Set<Resource>
finalinherited
cidr ↔ Output<String>
CIDR block of this entry.
latefinal
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
description ↔ Output<String?>
Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.
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
prefixListId ↔ Output<String>
The ID of the 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
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

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, {ManagedPrefixListEntryState? state, CustomResourceOptions? options}) → ManagedPrefixListEntryEc2
Gets an existing ManagedPrefixListEntryEc2 resource's state with the given name and id.