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

alicloud.expressconnect.TrafficQosAssociation

Explore with Pulumi AI

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

    Provides a Express Connect Traffic Qos Association resource. Express Connect QoS associated resources.

    For information about Express Connect Traffic Qos Association and how to use it, see What is Traffic Qos Association.

    NOTE: Available since v1.224.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const default = alicloud.expressconnect.getPhysicalConnections({
        nameRegex: "preserved-NODELETING",
    });
    const createQos = new alicloud.expressconnect.TrafficQos("createQos", {
        qosName: name,
        qosDescription: "terraform-example",
    });
    const associateQos = new alicloud.expressconnect.TrafficQosAssociation("associateQos", {
        instanceId: _default.then(_default => _default.ids?.[1]),
        qosId: createQos.id,
        instanceType: "PHYSICALCONNECTION",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.expressconnect.get_physical_connections(name_regex="preserved-NODELETING")
    create_qos = alicloud.expressconnect.TrafficQos("createQos",
        qos_name=name,
        qos_description="terraform-example")
    associate_qos = alicloud.expressconnect.TrafficQosAssociation("associateQos",
        instance_id=default.ids[1],
        qos_id=create_qos.id,
        instance_type="PHYSICALCONNECTION")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/expressconnect"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := expressconnect.GetPhysicalConnections(ctx, &expressconnect.GetPhysicalConnectionsArgs{
    			NameRegex: pulumi.StringRef("preserved-NODELETING"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		createQos, err := expressconnect.NewTrafficQos(ctx, "createQos", &expressconnect.TrafficQosArgs{
    			QosName:        pulumi.String(name),
    			QosDescription: pulumi.String("terraform-example"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = expressconnect.NewTrafficQosAssociation(ctx, "associateQos", &expressconnect.TrafficQosAssociationArgs{
    			InstanceId:   pulumi.String(_default.Ids[1]),
    			QosId:        createQos.ID(),
    			InstanceType: pulumi.String("PHYSICALCONNECTION"),
    		})
    		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 config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.ExpressConnect.GetPhysicalConnections.Invoke(new()
        {
            NameRegex = "preserved-NODELETING",
        });
    
        var createQos = new AliCloud.ExpressConnect.TrafficQos("createQos", new()
        {
            QosName = name,
            QosDescription = "terraform-example",
        });
    
        var associateQos = new AliCloud.ExpressConnect.TrafficQosAssociation("associateQos", new()
        {
            InstanceId = @default.Apply(@default => @default.Apply(getPhysicalConnectionsResult => getPhysicalConnectionsResult.Ids[1])),
            QosId = createQos.Id,
            InstanceType = "PHYSICALCONNECTION",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.expressconnect.ExpressconnectFunctions;
    import com.pulumi.alicloud.expressconnect.inputs.GetPhysicalConnectionsArgs;
    import com.pulumi.alicloud.expressconnect.TrafficQos;
    import com.pulumi.alicloud.expressconnect.TrafficQosArgs;
    import com.pulumi.alicloud.expressconnect.TrafficQosAssociation;
    import com.pulumi.alicloud.expressconnect.TrafficQosAssociationArgs;
    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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            final var default = ExpressconnectFunctions.getPhysicalConnections(GetPhysicalConnectionsArgs.builder()
                .nameRegex("preserved-NODELETING")
                .build());
    
            var createQos = new TrafficQos("createQos", TrafficQosArgs.builder()
                .qosName(name)
                .qosDescription("terraform-example")
                .build());
    
            var associateQos = new TrafficQosAssociation("associateQos", TrafficQosAssociationArgs.builder()
                .instanceId(default_.ids()[1])
                .qosId(createQos.id())
                .instanceType("PHYSICALCONNECTION")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      createQos:
        type: alicloud:expressconnect:TrafficQos
        properties:
          qosName: ${name}
          qosDescription: terraform-example
      associateQos:
        type: alicloud:expressconnect:TrafficQosAssociation
        properties:
          instanceId: ${default.ids[1]}
          qosId: ${createQos.id}
          instanceType: PHYSICALCONNECTION
    variables:
      default:
        fn::invoke:
          Function: alicloud:expressconnect:getPhysicalConnections
          Arguments:
            nameRegex: preserved-NODELETING
    

    Create TrafficQosAssociation Resource

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

    Constructor syntax

    new TrafficQosAssociation(name: string, args: TrafficQosAssociationArgs, opts?: CustomResourceOptions);
    @overload
    def TrafficQosAssociation(resource_name: str,
                              args: TrafficQosAssociationArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def TrafficQosAssociation(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              qos_id: Optional[str] = None,
                              instance_id: Optional[str] = None,
                              instance_type: Optional[str] = None)
    func NewTrafficQosAssociation(ctx *Context, name string, args TrafficQosAssociationArgs, opts ...ResourceOption) (*TrafficQosAssociation, error)
    public TrafficQosAssociation(string name, TrafficQosAssociationArgs args, CustomResourceOptions? opts = null)
    public TrafficQosAssociation(String name, TrafficQosAssociationArgs args)
    public TrafficQosAssociation(String name, TrafficQosAssociationArgs args, CustomResourceOptions options)
    
    type: alicloud:expressconnect:TrafficQosAssociation
    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 TrafficQosAssociationArgs
    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 TrafficQosAssociationArgs
    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 TrafficQosAssociationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TrafficQosAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TrafficQosAssociationArgs
    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 trafficQosAssociationResource = new AliCloud.ExpressConnect.TrafficQosAssociation("trafficQosAssociationResource", new()
    {
        QosId = "string",
        InstanceId = "string",
        InstanceType = "string",
    });
    
    example, err := expressconnect.NewTrafficQosAssociation(ctx, "trafficQosAssociationResource", &expressconnect.TrafficQosAssociationArgs{
    	QosId:        pulumi.String("string"),
    	InstanceId:   pulumi.String("string"),
    	InstanceType: pulumi.String("string"),
    })
    
    var trafficQosAssociationResource = new TrafficQosAssociation("trafficQosAssociationResource", TrafficQosAssociationArgs.builder()
        .qosId("string")
        .instanceId("string")
        .instanceType("string")
        .build());
    
    traffic_qos_association_resource = alicloud.expressconnect.TrafficQosAssociation("trafficQosAssociationResource",
        qos_id="string",
        instance_id="string",
        instance_type="string")
    
    const trafficQosAssociationResource = new alicloud.expressconnect.TrafficQosAssociation("trafficQosAssociationResource", {
        qosId: "string",
        instanceId: "string",
        instanceType: "string",
    });
    
    type: alicloud:expressconnect:TrafficQosAssociation
    properties:
        instanceId: string
        instanceType: string
        qosId: string
    

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

    QosId string
    The QoS policy ID.
    InstanceId string
    The ID of the associated instance.
    InstanceType string
    The type of the associated instance. Value: physical connection physical connection.
    QosId string
    The QoS policy ID.
    InstanceId string
    The ID of the associated instance.
    InstanceType string
    The type of the associated instance. Value: physical connection physical connection.
    qosId String
    The QoS policy ID.
    instanceId String
    The ID of the associated instance.
    instanceType String
    The type of the associated instance. Value: physical connection physical connection.
    qosId string
    The QoS policy ID.
    instanceId string
    The ID of the associated instance.
    instanceType string
    The type of the associated instance. Value: physical connection physical connection.
    qos_id str
    The QoS policy ID.
    instance_id str
    The ID of the associated instance.
    instance_type str
    The type of the associated instance. Value: physical connection physical connection.
    qosId String
    The QoS policy ID.
    instanceId String
    The ID of the associated instance.
    instanceType String
    The type of the associated instance. Value: physical connection physical connection.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the associated instance. Value:
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the associated instance. Value:
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the associated instance. Value:
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the associated instance. Value:
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the associated instance. Value:
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the associated instance. Value:

    Look up Existing TrafficQosAssociation Resource

    Get an existing TrafficQosAssociation 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?: TrafficQosAssociationState, opts?: CustomResourceOptions): TrafficQosAssociation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            instance_id: Optional[str] = None,
            instance_type: Optional[str] = None,
            qos_id: Optional[str] = None,
            status: Optional[str] = None) -> TrafficQosAssociation
    func GetTrafficQosAssociation(ctx *Context, name string, id IDInput, state *TrafficQosAssociationState, opts ...ResourceOption) (*TrafficQosAssociation, error)
    public static TrafficQosAssociation Get(string name, Input<string> id, TrafficQosAssociationState? state, CustomResourceOptions? opts = null)
    public static TrafficQosAssociation get(String name, Output<String> id, TrafficQosAssociationState 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:
    InstanceId string
    The ID of the associated instance.
    InstanceType string
    The type of the associated instance. Value: physical connection physical connection.
    QosId string
    The QoS policy ID.
    Status string
    The status of the associated instance. Value:
    InstanceId string
    The ID of the associated instance.
    InstanceType string
    The type of the associated instance. Value: physical connection physical connection.
    QosId string
    The QoS policy ID.
    Status string
    The status of the associated instance. Value:
    instanceId String
    The ID of the associated instance.
    instanceType String
    The type of the associated instance. Value: physical connection physical connection.
    qosId String
    The QoS policy ID.
    status String
    The status of the associated instance. Value:
    instanceId string
    The ID of the associated instance.
    instanceType string
    The type of the associated instance. Value: physical connection physical connection.
    qosId string
    The QoS policy ID.
    status string
    The status of the associated instance. Value:
    instance_id str
    The ID of the associated instance.
    instance_type str
    The type of the associated instance. Value: physical connection physical connection.
    qos_id str
    The QoS policy ID.
    status str
    The status of the associated instance. Value:
    instanceId String
    The ID of the associated instance.
    instanceType String
    The type of the associated instance. Value: physical connection physical connection.
    qosId String
    The QoS policy ID.
    status String
    The status of the associated instance. Value:

    Import

    Express Connect Traffic Qos Association can be imported using the id, e.g.

    $ pulumi import alicloud:expressconnect/trafficQosAssociation:TrafficQosAssociation example <qos_id>:<instance_id>:<instance_type>
    

    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