1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cen
  5. TrafficMarkingPolicy
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.cen.TrafficMarkingPolicy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a Cloud Enterprise Network (CEN) Traffic Marking Policy resource.

    For information about Cloud Enterprise Network (CEN) Traffic Marking Policy and how to use it, see What is Traffic Marking Policy.

    NOTE: Available since v1.173.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = new alicloud.cen.Instance("example", {
        cenInstanceName: "tf_example",
        description: "an example for cen",
    });
    const exampleTransitRouter = new alicloud.cen.TransitRouter("example", {
        transitRouterName: "tf_example",
        cenId: example.id,
    });
    const exampleTrafficMarkingPolicy = new alicloud.cen.TrafficMarkingPolicy("example", {
        markingDscp: 1,
        priority: 1,
        trafficMarkingPolicyName: "tf_example",
        transitRouterId: exampleTransitRouter.transitRouterId,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.cen.Instance("example",
        cen_instance_name="tf_example",
        description="an example for cen")
    example_transit_router = alicloud.cen.TransitRouter("example",
        transit_router_name="tf_example",
        cen_id=example.id)
    example_traffic_marking_policy = alicloud.cen.TrafficMarkingPolicy("example",
        marking_dscp=1,
        priority=1,
        traffic_marking_policy_name="tf_example",
        transit_router_id=example_transit_router.transit_router_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := cen.NewInstance(ctx, "example", &cen.InstanceArgs{
    			CenInstanceName: pulumi.String("tf_example"),
    			Description:     pulumi.String("an example for cen"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleTransitRouter, err := cen.NewTransitRouter(ctx, "example", &cen.TransitRouterArgs{
    			TransitRouterName: pulumi.String("tf_example"),
    			CenId:             example.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cen.NewTrafficMarkingPolicy(ctx, "example", &cen.TrafficMarkingPolicyArgs{
    			MarkingDscp:              pulumi.Int(1),
    			Priority:                 pulumi.Int(1),
    			TrafficMarkingPolicyName: pulumi.String("tf_example"),
    			TransitRouterId:          exampleTransitRouter.TransitRouterId,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AliCloud.Cen.Instance("example", new()
        {
            CenInstanceName = "tf_example",
            Description = "an example for cen",
        });
    
        var exampleTransitRouter = new AliCloud.Cen.TransitRouter("example", new()
        {
            TransitRouterName = "tf_example",
            CenId = example.Id,
        });
    
        var exampleTrafficMarkingPolicy = new AliCloud.Cen.TrafficMarkingPolicy("example", new()
        {
            MarkingDscp = 1,
            Priority = 1,
            TrafficMarkingPolicyName = "tf_example",
            TransitRouterId = exampleTransitRouter.TransitRouterId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cen.Instance;
    import com.pulumi.alicloud.cen.InstanceArgs;
    import com.pulumi.alicloud.cen.TransitRouter;
    import com.pulumi.alicloud.cen.TransitRouterArgs;
    import com.pulumi.alicloud.cen.TrafficMarkingPolicy;
    import com.pulumi.alicloud.cen.TrafficMarkingPolicyArgs;
    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 Instance("example", InstanceArgs.builder()
                .cenInstanceName("tf_example")
                .description("an example for cen")
                .build());
    
            var exampleTransitRouter = new TransitRouter("exampleTransitRouter", TransitRouterArgs.builder()
                .transitRouterName("tf_example")
                .cenId(example.id())
                .build());
    
            var exampleTrafficMarkingPolicy = new TrafficMarkingPolicy("exampleTrafficMarkingPolicy", TrafficMarkingPolicyArgs.builder()
                .markingDscp(1)
                .priority(1)
                .trafficMarkingPolicyName("tf_example")
                .transitRouterId(exampleTransitRouter.transitRouterId())
                .build());
    
        }
    }
    
    resources:
      example:
        type: alicloud:cen:Instance
        properties:
          cenInstanceName: tf_example
          description: an example for cen
      exampleTransitRouter:
        type: alicloud:cen:TransitRouter
        name: example
        properties:
          transitRouterName: tf_example
          cenId: ${example.id}
      exampleTrafficMarkingPolicy:
        type: alicloud:cen:TrafficMarkingPolicy
        name: example
        properties:
          markingDscp: 1
          priority: 1
          trafficMarkingPolicyName: tf_example
          transitRouterId: ${exampleTransitRouter.transitRouterId}
    

    Create TrafficMarkingPolicy Resource

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

    Constructor syntax

    new TrafficMarkingPolicy(name: string, args: TrafficMarkingPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def TrafficMarkingPolicy(resource_name: str,
                             args: TrafficMarkingPolicyArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def TrafficMarkingPolicy(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             marking_dscp: Optional[int] = None,
                             priority: Optional[int] = None,
                             transit_router_id: Optional[str] = None,
                             description: Optional[str] = None,
                             dry_run: Optional[bool] = None,
                             traffic_marking_policy_name: Optional[str] = None)
    func NewTrafficMarkingPolicy(ctx *Context, name string, args TrafficMarkingPolicyArgs, opts ...ResourceOption) (*TrafficMarkingPolicy, error)
    public TrafficMarkingPolicy(string name, TrafficMarkingPolicyArgs args, CustomResourceOptions? opts = null)
    public TrafficMarkingPolicy(String name, TrafficMarkingPolicyArgs args)
    public TrafficMarkingPolicy(String name, TrafficMarkingPolicyArgs args, CustomResourceOptions options)
    
    type: alicloud:cen:TrafficMarkingPolicy
    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 TrafficMarkingPolicyArgs
    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 TrafficMarkingPolicyArgs
    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 TrafficMarkingPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TrafficMarkingPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TrafficMarkingPolicyArgs
    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 trafficMarkingPolicyResource = new AliCloud.Cen.TrafficMarkingPolicy("trafficMarkingPolicyResource", new()
    {
        MarkingDscp = 0,
        Priority = 0,
        TransitRouterId = "string",
        Description = "string",
        DryRun = false,
        TrafficMarkingPolicyName = "string",
    });
    
    example, err := cen.NewTrafficMarkingPolicy(ctx, "trafficMarkingPolicyResource", &cen.TrafficMarkingPolicyArgs{
    	MarkingDscp:              pulumi.Int(0),
    	Priority:                 pulumi.Int(0),
    	TransitRouterId:          pulumi.String("string"),
    	Description:              pulumi.String("string"),
    	DryRun:                   pulumi.Bool(false),
    	TrafficMarkingPolicyName: pulumi.String("string"),
    })
    
    var trafficMarkingPolicyResource = new TrafficMarkingPolicy("trafficMarkingPolicyResource", TrafficMarkingPolicyArgs.builder()
        .markingDscp(0)
        .priority(0)
        .transitRouterId("string")
        .description("string")
        .dryRun(false)
        .trafficMarkingPolicyName("string")
        .build());
    
    traffic_marking_policy_resource = alicloud.cen.TrafficMarkingPolicy("trafficMarkingPolicyResource",
        marking_dscp=0,
        priority=0,
        transit_router_id="string",
        description="string",
        dry_run=False,
        traffic_marking_policy_name="string")
    
    const trafficMarkingPolicyResource = new alicloud.cen.TrafficMarkingPolicy("trafficMarkingPolicyResource", {
        markingDscp: 0,
        priority: 0,
        transitRouterId: "string",
        description: "string",
        dryRun: false,
        trafficMarkingPolicyName: "string",
    });
    
    type: alicloud:cen:TrafficMarkingPolicy
    properties:
        description: string
        dryRun: false
        markingDscp: 0
        priority: 0
        trafficMarkingPolicyName: string
        transitRouterId: string
    

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

    MarkingDscp int
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    Priority int
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    TransitRouterId string
    The ID of the transit router.
    Description string
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    DryRun bool
    The dry run.
    TrafficMarkingPolicyName string
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    MarkingDscp int
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    Priority int
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    TransitRouterId string
    The ID of the transit router.
    Description string
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    DryRun bool
    The dry run.
    TrafficMarkingPolicyName string
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    markingDscp Integer
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    priority Integer
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    transitRouterId String
    The ID of the transit router.
    description String
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    dryRun Boolean
    The dry run.
    trafficMarkingPolicyName String
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    markingDscp number
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    priority number
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    transitRouterId string
    The ID of the transit router.
    description string
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    dryRun boolean
    The dry run.
    trafficMarkingPolicyName string
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    marking_dscp int
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    priority int
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    transit_router_id str
    The ID of the transit router.
    description str
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    dry_run bool
    The dry run.
    traffic_marking_policy_name str
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    markingDscp Number
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    priority Number
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    transitRouterId String
    The ID of the transit router.
    description String
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    dryRun Boolean
    The dry run.
    trafficMarkingPolicyName String
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource.
    TrafficMarkingPolicyId string
    The ID of the Traffic Marking Policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource.
    TrafficMarkingPolicyId string
    The ID of the Traffic Marking Policy.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource.
    trafficMarkingPolicyId String
    The ID of the Traffic Marking Policy.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the resource.
    trafficMarkingPolicyId string
    The ID of the Traffic Marking Policy.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the resource.
    traffic_marking_policy_id str
    The ID of the Traffic Marking Policy.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource.
    trafficMarkingPolicyId String
    The ID of the Traffic Marking Policy.

    Look up Existing TrafficMarkingPolicy Resource

    Get an existing TrafficMarkingPolicy 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?: TrafficMarkingPolicyState, opts?: CustomResourceOptions): TrafficMarkingPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            dry_run: Optional[bool] = None,
            marking_dscp: Optional[int] = None,
            priority: Optional[int] = None,
            status: Optional[str] = None,
            traffic_marking_policy_id: Optional[str] = None,
            traffic_marking_policy_name: Optional[str] = None,
            transit_router_id: Optional[str] = None) -> TrafficMarkingPolicy
    func GetTrafficMarkingPolicy(ctx *Context, name string, id IDInput, state *TrafficMarkingPolicyState, opts ...ResourceOption) (*TrafficMarkingPolicy, error)
    public static TrafficMarkingPolicy Get(string name, Input<string> id, TrafficMarkingPolicyState? state, CustomResourceOptions? opts = null)
    public static TrafficMarkingPolicy get(String name, Output<String> id, TrafficMarkingPolicyState 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:
    Description string
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    DryRun bool
    The dry run.
    MarkingDscp int
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    Priority int
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    Status string
    The status of the resource.
    TrafficMarkingPolicyId string
    The ID of the Traffic Marking Policy.
    TrafficMarkingPolicyName string
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    TransitRouterId string
    The ID of the transit router.
    Description string
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    DryRun bool
    The dry run.
    MarkingDscp int
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    Priority int
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    Status string
    The status of the resource.
    TrafficMarkingPolicyId string
    The ID of the Traffic Marking Policy.
    TrafficMarkingPolicyName string
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    TransitRouterId string
    The ID of the transit router.
    description String
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    dryRun Boolean
    The dry run.
    markingDscp Integer
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    priority Integer
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    status String
    The status of the resource.
    trafficMarkingPolicyId String
    The ID of the Traffic Marking Policy.
    trafficMarkingPolicyName String
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    transitRouterId String
    The ID of the transit router.
    description string
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    dryRun boolean
    The dry run.
    markingDscp number
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    priority number
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    status string
    The status of the resource.
    trafficMarkingPolicyId string
    The ID of the Traffic Marking Policy.
    trafficMarkingPolicyName string
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    transitRouterId string
    The ID of the transit router.
    description str
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    dry_run bool
    The dry run.
    marking_dscp int
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    priority int
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    status str
    The status of the resource.
    traffic_marking_policy_id str
    The ID of the Traffic Marking Policy.
    traffic_marking_policy_name str
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    transit_router_id str
    The ID of the transit router.
    description String
    The description of the Traffic Marking Policy. The description must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    dryRun Boolean
    The dry run.
    markingDscp Number
    The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy. Value range: 0~63.
    priority Number
    The Priority of the Traffic Marking Policy. Value range: 1~100.
    status String
    The status of the resource.
    trafficMarkingPolicyId String
    The ID of the Traffic Marking Policy.
    trafficMarkingPolicyName String
    The name of the Traffic Marking Policy. The name must be 2 to 128 characters in length, and must start with a letter. It can contain digits, underscores (_), and hyphens (-).
    transitRouterId String
    The ID of the transit router.

    Import

    Cloud Enterprise Network (CEN) Traffic Marking Policy can be imported using the id, e.g.

    $ pulumi import alicloud:cen/trafficMarkingPolicy:TrafficMarkingPolicy example <transit_router_id>:<traffic_marking_policy_id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi