alicloud.cen.BandwidthPackageAttachment
Explore with Pulumi AI
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 example = new alicloud.cen.Instance("example", {
cenInstanceName: "tf_example",
description: "an example for cen",
});
const exampleBandwidthPackage = new alicloud.cen.BandwidthPackage("example", {
bandwidth: 5,
cenBandwidthPackageName: "tf_example",
geographicRegionAId: "China",
geographicRegionBId: "China",
});
const exampleBandwidthPackageAttachment = new alicloud.cen.BandwidthPackageAttachment("example", {
instanceId: example.id,
bandwidthPackageId: exampleBandwidthPackage.id,
});
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.cen.Instance("example",
cen_instance_name="tf_example",
description="an example for cen")
example_bandwidth_package = alicloud.cen.BandwidthPackage("example",
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("example",
instance_id=example.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 {
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
}
exampleBandwidthPackage, err := cen.NewBandwidthPackage(ctx, "example", &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, "example", &cen.BandwidthPackageAttachmentArgs{
InstanceId: example.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 example = new AliCloud.Cen.Instance("example", new()
{
CenInstanceName = "tf_example",
Description = "an example for cen",
});
var exampleBandwidthPackage = new AliCloud.Cen.BandwidthPackage("example", new()
{
Bandwidth = 5,
CenBandwidthPackageName = "tf_example",
GeographicRegionAId = "China",
GeographicRegionBId = "China",
});
var exampleBandwidthPackageAttachment = new AliCloud.Cen.BandwidthPackageAttachment("example", new()
{
InstanceId = example.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 example = new Instance("example", 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(example.id())
.bandwidthPackageId(exampleBandwidthPackage.id())
.build());
}
}
resources:
example:
type: alicloud:cen:Instance
properties:
cenInstanceName: tf_example
description: an example for cen
exampleBandwidthPackage:
type: alicloud:cen:BandwidthPackage
name: example
properties:
bandwidth: 5
cenBandwidthPackageName: tf_example
geographicRegionAId: China
geographicRegionBId: China
exampleBandwidthPackageAttachment:
type: alicloud:cen:BandwidthPackageAttachment
name: example
properties:
instanceId: ${example.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.
Constructor 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The BandwidthPackageAttachment resource accepts the following input properties:
- Bandwidth
Package stringId - The ID of the bandwidth package.
- Instance
Id string - The ID of the CEN.
- Bandwidth
Package stringId - The ID of the bandwidth package.
- Instance
Id string - The ID of the CEN.
- bandwidth
Package StringId - The ID of the bandwidth package.
- instance
Id String - The ID of the CEN.
- bandwidth
Package stringId - The ID of the bandwidth package.
- instance
Id string - The ID of the CEN.
- bandwidth_
package_ strid - The ID of the bandwidth package.
- instance_
id str - The ID of the CEN.
- bandwidth
Package StringId - The ID of the bandwidth package.
- instance
Id 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.
- Bandwidth
Package stringId - The ID of the bandwidth package.
- Instance
Id string - The ID of the CEN.
- Bandwidth
Package stringId - The ID of the bandwidth package.
- Instance
Id string - The ID of the CEN.
- bandwidth
Package StringId - The ID of the bandwidth package.
- instance
Id String - The ID of the CEN.
- bandwidth
Package stringId - The ID of the bandwidth package.
- instance
Id string - The ID of the CEN.
- bandwidth_
package_ strid - The ID of the bandwidth package.
- instance_
id str - The ID of the CEN.
- bandwidth
Package StringId - The ID of the bandwidth package.
- instance
Id 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.