aws.ec2.ManagedPrefixList
Explore with Pulumi AI
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
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
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,
entries: [
{
cidr: exampleAwsVpc.cidrBlock,
description: "Primary",
},
{
cidr: exampleAwsVpcIpv4CidrBlockAssociation.cidrBlock,
description: "Secondary",
},
],
tags: {
Env: "live",
},
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.ManagedPrefixList("example",
name="All VPC CIDR-s",
address_family="IPv4",
max_entries=5,
entries=[
{
"cidr": example_aws_vpc["cidrBlock"],
"description": "Primary",
},
{
"cidr": example_aws_vpc_ipv4_cidr_block_association["cidrBlock"],
"description": "Secondary",
},
],
tags={
"Env": "live",
})
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 {
_, err := ec2.NewManagedPrefixList(ctx, "example", &ec2.ManagedPrefixListArgs{
Name: pulumi.String("All VPC CIDR-s"),
AddressFamily: pulumi.String("IPv4"),
MaxEntries: pulumi.Int(5),
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"),
},
},
Tags: pulumi.StringMap{
"Env": pulumi.String("live"),
},
})
if err != nil {
return err
}
return nil
})
}
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,
Entries = new[]
{
new Aws.Ec2.Inputs.ManagedPrefixListEntryArgs
{
Cidr = exampleAwsVpc.CidrBlock,
Description = "Primary",
},
new Aws.Ec2.Inputs.ManagedPrefixListEntryArgs
{
Cidr = exampleAwsVpcIpv4CidrBlockAssociation.CidrBlock,
Description = "Secondary",
},
},
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.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()
.name("All VPC CIDR-s")
.addressFamily("IPv4")
.maxEntries(5)
.entries(
ManagedPrefixListEntryArgs.builder()
.cidr(exampleAwsVpc.cidrBlock())
.description("Primary")
.build(),
ManagedPrefixListEntryArgs.builder()
.cidr(exampleAwsVpcIpv4CidrBlockAssociation.cidrBlock())
.description("Secondary")
.build())
.tags(Map.of("Env", "live"))
.build());
}
}
resources:
example:
type: aws:ec2:ManagedPrefixList
properties:
name: All VPC CIDR-s
addressFamily: IPv4
maxEntries: 5
entries:
- cidr: ${exampleAwsVpc.cidrBlock}
description: Primary
- cidr: ${exampleAwsVpcIpv4CidrBlockAssociation.cidrBlock}
description: Secondary
tags:
Env: live
Create ManagedPrefixList Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ManagedPrefixList(name: string, args: ManagedPrefixListArgs, opts?: CustomResourceOptions);
@overload
def ManagedPrefixList(resource_name: str,
args: ManagedPrefixListArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ManagedPrefixList(resource_name: str,
opts: Optional[ResourceOptions] = None,
address_family: Optional[str] = None,
max_entries: Optional[int] = None,
entries: Optional[Sequence[ManagedPrefixListEntryArgs]] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewManagedPrefixList(ctx *Context, name string, args ManagedPrefixListArgs, opts ...ResourceOption) (*ManagedPrefixList, error)
public ManagedPrefixList(string name, ManagedPrefixListArgs args, CustomResourceOptions? opts = null)
public ManagedPrefixList(String name, ManagedPrefixListArgs args)
public ManagedPrefixList(String name, ManagedPrefixListArgs args, CustomResourceOptions options)
type: aws:ec2:ManagedPrefixList
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
- name String
- The unique name of the resource.
- args ManagedPrefixListArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var managedPrefixListResource = new Aws.Ec2.ManagedPrefixList("managedPrefixListResource", new()
{
AddressFamily = "string",
MaxEntries = 0,
Entries = new[]
{
new Aws.Ec2.Inputs.ManagedPrefixListEntryArgs
{
Cidr = "string",
Description = "string",
},
},
Name = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := ec2.NewManagedPrefixList(ctx, "managedPrefixListResource", &ec2.ManagedPrefixListArgs{
AddressFamily: pulumi.String("string"),
MaxEntries: pulumi.Int(0),
Entries: ec2.ManagedPrefixListEntryTypeArray{
&ec2.ManagedPrefixListEntryTypeArgs{
Cidr: pulumi.String("string"),
Description: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var managedPrefixListResource = new ManagedPrefixList("managedPrefixListResource", ManagedPrefixListArgs.builder()
.addressFamily("string")
.maxEntries(0)
.entries(ManagedPrefixListEntryArgs.builder()
.cidr("string")
.description("string")
.build())
.name("string")
.tags(Map.of("string", "string"))
.build());
managed_prefix_list_resource = aws.ec2.ManagedPrefixList("managedPrefixListResource",
address_family="string",
max_entries=0,
entries=[{
"cidr": "string",
"description": "string",
}],
name="string",
tags={
"string": "string",
})
const managedPrefixListResource = new aws.ec2.ManagedPrefixList("managedPrefixListResource", {
addressFamily: "string",
maxEntries: 0,
entries: [{
cidr: "string",
description: "string",
}],
name: "string",
tags: {
string: "string",
},
});
type: aws:ec2:ManagedPrefixList
properties:
addressFamily: string
entries:
- cidr: string
description: string
maxEntries: 0
name: string
tags:
string: string
ManagedPrefixList 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 ManagedPrefixList resource accepts the following input properties:
- Address
Family string - Address family (
IPv4
orIPv6
) of this prefix list. - Max
Entries int - Maximum number of entries that this prefix list can contain.
- Entries
List<Managed
Prefix List Entry> - 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
. - Dictionary<string, string>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Address
Family string - Address family (
IPv4
orIPv6
) of this prefix list. - Max
Entries int - Maximum number of entries that this prefix list can contain.
- Entries
[]Managed
Prefix List Entry Type Args - 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
. - map[string]string
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- address
Family String - Address family (
IPv4
orIPv6
) of this prefix list. - max
Entries Integer - Maximum number of entries that this prefix list can contain.
- entries
List<Managed
Prefix List Entry> - 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
. - Map<String,String>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- address
Family string - Address family (
IPv4
orIPv6
) of this prefix list. - max
Entries number - Maximum number of entries that this prefix list can contain.
- entries
Managed
Prefix List Entry[] - 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
. - {[key: string]: string}
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- address_
family str - Address family (
IPv4
orIPv6
) of this prefix list. - max_
entries int - Maximum number of entries that this prefix list can contain.
- entries
Sequence[Managed
Prefix List Entry Args] - 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
. - Mapping[str, str]
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- address
Family String - Address family (
IPv4
orIPv6
) of this prefix list. - max
Entries Number - Maximum number of entries that this prefix list can contain.
- entries List<Property Map>
- 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
. - Map<String>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
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.
- Owner
Id string - ID of the AWS account that owns this prefix list.
- Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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.
- Owner
Id string - ID of the AWS account that owns this prefix list.
- map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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.
- owner
Id String - ID of the AWS account that owns this prefix list.
- Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - version Integer
- Latest version of this prefix list.
- arn string
- ARN of the prefix list.
- id string
- The provider-assigned unique ID for this managed resource.
- owner
Id string - ID of the AWS account that owns this prefix list.
- {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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.
- Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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.
- owner
Id String - ID of the AWS account that owns this prefix list.
- Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - version Number
- Latest version of this prefix list.
Look up 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)
public static ManagedPrefixList get(String name, Output<String> id, ManagedPrefixListState 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.
- Address
Family string - Address family (
IPv4
orIPv6
) of this prefix list. - Arn string
- ARN of the prefix list.
- Entries
List<Managed
Prefix List Entry> - 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 string
- Name of this resource. The name must not start with
com.amazonaws
. - Owner
Id string - ID of the AWS account that owns this prefix list.
- Dictionary<string, string>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Version int
- Latest version of this prefix list.
- Address
Family string - Address family (
IPv4
orIPv6
) of this prefix list. - Arn string
- ARN of the prefix list.
- Entries
[]Managed
Prefix List Entry Type Args - 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 string
- Name of this resource. The name must not start with
com.amazonaws
. - Owner
Id string - ID of the AWS account that owns this prefix list.
- map[string]string
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Version int
- Latest version of this prefix list.
- address
Family String - Address family (
IPv4
orIPv6
) of this prefix list. - arn String
- ARN of the prefix list.
- entries
List<Managed
Prefix List Entry> - 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 Integer - Maximum number of entries that this prefix list can contain.
- name String
- Name of this resource. The name must not start with
com.amazonaws
. - owner
Id String - ID of the AWS account that owns this prefix list.
- Map<String,String>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - version Integer
- Latest version of this prefix list.
- address
Family string - Address family (
IPv4
orIPv6
) of this prefix list. - arn string
- ARN of the prefix list.
- entries
Managed
Prefix List Entry[] - 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 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
. - owner
Id string - ID of the AWS account that owns this prefix list.
- {[key: string]: string}
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - version number
- Latest version of this prefix list.
- address_
family str - Address family (
IPv4
orIPv6
) of this prefix list. - arn str
- ARN of the prefix list.
- entries
Sequence[Managed
Prefix List Entry Args] - 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.
- Mapping[str, str]
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - version int
- Latest version of this prefix list.
- address
Family String - Address family (
IPv4
orIPv6
) of this prefix list. - arn String
- ARN of the prefix list.
- entries List<Property Map>
- 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 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
. - owner
Id String - ID of the AWS account that owns this prefix list.
- Map<String>
- Map of tags to assign to this resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - version Number
- Latest version of this prefix list.
Supporting Types
ManagedPrefixListEntry, ManagedPrefixListEntryArgs
- 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 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.
- 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.
Import
Using pulumi import
, import Prefix Lists using the id
. For example:
$ pulumi import aws:ec2/managedPrefixList:ManagedPrefixList default pl-0570a1d2d725c16be
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.