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

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

AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi

aws.ec2.ManagedPrefixListEntry

Explore with Pulumi AI

aws logo

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

AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi

    Use the aws_prefix_list_entry 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.

    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,
            Tags = 
            {
                { "Env", "live" },
            },
        });
    
        var entry1 = new Aws.Ec2.ManagedPrefixListEntry("entry1", new()
        {
            Cidr = aws_vpc.Example.Cidr_block,
            Description = "Primary",
            PrefixListId = example.Id,
        });
    
    });
    
    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 {
    		example, err := ec2.NewManagedPrefixList(ctx, "example", &ec2.ManagedPrefixListArgs{
    			AddressFamily: pulumi.String("IPv4"),
    			MaxEntries:    pulumi.Int(5),
    			Tags: pulumi.StringMap{
    				"Env": pulumi.String("live"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ec2.NewManagedPrefixListEntry(ctx, "entry1", &ec2.ManagedPrefixListEntryArgs{
    			Cidr:         pulumi.Any(aws_vpc.Example.Cidr_block),
    			Description:  pulumi.String("Primary"),
    			PrefixListId: example.ID(),
    		})
    		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.ManagedPrefixListEntry;
    import com.pulumi.aws.ec2.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)
                .tags(Map.of("Env", "live"))
                .build());
    
            var entry1 = new ManagedPrefixListEntry("entry1", ManagedPrefixListEntryArgs.builder()        
                .cidr(aws_vpc.example().cidr_block())
                .description("Primary")
                .prefixListId(example.id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.ManagedPrefixList("example",
        address_family="IPv4",
        max_entries=5,
        tags={
            "Env": "live",
        })
    entry1 = aws.ec2.ManagedPrefixListEntry("entry1",
        cidr=aws_vpc["example"]["cidr_block"],
        description="Primary",
        prefix_list_id=example.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.ManagedPrefixList("example", {
        addressFamily: "IPv4",
        maxEntries: 5,
        tags: {
            Env: "live",
        },
    });
    const entry1 = new aws.ec2.ManagedPrefixListEntry("entry1", {
        cidr: aws_vpc.example.cidr_block,
        description: "Primary",
        prefixListId: example.id,
    });
    
    resources:
      example:
        type: aws:ec2:ManagedPrefixList
        properties:
          addressFamily: IPv4
          maxEntries: 5
          tags:
            Env: live
      entry1:
        type: aws:ec2:ManagedPrefixListEntry
        properties:
          cidr: ${aws_vpc.example.cidr_block}
          description: Primary
          prefixListId: ${example.id}
    

    Create ManagedPrefixListEntry Resource

    new ManagedPrefixListEntry(name: string, args: ManagedPrefixListEntryArgs, opts?: CustomResourceOptions);
    @overload
    def ManagedPrefixListEntry(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               cidr: Optional[str] = None,
                               description: Optional[str] = None,
                               prefix_list_id: Optional[str] = None)
    @overload
    def ManagedPrefixListEntry(resource_name: str,
                               args: ManagedPrefixListEntryInitArgs,
                               opts: Optional[ResourceOptions] = None)
    func NewManagedPrefixListEntry(ctx *Context, name string, args ManagedPrefixListEntryArgs, opts ...ResourceOption) (*ManagedPrefixListEntry, error)
    public ManagedPrefixListEntry(string name, ManagedPrefixListEntryArgs args, CustomResourceOptions? opts = null)
    public ManagedPrefixListEntry(String name, ManagedPrefixListEntryArgs args)
    public ManagedPrefixListEntry(String name, ManagedPrefixListEntryArgs args, CustomResourceOptions options)
    
    type: aws:ec2:ManagedPrefixListEntry
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ManagedPrefixListEntryArgs
    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 ManagedPrefixListEntryInitArgs
    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 ManagedPrefixListEntryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ManagedPrefixListEntryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ManagedPrefixListEntryArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ManagedPrefixListEntry 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 ManagedPrefixListEntry resource accepts the following input properties:

    Cidr string

    CIDR block of this entry.

    PrefixListId string

    CIDR block of this entry.

    Description string

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    Cidr string

    CIDR block of this entry.

    PrefixListId string

    CIDR block of this entry.

    Description string

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    cidr String

    CIDR block of this entry.

    prefixListId String

    CIDR block of this entry.

    description String

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    cidr string

    CIDR block of this entry.

    prefixListId string

    CIDR block of this entry.

    description string

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    cidr str

    CIDR block of this entry.

    prefix_list_id str

    CIDR block of this entry.

    description str

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    cidr String

    CIDR block of this entry.

    prefixListId String

    CIDR block of this entry.

    description String

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    Outputs

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

    Id string

    The provider-assigned unique ID for this managed resource.

    Id string

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    id string

    The provider-assigned unique ID for this managed resource.

    id str

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    Look up Existing ManagedPrefixListEntry Resource

    Get an existing ManagedPrefixListEntry 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?: ManagedPrefixListEntryState, opts?: CustomResourceOptions): ManagedPrefixListEntry
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cidr: Optional[str] = None,
            description: Optional[str] = None,
            prefix_list_id: Optional[str] = None) -> ManagedPrefixListEntry
    func GetManagedPrefixListEntry(ctx *Context, name string, id IDInput, state *ManagedPrefixListEntryState, opts ...ResourceOption) (*ManagedPrefixListEntry, error)
    public static ManagedPrefixListEntry Get(string name, Input<string> id, ManagedPrefixListEntryState? state, CustomResourceOptions? opts = null)
    public static ManagedPrefixListEntry get(String name, Output<String> id, ManagedPrefixListEntryState 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:
    Cidr string

    CIDR block of this entry.

    Description string

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    PrefixListId string

    CIDR block of this entry.

    Cidr string

    CIDR block of this entry.

    Description string

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    PrefixListId string

    CIDR block of this entry.

    cidr String

    CIDR block of this entry.

    description String

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    prefixListId String

    CIDR block of this entry.

    cidr string

    CIDR block of this entry.

    description string

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    prefixListId string

    CIDR block of this entry.

    cidr str

    CIDR block of this entry.

    description str

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    prefix_list_id str

    CIDR block of this entry.

    cidr String

    CIDR block of this entry.

    description String

    Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.

    prefixListId String

    CIDR block of this entry.

    Import

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

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

    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.1 published on Friday, Sep 22, 2023 by Pulumi