1. Packages
  2. Volcengine
  3. API Docs
  4. vpc
  5. PrefixList
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.vpc.PrefixList

Explore with Pulumi AI

Provides a resource to manage vpc prefix list

Example Usage

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

const foo = new volcengine.vpc.PrefixList("foo", {
    description: "acc test description",
    ipVersion: "IPv4",
    maxEntries: 7,
    prefixListEntries: [
        {
            cidr: "192.168.4.0/28",
            description: "acc-test-1",
        },
        {
            cidr: "192.168.9.0/28",
            description: "acc-test-4",
        },
        {
            cidr: "192.168.8.0/28",
            description: "acc-test-5",
        },
    ],
    prefixListName: "acc-test-prefix",
    tags: [{
        key: "tf-key1",
        value: "tf-value1",
    }],
});
Copy
import pulumi
import pulumi_volcengine as volcengine

foo = volcengine.vpc.PrefixList("foo",
    description="acc test description",
    ip_version="IPv4",
    max_entries=7,
    prefix_list_entries=[
        volcengine.vpc.PrefixListPrefixListEntryArgs(
            cidr="192.168.4.0/28",
            description="acc-test-1",
        ),
        volcengine.vpc.PrefixListPrefixListEntryArgs(
            cidr="192.168.9.0/28",
            description="acc-test-4",
        ),
        volcengine.vpc.PrefixListPrefixListEntryArgs(
            cidr="192.168.8.0/28",
            description="acc-test-5",
        ),
    ],
    prefix_list_name="acc-test-prefix",
    tags=[volcengine.vpc.PrefixListTagArgs(
        key="tf-key1",
        value="tf-value1",
    )])
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vpc.NewPrefixList(ctx, "foo", &vpc.PrefixListArgs{
			Description: pulumi.String("acc test description"),
			IpVersion:   pulumi.String("IPv4"),
			MaxEntries:  pulumi.Int(7),
			PrefixListEntries: vpc.PrefixListPrefixListEntryArray{
				&vpc.PrefixListPrefixListEntryArgs{
					Cidr:        pulumi.String("192.168.4.0/28"),
					Description: pulumi.String("acc-test-1"),
				},
				&vpc.PrefixListPrefixListEntryArgs{
					Cidr:        pulumi.String("192.168.9.0/28"),
					Description: pulumi.String("acc-test-4"),
				},
				&vpc.PrefixListPrefixListEntryArgs{
					Cidr:        pulumi.String("192.168.8.0/28"),
					Description: pulumi.String("acc-test-5"),
				},
			},
			PrefixListName: pulumi.String("acc-test-prefix"),
			Tags: vpc.PrefixListTagArray{
				&vpc.PrefixListTagArgs{
					Key:   pulumi.String("tf-key1"),
					Value: pulumi.String("tf-value1"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var foo = new Volcengine.Vpc.PrefixList("foo", new()
    {
        Description = "acc test description",
        IpVersion = "IPv4",
        MaxEntries = 7,
        PrefixListEntries = new[]
        {
            new Volcengine.Vpc.Inputs.PrefixListPrefixListEntryArgs
            {
                Cidr = "192.168.4.0/28",
                Description = "acc-test-1",
            },
            new Volcengine.Vpc.Inputs.PrefixListPrefixListEntryArgs
            {
                Cidr = "192.168.9.0/28",
                Description = "acc-test-4",
            },
            new Volcengine.Vpc.Inputs.PrefixListPrefixListEntryArgs
            {
                Cidr = "192.168.8.0/28",
                Description = "acc-test-5",
            },
        },
        PrefixListName = "acc-test-prefix",
        Tags = new[]
        {
            new Volcengine.Vpc.Inputs.PrefixListTagArgs
            {
                Key = "tf-key1",
                Value = "tf-value1",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.vpc.PrefixList;
import com.pulumi.volcengine.vpc.PrefixListArgs;
import com.pulumi.volcengine.vpc.inputs.PrefixListPrefixListEntryArgs;
import com.pulumi.volcengine.vpc.inputs.PrefixListTagArgs;
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 foo = new PrefixList("foo", PrefixListArgs.builder()        
            .description("acc test description")
            .ipVersion("IPv4")
            .maxEntries(7)
            .prefixListEntries(            
                PrefixListPrefixListEntryArgs.builder()
                    .cidr("192.168.4.0/28")
                    .description("acc-test-1")
                    .build(),
                PrefixListPrefixListEntryArgs.builder()
                    .cidr("192.168.9.0/28")
                    .description("acc-test-4")
                    .build(),
                PrefixListPrefixListEntryArgs.builder()
                    .cidr("192.168.8.0/28")
                    .description("acc-test-5")
                    .build())
            .prefixListName("acc-test-prefix")
            .tags(PrefixListTagArgs.builder()
                .key("tf-key1")
                .value("tf-value1")
                .build())
            .build());

    }
}
Copy
resources:
  foo:
    type: volcengine:vpc:PrefixList
    properties:
      description: acc test description
      ipVersion: IPv4
      maxEntries: 7
      prefixListEntries:
        - cidr: 192.168.4.0/28
          description: acc-test-1
        - cidr: 192.168.9.0/28
          description: acc-test-4
        - cidr: 192.168.8.0/28
          description: acc-test-5
      prefixListName: acc-test-prefix
      tags:
        - key: tf-key1
          value: tf-value1
Copy

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,
               max_entries: Optional[int] = None,
               description: Optional[str] = None,
               ip_version: Optional[str] = None,
               prefix_list_entries: Optional[Sequence[PrefixListPrefixListEntryArgs]] = None,
               prefix_list_name: Optional[str] = None,
               tags: Optional[Sequence[PrefixListTagArgs]] = 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: volcengine:vpc:PrefixList
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. PrefixListArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. PrefixListArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. PrefixListArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. PrefixListArgs
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 prefixListResource = new Volcengine.Vpc.PrefixList("prefixListResource", new()
{
    MaxEntries = 0,
    Description = "string",
    IpVersion = "string",
    PrefixListEntries = new[]
    {
        new Volcengine.Vpc.Inputs.PrefixListPrefixListEntryArgs
        {
            Cidr = "string",
            Description = "string",
        },
    },
    PrefixListName = "string",
    Tags = new[]
    {
        new Volcengine.Vpc.Inputs.PrefixListTagArgs
        {
            Key = "string",
            Value = "string",
        },
    },
});
Copy
example, err := vpc.NewPrefixList(ctx, "prefixListResource", &vpc.PrefixListArgs{
	MaxEntries:  pulumi.Int(0),
	Description: pulumi.String("string"),
	IpVersion:   pulumi.String("string"),
	PrefixListEntries: vpc.PrefixListPrefixListEntryArray{
		&vpc.PrefixListPrefixListEntryArgs{
			Cidr:        pulumi.String("string"),
			Description: pulumi.String("string"),
		},
	},
	PrefixListName: pulumi.String("string"),
	Tags: vpc.PrefixListTagArray{
		&vpc.PrefixListTagArgs{
			Key:   pulumi.String("string"),
			Value: pulumi.String("string"),
		},
	},
})
Copy
var prefixListResource = new PrefixList("prefixListResource", PrefixListArgs.builder()
    .maxEntries(0)
    .description("string")
    .ipVersion("string")
    .prefixListEntries(PrefixListPrefixListEntryArgs.builder()
        .cidr("string")
        .description("string")
        .build())
    .prefixListName("string")
    .tags(PrefixListTagArgs.builder()
        .key("string")
        .value("string")
        .build())
    .build());
Copy
prefix_list_resource = volcengine.vpc.PrefixList("prefixListResource",
    max_entries=0,
    description="string",
    ip_version="string",
    prefix_list_entries=[{
        "cidr": "string",
        "description": "string",
    }],
    prefix_list_name="string",
    tags=[{
        "key": "string",
        "value": "string",
    }])
Copy
const prefixListResource = new volcengine.vpc.PrefixList("prefixListResource", {
    maxEntries: 0,
    description: "string",
    ipVersion: "string",
    prefixListEntries: [{
        cidr: "string",
        description: "string",
    }],
    prefixListName: "string",
    tags: [{
        key: "string",
        value: "string",
    }],
});
Copy
type: volcengine:vpc:PrefixList
properties:
    description: string
    ipVersion: string
    maxEntries: 0
    prefixListEntries:
        - cidr: string
          description: string
    prefixListName: string
    tags:
        - key: string
          value: string
Copy

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:

MaxEntries This property is required. int
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
Description string
The description of the prefix list.
IpVersion Changes to this property will trigger replacement. string
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
PrefixListEntries List<PrefixListPrefixListEntry>
Prefix list entry list.
PrefixListName string
The name of the prefix list.
Tags Changes to this property will trigger replacement. List<PrefixListTag>
Tags.
MaxEntries This property is required. int
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
Description string
The description of the prefix list.
IpVersion Changes to this property will trigger replacement. string
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
PrefixListEntries []PrefixListPrefixListEntryArgs
Prefix list entry list.
PrefixListName string
The name of the prefix list.
Tags Changes to this property will trigger replacement. []PrefixListTagArgs
Tags.
maxEntries This property is required. Integer
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
description String
The description of the prefix list.
ipVersion Changes to this property will trigger replacement. String
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
prefixListEntries List<PrefixListPrefixListEntry>
Prefix list entry list.
prefixListName String
The name of the prefix list.
tags Changes to this property will trigger replacement. List<PrefixListTag>
Tags.
maxEntries This property is required. number
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
description string
The description of the prefix list.
ipVersion Changes to this property will trigger replacement. string
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
prefixListEntries PrefixListPrefixListEntry[]
Prefix list entry list.
prefixListName string
The name of the prefix list.
tags Changes to this property will trigger replacement. PrefixListTag[]
Tags.
max_entries This property is required. int
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
description str
The description of the prefix list.
ip_version Changes to this property will trigger replacement. str
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
prefix_list_entries Sequence[PrefixListPrefixListEntryArgs]
Prefix list entry list.
prefix_list_name str
The name of the prefix list.
tags Changes to this property will trigger replacement. Sequence[PrefixListTagArgs]
Tags.
maxEntries This property is required. Number
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
description String
The description of the prefix list.
ipVersion Changes to this property will trigger replacement. String
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
prefixListEntries List<Property Map>
Prefix list entry list.
prefixListName String
The name of the prefix list.
tags Changes to this property will trigger replacement. List<Property Map>
Tags.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
PrefixListAssociations List<PrefixListPrefixListAssociation>
Collection of resources associated with VPC prefix list.
Id string
The provider-assigned unique ID for this managed resource.
PrefixListAssociations []PrefixListPrefixListAssociation
Collection of resources associated with VPC prefix list.
id String
The provider-assigned unique ID for this managed resource.
prefixListAssociations List<PrefixListPrefixListAssociation>
Collection of resources associated with VPC prefix list.
id string
The provider-assigned unique ID for this managed resource.
prefixListAssociations PrefixListPrefixListAssociation[]
Collection of resources associated with VPC prefix list.
id str
The provider-assigned unique ID for this managed resource.
prefix_list_associations Sequence[PrefixListPrefixListAssociation]
Collection of resources associated with VPC prefix list.
id String
The provider-assigned unique ID for this managed resource.
prefixListAssociations List<Property Map>
Collection of resources associated with VPC 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>, state?: PrefixListState, opts?: CustomResourceOptions): PrefixList
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        ip_version: Optional[str] = None,
        max_entries: Optional[int] = None,
        prefix_list_associations: Optional[Sequence[PrefixListPrefixListAssociationArgs]] = None,
        prefix_list_entries: Optional[Sequence[PrefixListPrefixListEntryArgs]] = None,
        prefix_list_name: Optional[str] = None,
        tags: Optional[Sequence[PrefixListTagArgs]] = 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, PrefixListState? state, CustomResourceOptions? opts = null)
public static PrefixList get(String name, Output<String> id, PrefixListState state, CustomResourceOptions options)
resources:  _:    type: volcengine:vpc:PrefixList    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Description string
The description of the prefix list.
IpVersion Changes to this property will trigger replacement. string
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
MaxEntries int
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
PrefixListAssociations List<PrefixListPrefixListAssociation>
Collection of resources associated with VPC prefix list.
PrefixListEntries List<PrefixListPrefixListEntry>
Prefix list entry list.
PrefixListName string
The name of the prefix list.
Tags Changes to this property will trigger replacement. List<PrefixListTag>
Tags.
Description string
The description of the prefix list.
IpVersion Changes to this property will trigger replacement. string
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
MaxEntries int
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
PrefixListAssociations []PrefixListPrefixListAssociationArgs
Collection of resources associated with VPC prefix list.
PrefixListEntries []PrefixListPrefixListEntryArgs
Prefix list entry list.
PrefixListName string
The name of the prefix list.
Tags Changes to this property will trigger replacement. []PrefixListTagArgs
Tags.
description String
The description of the prefix list.
ipVersion Changes to this property will trigger replacement. String
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
maxEntries Integer
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
prefixListAssociations List<PrefixListPrefixListAssociation>
Collection of resources associated with VPC prefix list.
prefixListEntries List<PrefixListPrefixListEntry>
Prefix list entry list.
prefixListName String
The name of the prefix list.
tags Changes to this property will trigger replacement. List<PrefixListTag>
Tags.
description string
The description of the prefix list.
ipVersion Changes to this property will trigger replacement. string
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
maxEntries number
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
prefixListAssociations PrefixListPrefixListAssociation[]
Collection of resources associated with VPC prefix list.
prefixListEntries PrefixListPrefixListEntry[]
Prefix list entry list.
prefixListName string
The name of the prefix list.
tags Changes to this property will trigger replacement. PrefixListTag[]
Tags.
description str
The description of the prefix list.
ip_version Changes to this property will trigger replacement. str
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
max_entries int
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
prefix_list_associations Sequence[PrefixListPrefixListAssociationArgs]
Collection of resources associated with VPC prefix list.
prefix_list_entries Sequence[PrefixListPrefixListEntryArgs]
Prefix list entry list.
prefix_list_name str
The name of the prefix list.
tags Changes to this property will trigger replacement. Sequence[PrefixListTagArgs]
Tags.
description String
The description of the prefix list.
ipVersion Changes to this property will trigger replacement. String
IP version type. Possible values: IPv4 (default): IPv4 type. IPv6: IPv6 type.
maxEntries Number
Maximum number of entries, which is the maximum number of entries that can be added to the prefix list. The value range is 1 to 200.
prefixListAssociations List<Property Map>
Collection of resources associated with VPC prefix list.
prefixListEntries List<Property Map>
Prefix list entry list.
prefixListName String
The name of the prefix list.
tags Changes to this property will trigger replacement. List<Property Map>
Tags.

Supporting Types

PrefixListPrefixListAssociation
, PrefixListPrefixListAssociationArgs

ResourceId string
Associated resource ID.
ResourceType string
Related resource types.
ResourceId string
Associated resource ID.
ResourceType string
Related resource types.
resourceId String
Associated resource ID.
resourceType String
Related resource types.
resourceId string
Associated resource ID.
resourceType string
Related resource types.
resource_id str
Associated resource ID.
resource_type str
Related resource types.
resourceId String
Associated resource ID.
resourceType String
Related resource types.

PrefixListPrefixListEntry
, PrefixListPrefixListEntryArgs

Cidr string
CIDR of prefix list entries.
Description string
Description of prefix list entries.
Cidr string
CIDR of prefix list entries.
Description string
Description of prefix list entries.
cidr String
CIDR of prefix list entries.
description String
Description of prefix list entries.
cidr string
CIDR of prefix list entries.
description string
Description of prefix list entries.
cidr str
CIDR of prefix list entries.
description str
Description of prefix list entries.
cidr String
CIDR of prefix list entries.
description String
Description of prefix list entries.

PrefixListTag
, PrefixListTagArgs

Key
This property is required.
Changes to this property will trigger replacement.
string
The Key of Tags.
Value
This property is required.
Changes to this property will trigger replacement.
string
The Value of Tags.
Key
This property is required.
Changes to this property will trigger replacement.
string
The Key of Tags.
Value
This property is required.
Changes to this property will trigger replacement.
string
The Value of Tags.
key
This property is required.
Changes to this property will trigger replacement.
String
The Key of Tags.
value
This property is required.
Changes to this property will trigger replacement.
String
The Value of Tags.
key
This property is required.
Changes to this property will trigger replacement.
string
The Key of Tags.
value
This property is required.
Changes to this property will trigger replacement.
string
The Value of Tags.
key
This property is required.
Changes to this property will trigger replacement.
str
The Key of Tags.
value
This property is required.
Changes to this property will trigger replacement.
str
The Value of Tags.
key
This property is required.
Changes to this property will trigger replacement.
String
The Key of Tags.
value
This property is required.
Changes to this property will trigger replacement.
String
The Value of Tags.

Import

VpcPrefixList can be imported using the id, e.g.

$ pulumi import volcengine:vpc/prefixList:PrefixList default resource_id
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
volcengine volcengine/pulumi-volcengine
License
Apache-2.0
Notes
This Pulumi package is based on the volcengine Terraform Provider.