1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cen
  5. BandwidthPackageAttachment
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

alicloud.cen.BandwidthPackageAttachment

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

    Provides a CEN bandwidth package attachment resource. The resource can be used to bind a bandwidth package to a specified CEN instance.

    NOTE: Available since v1.18.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const exampleInstance = new alicloud.cen.Instance("exampleInstance", {
        cenInstanceName: "tf_example",
        description: "an example for cen",
    });
    const exampleBandwidthPackage = new alicloud.cen.BandwidthPackage("exampleBandwidthPackage", {
        bandwidth: 5,
        cenBandwidthPackageName: "tf_example",
        geographicRegionAId: "China",
        geographicRegionBId: "China",
    });
    const exampleBandwidthPackageAttachment = new alicloud.cen.BandwidthPackageAttachment("exampleBandwidthPackageAttachment", {
        instanceId: exampleInstance.id,
        bandwidthPackageId: exampleBandwidthPackage.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example_instance = alicloud.cen.Instance("exampleInstance",
        cen_instance_name="tf_example",
        description="an example for cen")
    example_bandwidth_package = alicloud.cen.BandwidthPackage("exampleBandwidthPackage",
        bandwidth=5,
        cen_bandwidth_package_name="tf_example",
        geographic_region_a_id="China",
        geographic_region_b_id="China")
    example_bandwidth_package_attachment = alicloud.cen.BandwidthPackageAttachment("exampleBandwidthPackageAttachment",
        instance_id=example_instance.id,
        bandwidth_package_id=example_bandwidth_package.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 {
    		exampleInstance, err := cen.NewInstance(ctx, "exampleInstance", &cen.InstanceArgs{
    			CenInstanceName: pulumi.String("tf_example"),
    			Description:     pulumi.String("an example for cen"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleBandwidthPackage, err := cen.NewBandwidthPackage(ctx, "exampleBandwidthPackage", &cen.BandwidthPackageArgs{
    			Bandwidth:               pulumi.Int(5),
    			CenBandwidthPackageName: pulumi.String("tf_example"),
    			GeographicRegionAId:     pulumi.String("China"),
    			GeographicRegionBId:     pulumi.String("China"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cen.NewBandwidthPackageAttachment(ctx, "exampleBandwidthPackageAttachment", &cen.BandwidthPackageAttachmentArgs{
    			InstanceId:         exampleInstance.ID(),
    			BandwidthPackageId: exampleBandwidthPackage.ID(),
    		})
    		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 exampleInstance = new AliCloud.Cen.Instance("exampleInstance", new()
        {
            CenInstanceName = "tf_example",
            Description = "an example for cen",
        });
    
        var exampleBandwidthPackage = new AliCloud.Cen.BandwidthPackage("exampleBandwidthPackage", new()
        {
            Bandwidth = 5,
            CenBandwidthPackageName = "tf_example",
            GeographicRegionAId = "China",
            GeographicRegionBId = "China",
        });
    
        var exampleBandwidthPackageAttachment = new AliCloud.Cen.BandwidthPackageAttachment("exampleBandwidthPackageAttachment", new()
        {
            InstanceId = exampleInstance.Id,
            BandwidthPackageId = exampleBandwidthPackage.Id,
        });
    
    });
    
    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.BandwidthPackage;
    import com.pulumi.alicloud.cen.BandwidthPackageArgs;
    import com.pulumi.alicloud.cen.BandwidthPackageAttachment;
    import com.pulumi.alicloud.cen.BandwidthPackageAttachmentArgs;
    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 exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()        
                .cenInstanceName("tf_example")
                .description("an example for cen")
                .build());
    
            var exampleBandwidthPackage = new BandwidthPackage("exampleBandwidthPackage", BandwidthPackageArgs.builder()        
                .bandwidth(5)
                .cenBandwidthPackageName("tf_example")
                .geographicRegionAId("China")
                .geographicRegionBId("China")
                .build());
    
            var exampleBandwidthPackageAttachment = new BandwidthPackageAttachment("exampleBandwidthPackageAttachment", BandwidthPackageAttachmentArgs.builder()        
                .instanceId(exampleInstance.id())
                .bandwidthPackageId(exampleBandwidthPackage.id())
                .build());
    
        }
    }
    
    resources:
      exampleInstance:
        type: alicloud:cen:Instance
        properties:
          cenInstanceName: tf_example
          description: an example for cen
      exampleBandwidthPackage:
        type: alicloud:cen:BandwidthPackage
        properties:
          bandwidth: 5
          cenBandwidthPackageName: tf_example
          geographicRegionAId: China
          geographicRegionBId: China
      exampleBandwidthPackageAttachment:
        type: alicloud:cen:BandwidthPackageAttachment
        properties:
          instanceId: ${exampleInstance.id}
          bandwidthPackageId: ${exampleBandwidthPackage.id}
    

    Create BandwidthPackageAttachment Resource

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

    Constructor syntax

    new BandwidthPackageAttachment(name: string, args: BandwidthPackageAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def BandwidthPackageAttachment(resource_name: str,
                                   args: BandwidthPackageAttachmentArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def BandwidthPackageAttachment(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   bandwidth_package_id: Optional[str] = None,
                                   instance_id: Optional[str] = None)
    func NewBandwidthPackageAttachment(ctx *Context, name string, args BandwidthPackageAttachmentArgs, opts ...ResourceOption) (*BandwidthPackageAttachment, error)
    public BandwidthPackageAttachment(string name, BandwidthPackageAttachmentArgs args, CustomResourceOptions? opts = null)
    public BandwidthPackageAttachment(String name, BandwidthPackageAttachmentArgs args)
    public BandwidthPackageAttachment(String name, BandwidthPackageAttachmentArgs args, CustomResourceOptions options)
    
    type: alicloud:cen:BandwidthPackageAttachment
    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 BandwidthPackageAttachmentArgs
    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 BandwidthPackageAttachmentArgs
    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 BandwidthPackageAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BandwidthPackageAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BandwidthPackageAttachmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var bandwidthPackageAttachmentResource = new AliCloud.Cen.BandwidthPackageAttachment("bandwidthPackageAttachmentResource", new()
    {
        BandwidthPackageId = "string",
        InstanceId = "string",
    });
    
    example, err := cen.NewBandwidthPackageAttachment(ctx, "bandwidthPackageAttachmentResource", &cen.BandwidthPackageAttachmentArgs{
    	BandwidthPackageId: pulumi.String("string"),
    	InstanceId:         pulumi.String("string"),
    })
    
    var bandwidthPackageAttachmentResource = new BandwidthPackageAttachment("bandwidthPackageAttachmentResource", BandwidthPackageAttachmentArgs.builder()        
        .bandwidthPackageId("string")
        .instanceId("string")
        .build());
    
    bandwidth_package_attachment_resource = alicloud.cen.BandwidthPackageAttachment("bandwidthPackageAttachmentResource",
        bandwidth_package_id="string",
        instance_id="string")
    
    const bandwidthPackageAttachmentResource = new alicloud.cen.BandwidthPackageAttachment("bandwidthPackageAttachmentResource", {
        bandwidthPackageId: "string",
        instanceId: "string",
    });
    
    type: alicloud:cen:BandwidthPackageAttachment
    properties:
        bandwidthPackageId: string
        instanceId: string
    

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

    BandwidthPackageId string
    The ID of the bandwidth package.
    InstanceId string
    The ID of the CEN.
    BandwidthPackageId string
    The ID of the bandwidth package.
    InstanceId string
    The ID of the CEN.
    bandwidthPackageId String
    The ID of the bandwidth package.
    instanceId String
    The ID of the CEN.
    bandwidthPackageId string
    The ID of the bandwidth package.
    instanceId string
    The ID of the CEN.
    bandwidth_package_id str
    The ID of the bandwidth package.
    instance_id str
    The ID of the CEN.
    bandwidthPackageId String
    The ID of the bandwidth package.
    instanceId String
    The ID of the CEN.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the BandwidthPackageAttachment 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 BandwidthPackageAttachment Resource

    Get an existing BandwidthPackageAttachment 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?: BandwidthPackageAttachmentState, opts?: CustomResourceOptions): BandwidthPackageAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bandwidth_package_id: Optional[str] = None,
            instance_id: Optional[str] = None) -> BandwidthPackageAttachment
    func GetBandwidthPackageAttachment(ctx *Context, name string, id IDInput, state *BandwidthPackageAttachmentState, opts ...ResourceOption) (*BandwidthPackageAttachment, error)
    public static BandwidthPackageAttachment Get(string name, Input<string> id, BandwidthPackageAttachmentState? state, CustomResourceOptions? opts = null)
    public static BandwidthPackageAttachment get(String name, Output<String> id, BandwidthPackageAttachmentState 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:
    BandwidthPackageId string
    The ID of the bandwidth package.
    InstanceId string
    The ID of the CEN.
    BandwidthPackageId string
    The ID of the bandwidth package.
    InstanceId string
    The ID of the CEN.
    bandwidthPackageId String
    The ID of the bandwidth package.
    instanceId String
    The ID of the CEN.
    bandwidthPackageId string
    The ID of the bandwidth package.
    instanceId string
    The ID of the CEN.
    bandwidth_package_id str
    The ID of the bandwidth package.
    instance_id str
    The ID of the CEN.
    bandwidthPackageId String
    The ID of the bandwidth package.
    instanceId String
    The ID of the CEN.

    Import

    CEN bandwidth package attachment resource can be imported using the id, e.g.

    $ pulumi import alicloud:cen/bandwidthPackageAttachment:BandwidthPackageAttachment example bwp-abc123456
    

    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.52.1 published on Thursday, Apr 4, 2024 by Pulumi