published on Wednesday, Mar 11, 2026 by Pulumi
published on Wednesday, Mar 11, 2026 by Pulumi
Associates an EC2 managed prefix list with a Network Manager Cloud WAN core network. Once associated, the prefix list can be referenced in the core network policy document.
NOTE: The prefix list must be defined in the Cloud WAN home region (us-west-2). Although defined in the Cloud WAN home region, the prefix-list based policy will apply globally to all the relevant core network edges (regions) in your core network.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const prefixList = new aws.ec2.ManagedPrefixList("prefix_list", {
name: "example",
addressFamily: "IPv4",
maxEntries: 5,
entries: [{
cidr: "10.0.0.0/8",
description: "Example CIDR",
}],
});
const plAssociation = new aws.networkmanager.PrefixListAssociation("pl_association", {
coreNetworkId: coreNetwork.id,
prefixListArn: prefixList.arn,
prefixListAlias: "exampleprefixlist",
});
import pulumi
import pulumi_aws as aws
prefix_list = aws.ec2.ManagedPrefixList("prefix_list",
name="example",
address_family="IPv4",
max_entries=5,
entries=[{
"cidr": "10.0.0.0/8",
"description": "Example CIDR",
}])
pl_association = aws.networkmanager.PrefixListAssociation("pl_association",
core_network_id=core_network["id"],
prefix_list_arn=prefix_list.arn,
prefix_list_alias="exampleprefixlist")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/networkmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
prefixList, err := ec2.NewManagedPrefixList(ctx, "prefix_list", &ec2.ManagedPrefixListArgs{
Name: pulumi.String("example"),
AddressFamily: pulumi.String("IPv4"),
MaxEntries: pulumi.Int(5),
Entries: ec2.ManagedPrefixListEntryTypeArray{
&ec2.ManagedPrefixListEntryTypeArgs{
Cidr: pulumi.String("10.0.0.0/8"),
Description: pulumi.String("Example CIDR"),
},
},
})
if err != nil {
return err
}
_, err = networkmanager.NewPrefixListAssociation(ctx, "pl_association", &networkmanager.PrefixListAssociationArgs{
CoreNetworkId: pulumi.Any(coreNetwork.Id),
PrefixListArn: prefixList.Arn,
PrefixListAlias: pulumi.String("exampleprefixlist"),
})
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 prefixList = new Aws.Ec2.ManagedPrefixList("prefix_list", new()
{
Name = "example",
AddressFamily = "IPv4",
MaxEntries = 5,
Entries = new[]
{
new Aws.Ec2.Inputs.ManagedPrefixListEntryArgs
{
Cidr = "10.0.0.0/8",
Description = "Example CIDR",
},
},
});
var plAssociation = new Aws.NetworkManager.PrefixListAssociation("pl_association", new()
{
CoreNetworkId = coreNetwork.Id,
PrefixListArn = prefixList.Arn,
PrefixListAlias = "exampleprefixlist",
});
});
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 com.pulumi.aws.networkmanager.PrefixListAssociation;
import com.pulumi.aws.networkmanager.PrefixListAssociationArgs;
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 prefixList = new ManagedPrefixList("prefixList", ManagedPrefixListArgs.builder()
.name("example")
.addressFamily("IPv4")
.maxEntries(5)
.entries(ManagedPrefixListEntryArgs.builder()
.cidr("10.0.0.0/8")
.description("Example CIDR")
.build())
.build());
var plAssociation = new PrefixListAssociation("plAssociation", PrefixListAssociationArgs.builder()
.coreNetworkId(coreNetwork.id())
.prefixListArn(prefixList.arn())
.prefixListAlias("exampleprefixlist")
.build());
}
}
resources:
prefixList:
type: aws:ec2:ManagedPrefixList
name: prefix_list
properties:
name: example
addressFamily: IPv4
maxEntries: 5
entries:
- cidr: 10.0.0.0/8
description: Example CIDR
plAssociation:
type: aws:networkmanager:PrefixListAssociation
name: pl_association
properties:
coreNetworkId: ${coreNetwork.id}
prefixListArn: ${prefixList.arn}
prefixListAlias: exampleprefixlist
Create PrefixListAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PrefixListAssociation(name: string, args: PrefixListAssociationArgs, opts?: CustomResourceOptions);@overload
def PrefixListAssociation(resource_name: str,
args: PrefixListAssociationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PrefixListAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
core_network_id: Optional[str] = None,
prefix_list_alias: Optional[str] = None,
prefix_list_arn: Optional[str] = None)func NewPrefixListAssociation(ctx *Context, name string, args PrefixListAssociationArgs, opts ...ResourceOption) (*PrefixListAssociation, error)public PrefixListAssociation(string name, PrefixListAssociationArgs args, CustomResourceOptions? opts = null)
public PrefixListAssociation(String name, PrefixListAssociationArgs args)
public PrefixListAssociation(String name, PrefixListAssociationArgs args, CustomResourceOptions options)
type: aws:networkmanager:PrefixListAssociation
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 PrefixListAssociationArgs
- 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 PrefixListAssociationArgs
- 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 PrefixListAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PrefixListAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PrefixListAssociationArgs
- 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 prefixListAssociationResource = new Aws.NetworkManager.PrefixListAssociation("prefixListAssociationResource", new()
{
CoreNetworkId = "string",
PrefixListAlias = "string",
PrefixListArn = "string",
});
example, err := networkmanager.NewPrefixListAssociation(ctx, "prefixListAssociationResource", &networkmanager.PrefixListAssociationArgs{
CoreNetworkId: pulumi.String("string"),
PrefixListAlias: pulumi.String("string"),
PrefixListArn: pulumi.String("string"),
})
var prefixListAssociationResource = new PrefixListAssociation("prefixListAssociationResource", PrefixListAssociationArgs.builder()
.coreNetworkId("string")
.prefixListAlias("string")
.prefixListArn("string")
.build());
prefix_list_association_resource = aws.networkmanager.PrefixListAssociation("prefixListAssociationResource",
core_network_id="string",
prefix_list_alias="string",
prefix_list_arn="string")
const prefixListAssociationResource = new aws.networkmanager.PrefixListAssociation("prefixListAssociationResource", {
coreNetworkId: "string",
prefixListAlias: "string",
prefixListArn: "string",
});
type: aws:networkmanager:PrefixListAssociation
properties:
coreNetworkId: string
prefixListAlias: string
prefixListArn: string
PrefixListAssociation 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 PrefixListAssociation resource accepts the following input properties:
- Core
Network stringId - The ID of the core network to associate the prefix list with.
- Prefix
List stringAlias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- Prefix
List stringArn - The ARN of the EC2 managed prefix list to associate with the core network.
- Core
Network stringId - The ID of the core network to associate the prefix list with.
- Prefix
List stringAlias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- Prefix
List stringArn - The ARN of the EC2 managed prefix list to associate with the core network.
- core
Network StringId - The ID of the core network to associate the prefix list with.
- prefix
List StringAlias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- prefix
List StringArn - The ARN of the EC2 managed prefix list to associate with the core network.
- core
Network stringId - The ID of the core network to associate the prefix list with.
- prefix
List stringAlias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- prefix
List stringArn - The ARN of the EC2 managed prefix list to associate with the core network.
- core_
network_ strid - The ID of the core network to associate the prefix list with.
- prefix_
list_ stralias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- prefix_
list_ strarn - The ARN of the EC2 managed prefix list to associate with the core network.
- core
Network StringId - The ID of the core network to associate the prefix list with.
- prefix
List StringAlias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- prefix
List StringArn - The ARN of the EC2 managed prefix list to associate with the core network.
Outputs
All input properties are implicitly available as output properties. Additionally, the PrefixListAssociation 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 PrefixListAssociation Resource
Get an existing PrefixListAssociation 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?: PrefixListAssociationState, opts?: CustomResourceOptions): PrefixListAssociation@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
core_network_id: Optional[str] = None,
prefix_list_alias: Optional[str] = None,
prefix_list_arn: Optional[str] = None) -> PrefixListAssociationfunc GetPrefixListAssociation(ctx *Context, name string, id IDInput, state *PrefixListAssociationState, opts ...ResourceOption) (*PrefixListAssociation, error)public static PrefixListAssociation Get(string name, Input<string> id, PrefixListAssociationState? state, CustomResourceOptions? opts = null)public static PrefixListAssociation get(String name, Output<String> id, PrefixListAssociationState state, CustomResourceOptions options)resources: _: type: aws:networkmanager:PrefixListAssociation get: id: ${id}- 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.
- Core
Network stringId - The ID of the core network to associate the prefix list with.
- Prefix
List stringAlias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- Prefix
List stringArn - The ARN of the EC2 managed prefix list to associate with the core network.
- Core
Network stringId - The ID of the core network to associate the prefix list with.
- Prefix
List stringAlias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- Prefix
List stringArn - The ARN of the EC2 managed prefix list to associate with the core network.
- core
Network StringId - The ID of the core network to associate the prefix list with.
- prefix
List StringAlias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- prefix
List StringArn - The ARN of the EC2 managed prefix list to associate with the core network.
- core
Network stringId - The ID of the core network to associate the prefix list with.
- prefix
List stringAlias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- prefix
List stringArn - The ARN of the EC2 managed prefix list to associate with the core network.
- core_
network_ strid - The ID of the core network to associate the prefix list with.
- prefix_
list_ stralias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- prefix_
list_ strarn - The ARN of the EC2 managed prefix list to associate with the core network.
- core
Network StringId - The ID of the core network to associate the prefix list with.
- prefix
List StringAlias - An alias for the prefix list association. This alias can be used to reference the prefix list in the core network policy document. Must start with a letter, be less than 64 characters long, and may only include letters and numbers.
- prefix
List StringArn - The ARN of the EC2 managed prefix list to associate with the core network.
Import
Identity Schema
Required
core_network_id(String) Core network ID.prefix_list_arn(String) Prefix list ARN.
Optional
account_id(String) AWS Account where this resource is managed.
Using pulumi import, import aws.networkmanager.PrefixListAssociation using the core network ID and prefix list ARN separated by a comma (,). For example:
$ pulumi import aws:networkmanager/prefixListAssociation:PrefixListAssociation example core-network-0fab1c1e1e1e1e1e1,arn:aws:ec2:us-west-2:123456789012:prefix-list/pl-0123456789abcdef0
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
awsTerraform Provider.
published on Wednesday, Mar 11, 2026 by Pulumi
