1. Registry
  2. Packages
  3. AWS Cloud Control
  4. API Docs
  5. ec2
  6. PrefixList

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.86.0
published on Wednesday, Nov 18, 2026 by Pulumi
aws-native logo aws-native logo AWS Cloud Control

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.86.0
published on Wednesday, Nov 18, 2026 by Pulumi

    Resource schema of AWS::EC2::PrefixList Type

    Example Usage

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var newPrefixList = new AwsNative.Ec2.PrefixList("newPrefixList", new()
        {
            PrefixListName = "vpc-1-servers",
            AddressFamily = AwsNative.Ec2.PrefixListAddressFamily.IPv4,
            MaxEntries = 10,
            Entries = new[]
            {
                new AwsNative.Ec2.Inputs.PrefixListEntryArgs
                {
                    Cidr = "10.0.0.5/32",
                    Description = "Server 1",
                },
                new AwsNative.Ec2.Inputs.PrefixListEntryArgs
                {
                    Cidr = "10.0.0.10/32",
                    Description = "Server 2",
                },
            },
            Tags = new[]
            {
                new AwsNative.Inputs.TagArgs
                {
                    Key = "Name",
                    Value = "VPC-1-Servers",
                },
            },
        });
    
    });
    
    package main
    
    import (
    	awsnative "github.com/pulumi/pulumi-aws-native/sdk/go/aws"
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ec2.NewPrefixList(ctx, "newPrefixList", &ec2.PrefixListArgs{
    			PrefixListName: pulumi.String("vpc-1-servers"),
    			AddressFamily:  ec2.PrefixListAddressFamilyIPv4,
    			MaxEntries:     pulumi.Int(10),
    			Entries: ec2.PrefixListEntryArray{
    				&ec2.PrefixListEntryArgs{
    					Cidr:        pulumi.String("10.0.0.5/32"),
    					Description: pulumi.String("Server 1"),
    				},
    				&ec2.PrefixListEntryArgs{
    					Cidr:        pulumi.String("10.0.0.10/32"),
    					Description: pulumi.String("Server 2"),
    				},
    			},
    			Tags: aws.TagArray{
    				&aws.TagArgs{
    					Key:   pulumi.String("Name"),
    					Value: pulumi.String("VPC-1-Servers"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const newPrefixList = new aws_native.ec2.PrefixList("newPrefixList", {
        prefixListName: "vpc-1-servers",
        addressFamily: aws_native.ec2.PrefixListAddressFamily.IPv4,
        maxEntries: 10,
        entries: [
            {
                cidr: "10.0.0.5/32",
                description: "Server 1",
            },
            {
                cidr: "10.0.0.10/32",
                description: "Server 2",
            },
        ],
        tags: [{
            key: "Name",
            value: "VPC-1-Servers",
        }],
    });
    
    import pulumi
    import pulumi_aws_native as aws_native
    
    new_prefix_list = aws_native.ec2.PrefixList("newPrefixList",
        prefix_list_name="vpc-1-servers",
        address_family=aws_native.ec2.PrefixListAddressFamily.I_PV4,
        max_entries=10,
        entries=[
            {
                "cidr": "10.0.0.5/32",
                "description": "Server 1",
            },
            {
                "cidr": "10.0.0.10/32",
                "description": "Server 2",
            },
        ],
        tags=[{
            "key": "Name",
            "value": "VPC-1-Servers",
        }])
    

    Example coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var newPrefixList = new AwsNative.Ec2.PrefixList("newPrefixList", new()
        {
            PrefixListName = "vpc-1-servers",
            AddressFamily = AwsNative.Ec2.PrefixListAddressFamily.IPv4,
            MaxEntries = 10,
            Entries = new[]
            {
                new AwsNative.Ec2.Inputs.PrefixListEntryArgs
                {
                    Cidr = "10.0.0.5/32",
                    Description = "Server 1",
                },
                new AwsNative.Ec2.Inputs.PrefixListEntryArgs
                {
                    Cidr = "10.0.0.10/32",
                    Description = "Server 2",
                },
            },
            Tags = new[]
            {
                new AwsNative.Inputs.TagArgs
                {
                    Key = "Name",
                    Value = "VPC-1-Servers",
                },
            },
        });
    
    });
    
    package main
    
    import (
    	awsnative "github.com/pulumi/pulumi-aws-native/sdk/go/aws"
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ec2.NewPrefixList(ctx, "newPrefixList", &ec2.PrefixListArgs{
    			PrefixListName: pulumi.String("vpc-1-servers"),
    			AddressFamily:  ec2.PrefixListAddressFamilyIPv4,
    			MaxEntries:     pulumi.Int(10),
    			Entries: ec2.PrefixListEntryArray{
    				&ec2.PrefixListEntryArgs{
    					Cidr:        pulumi.String("10.0.0.5/32"),
    					Description: pulumi.String("Server 1"),
    				},
    				&ec2.PrefixListEntryArgs{
    					Cidr:        pulumi.String("10.0.0.10/32"),
    					Description: pulumi.String("Server 2"),
    				},
    			},
    			Tags: aws.TagArray{
    				&aws.TagArgs{
    					Key:   pulumi.String("Name"),
    					Value: pulumi.String("VPC-1-Servers"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const newPrefixList = new aws_native.ec2.PrefixList("newPrefixList", {
        prefixListName: "vpc-1-servers",
        addressFamily: aws_native.ec2.PrefixListAddressFamily.IPv4,
        maxEntries: 10,
        entries: [
            {
                cidr: "10.0.0.5/32",
                description: "Server 1",
            },
            {
                cidr: "10.0.0.10/32",
                description: "Server 2",
            },
        ],
        tags: [{
            key: "Name",
            value: "VPC-1-Servers",
        }],
    });
    
    import pulumi
    import pulumi_aws_native as aws_native
    
    new_prefix_list = aws_native.ec2.PrefixList("newPrefixList",
        prefix_list_name="vpc-1-servers",
        address_family=aws_native.ec2.PrefixListAddressFamily.I_PV4,
        max_entries=10,
        entries=[
            {
                "cidr": "10.0.0.5/32",
                "description": "Server 1",
            },
            {
                "cidr": "10.0.0.10/32",
                "description": "Server 2",
            },
        ],
        tags=[{
            "key": "Name",
            "value": "VPC-1-Servers",
        }])
    

    Example coming soon!

    Create PrefixList Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PrefixList(name: string, args: PrefixListArgs, opts?: CustomResourceOptions);
    @overload
    def PrefixList(resource_name: str,
                   args: PrefixListArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def PrefixList(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   address_family: Optional[PrefixListAddressFamily] = None,
                   entries: Optional[Sequence[PrefixListEntryArgs]] = None,
                   max_entries: Optional[int] = None,
                   prefix_list_name: Optional[str] = None,
                   tags: Optional[Sequence[_root_inputs.TagArgs]] = None)
    func NewPrefixList(ctx *Context, name string, args PrefixListArgs, opts ...ResourceOption) (*PrefixList, error)
    public PrefixList(string name, PrefixListArgs args, CustomResourceOptions? opts = null)
    public PrefixList(String name, PrefixListArgs args)
    public PrefixList(String name, PrefixListArgs args, CustomResourceOptions options)
    
    type: aws-native:ec2:PrefixList
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "aws-native_ec2_prefix_list" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args PrefixListArgs
    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 PrefixListArgs
    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 PrefixListArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PrefixListArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PrefixListArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    PrefixList Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The PrefixList resource accepts the following input properties:

    AddressFamily Pulumi.AwsNative.Ec2.PrefixListAddressFamily
    Ip Version of Prefix List.
    Entries List<Pulumi.AwsNative.Ec2.Inputs.PrefixListEntry>
    Entries of Prefix List.
    MaxEntries int
    Max Entries of Prefix List.
    PrefixListName string
    Name of Prefix List.
    Tags List<Pulumi.AwsNative.Inputs.Tag>
    Tags for Prefix List
    AddressFamily PrefixListAddressFamily
    Ip Version of Prefix List.
    Entries []PrefixListEntryArgs
    Entries of Prefix List.
    MaxEntries int
    Max Entries of Prefix List.
    PrefixListName string
    Name of Prefix List.
    Tags TagArgs
    Tags for Prefix List
    address_family "IPv4" | "IPv6"
    Ip Version of Prefix List.
    entries list(object)
    Entries of Prefix List.
    max_entries number
    Max Entries of Prefix List.
    prefix_list_name string
    Name of Prefix List.
    tags list(object)
    Tags for Prefix List
    addressFamily PrefixListAddressFamily
    Ip Version of Prefix List.
    entries List<PrefixListEntry>
    Entries of Prefix List.
    maxEntries Integer
    Max Entries of Prefix List.
    prefixListName String
    Name of Prefix List.
    tags List<Tag>
    Tags for Prefix List
    addressFamily PrefixListAddressFamily
    Ip Version of Prefix List.
    entries PrefixListEntry[]
    Entries of Prefix List.
    maxEntries number
    Max Entries of Prefix List.
    prefixListName string
    Name of Prefix List.
    tags Tag[]
    Tags for Prefix List
    address_family PrefixListAddressFamily
    Ip Version of Prefix List.
    entries Sequence[PrefixListEntryArgs]
    Entries of Prefix List.
    max_entries int
    Max Entries of Prefix List.
    prefix_list_name str
    Name of Prefix List.
    tags Sequence[TagArgs]
    Tags for Prefix List
    addressFamily "IPv4" | "IPv6"
    Ip Version of Prefix List.
    entries List<Property Map>
    Entries of Prefix List.
    maxEntries Number
    Max Entries of Prefix List.
    prefixListName String
    Name of Prefix List.
    tags List<Property Map>
    Tags for Prefix List

    Outputs

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

    Arn string
    The Amazon Resource Name (ARN) of the Prefix List.
    Id string
    The provider-assigned unique ID for this managed resource.
    OwnerId string
    Owner Id of Prefix List.
    PrefixListId string
    Id of Prefix List.
    Version int
    Version of Prefix List.
    Arn string
    The Amazon Resource Name (ARN) of the Prefix List.
    Id string
    The provider-assigned unique ID for this managed resource.
    OwnerId string
    Owner Id of Prefix List.
    PrefixListId string
    Id of Prefix List.
    Version int
    Version of Prefix List.
    arn string
    The Amazon Resource Name (ARN) of the Prefix List.
    id string
    The provider-assigned unique ID for this managed resource.
    owner_id string
    Owner Id of Prefix List.
    prefix_list_id string
    Id of Prefix List.
    version number
    Version of Prefix List.
    arn String
    The Amazon Resource Name (ARN) of the Prefix List.
    id String
    The provider-assigned unique ID for this managed resource.
    ownerId String
    Owner Id of Prefix List.
    prefixListId String
    Id of Prefix List.
    version Integer
    Version of Prefix List.
    arn string
    The Amazon Resource Name (ARN) of the Prefix List.
    id string
    The provider-assigned unique ID for this managed resource.
    ownerId string
    Owner Id of Prefix List.
    prefixListId string
    Id of Prefix List.
    version number
    Version of Prefix List.
    arn str
    The Amazon Resource Name (ARN) of the Prefix List.
    id str
    The provider-assigned unique ID for this managed resource.
    owner_id str
    Owner Id of Prefix List.
    prefix_list_id str
    Id of Prefix List.
    version int
    Version of Prefix List.
    arn String
    The Amazon Resource Name (ARN) of the Prefix List.
    id String
    The provider-assigned unique ID for this managed resource.
    ownerId String
    Owner Id of Prefix List.
    prefixListId String
    Id of Prefix List.
    version Number
    Version of Prefix List.

    Look up Existing PrefixList Resource

    Get an existing PrefixList 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>, opts?: CustomResourceOptions): PrefixList
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None) -> PrefixList
    func GetPrefixList(ctx *Context, name string, id IDInput, state *PrefixListState, opts ...ResourceOption) (*PrefixList, error)
    public static PrefixList Get(string name, Input<string> id, CustomResourceOptions? opts = null)
    public static PrefixList get(String name, Output<String> id, CustomResourceOptions options)
    resources:  existingPrefixList:    type: aws-native:ec2:PrefixList    get:      id: ${id}
    import {
      to = aws-native_ec2_prefix_list.example
      id = "${id}"
    }
    
    name string
    The unique name of the resulting resource.
    id Input<ID>
    The unique provider ID of the resource to look up.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resulting resource.
    id str
    The unique provider ID of the resource to look up.
    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 resulting resource.
    id IDInput
    The unique provider ID of the resource to look up.
    state PrefixListState
    Pass nil. This resource has no state arguments.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resulting resource.
    id Input<string>
    The unique provider ID of the resource to look up.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resulting resource.
    id Output<String>
    The unique provider ID of the resource to look up.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Supporting Types

    PrefixListAddressFamily

    Ip Version of Prefix List.

    NameValue
    IPv4IPv4
    IPv6IPv6
    NameValue
    PrefixListAddressFamilyIPv4IPv4
    PrefixListAddressFamilyIPv6IPv6
    Value
    IPv4
    IPv6
    NameValue
    IPv4IPv4
    IPv6IPv6
    NameValue
    IPv4IPv4
    IPv6IPv6
    NameValue
    I_PV4IPv4
    I_PV6IPv6
    Value
    IPv4
    IPv6

    PrefixListEntry, PrefixListEntryArgs

    Cidr string
    The CIDR block.
    Description string

    A description for the entry.

    Constraints: Up to 255 characters in length.

    Cidr string
    The CIDR block.
    Description string

    A description for the entry.

    Constraints: Up to 255 characters in length.

    cidr string
    The CIDR block.
    description string

    A description for the entry.

    Constraints: Up to 255 characters in length.

    cidr String
    The CIDR block.
    description String

    A description for the entry.

    Constraints: Up to 255 characters in length.

    cidr string
    The CIDR block.
    description string

    A description for the entry.

    Constraints: Up to 255 characters in length.

    cidr str
    The CIDR block.
    description str

    A description for the entry.

    Constraints: Up to 255 characters in length.

    cidr String
    The CIDR block.
    description String

    A description for the entry.

    Constraints: Up to 255 characters in length.

    Tag, TagArgs

    A set of tags to apply to the resource.

    Key string
    The key name of the tag
    Value string
    The value of the tag
    Key string
    The key name of the tag
    Value string
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key str
    The key name of the tag
    value str
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo aws-native logo AWS Cloud Control

    We recommend new projects start with resources from the AWS provider.

    Viewing docs for AWS Cloud Control v1.86.0
    published on Wednesday, Nov 18, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial