BandwidthPackageAttachment

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

Example Usage

Basic Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new bandwidth package attachment and use it to attach a bandwidth package to a new CEN
        var cen = new AliCloud.Cen.Instance("cen", new AliCloud.Cen.InstanceArgs
        {
            Description = "tf-testAccCenBandwidthPackageAttachmentDescription",
        });
        var bwp = new AliCloud.Cen.BandwidthPackage("bwp", new AliCloud.Cen.BandwidthPackageArgs
        {
            Bandwidth = 20,
            GeographicRegionIds = 
            {
                "China",
                "Asia-Pacific",
            },
        });
        var foo = new AliCloud.Cen.BandwidthPackageAttachment("foo", new AliCloud.Cen.BandwidthPackageAttachmentArgs
        {
            InstanceId = cen.Id,
            BandwidthPackageId = bwp.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 {
		cen, err := cen.NewInstance(ctx, "cen", &cen.InstanceArgs{
			Description: pulumi.String("tf-testAccCenBandwidthPackageAttachmentDescription"),
		})
		if err != nil {
			return err
		}
		bwp, err := cen.NewBandwidthPackage(ctx, "bwp", &cen.BandwidthPackageArgs{
			Bandwidth: pulumi.Int(20),
			GeographicRegionIds: pulumi.StringArray{
				pulumi.String("China"),
				pulumi.String("Asia-Pacific"),
			},
		})
		if err != nil {
			return err
		}
		_, err = cen.NewBandwidthPackageAttachment(ctx, "foo", &cen.BandwidthPackageAttachmentArgs{
			InstanceId:         cen.ID(),
			BandwidthPackageId: bwp.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 cen = new Instance("cen", InstanceArgs.builder()        
            .description("tf-testAccCenBandwidthPackageAttachmentDescription")
            .build());

        var bwp = new BandwidthPackage("bwp", BandwidthPackageArgs.builder()        
            .bandwidth(20)
            .geographicRegionIds(            
                "China",
                "Asia-Pacific")
            .build());

        var foo = new BandwidthPackageAttachment("foo", BandwidthPackageAttachmentArgs.builder()        
            .instanceId(cen.id())
            .bandwidthPackageId(bwp.id())
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

# Create a new bandwidth package attachment and use it to attach a bandwidth package to a new CEN
cen = alicloud.cen.Instance("cen", description="tf-testAccCenBandwidthPackageAttachmentDescription")
bwp = alicloud.cen.BandwidthPackage("bwp",
    bandwidth=20,
    geographic_region_ids=[
        "China",
        "Asia-Pacific",
    ])
foo = alicloud.cen.BandwidthPackageAttachment("foo",
    instance_id=cen.id,
    bandwidth_package_id=bwp.id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

// Create a new bandwidth package attachment and use it to attach a bandwidth package to a new CEN
const cen = new alicloud.cen.Instance("cen", {description: "tf-testAccCenBandwidthPackageAttachmentDescription"});
const bwp = new alicloud.cen.BandwidthPackage("bwp", {
    bandwidth: 20,
    geographicRegionIds: [
        "China",
        "Asia-Pacific",
    ],
});
const foo = new alicloud.cen.BandwidthPackageAttachment("foo", {
    instanceId: cen.id,
    bandwidthPackageId: bwp.id,
});
resources:
  # Create a new bandwidth package attachment and use it to attach a bandwidth package to a new CEN
  cen:
    type: alicloud:cen:Instance
    properties:
      description: tf-testAccCenBandwidthPackageAttachmentDescription
  bwp:
    type: alicloud:cen:BandwidthPackage
    properties:
      bandwidth: 20
      geographicRegionIds:
        - China
        - Asia-Pacific
  foo:
    type: alicloud:cen:BandwidthPackageAttachment
    properties:
      instanceId: ${cen.id}
      bandwidthPackageId: ${bwp.id}

Create BandwidthPackageAttachment Resource

new BandwidthPackageAttachment(name: string, args: BandwidthPackageAttachmentArgs, opts?: CustomResourceOptions);
@overload
def BandwidthPackageAttachment(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               bandwidth_package_id: Optional[str] = None,
                               instance_id: Optional[str] = None)
@overload
def BandwidthPackageAttachment(resource_name: str,
                               args: BandwidthPackageAttachmentArgs,
                               opts: Optional[ResourceOptions] = 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.

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.

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

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.