alicloud.ga.BandwidthPackageAttachment
Explore with Pulumi AI
Provides a Global Accelerator (GA) Bandwidth Package Attachment resource.
For information about Global Accelerator (GA) Bandwidth Package Attachment and how to use it, see What is Bandwidth Package Attachment.
NOTE: Available since v1.113.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = new alicloud.ga.Accelerator("example", {
duration: 1,
autoUseCoupon: true,
spec: "1",
});
const exampleBandwidthPackage = new alicloud.ga.BandwidthPackage("example", {
bandwidth: 20,
type: "Basic",
bandwidthType: "Basic",
duration: "1",
autoPay: true,
ratio: 30,
});
const exampleBandwidthPackageAttachment = new alicloud.ga.BandwidthPackageAttachment("example", {
acceleratorId: example.id,
bandwidthPackageId: exampleBandwidthPackage.id,
});
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.ga.Accelerator("example",
duration=1,
auto_use_coupon=True,
spec="1")
example_bandwidth_package = alicloud.ga.BandwidthPackage("example",
bandwidth=20,
type="Basic",
bandwidth_type="Basic",
duration="1",
auto_pay=True,
ratio=30)
example_bandwidth_package_attachment = alicloud.ga.BandwidthPackageAttachment("example",
accelerator_id=example.id,
bandwidth_package_id=example_bandwidth_package.id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ga"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ga.NewAccelerator(ctx, "example", &ga.AcceleratorArgs{
Duration: pulumi.Int(1),
AutoUseCoupon: pulumi.Bool(true),
Spec: pulumi.String("1"),
})
if err != nil {
return err
}
exampleBandwidthPackage, err := ga.NewBandwidthPackage(ctx, "example", &ga.BandwidthPackageArgs{
Bandwidth: pulumi.Int(20),
Type: pulumi.String("Basic"),
BandwidthType: pulumi.String("Basic"),
Duration: pulumi.String("1"),
AutoPay: pulumi.Bool(true),
Ratio: pulumi.Int(30),
})
if err != nil {
return err
}
_, err = ga.NewBandwidthPackageAttachment(ctx, "example", &ga.BandwidthPackageAttachmentArgs{
AcceleratorId: 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.Ga.Accelerator("example", new()
{
Duration = 1,
AutoUseCoupon = true,
Spec = "1",
});
var exampleBandwidthPackage = new AliCloud.Ga.BandwidthPackage("example", new()
{
Bandwidth = 20,
Type = "Basic",
BandwidthType = "Basic",
Duration = "1",
AutoPay = true,
Ratio = 30,
});
var exampleBandwidthPackageAttachment = new AliCloud.Ga.BandwidthPackageAttachment("example", new()
{
AcceleratorId = 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.ga.Accelerator;
import com.pulumi.alicloud.ga.AcceleratorArgs;
import com.pulumi.alicloud.ga.BandwidthPackage;
import com.pulumi.alicloud.ga.BandwidthPackageArgs;
import com.pulumi.alicloud.ga.BandwidthPackageAttachment;
import com.pulumi.alicloud.ga.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 Accelerator("example", AcceleratorArgs.builder()
.duration(1)
.autoUseCoupon(true)
.spec("1")
.build());
var exampleBandwidthPackage = new BandwidthPackage("exampleBandwidthPackage", BandwidthPackageArgs.builder()
.bandwidth(20)
.type("Basic")
.bandwidthType("Basic")
.duration(1)
.autoPay(true)
.ratio(30)
.build());
var exampleBandwidthPackageAttachment = new BandwidthPackageAttachment("exampleBandwidthPackageAttachment", BandwidthPackageAttachmentArgs.builder()
.acceleratorId(example.id())
.bandwidthPackageId(exampleBandwidthPackage.id())
.build());
}
}
resources:
example:
type: alicloud:ga:Accelerator
properties:
duration: 1
autoUseCoupon: true
spec: '1'
exampleBandwidthPackage:
type: alicloud:ga:BandwidthPackage
name: example
properties:
bandwidth: 20
type: Basic
bandwidthType: Basic
duration: 1
autoPay: true
ratio: 30
exampleBandwidthPackageAttachment:
type: alicloud:ga:BandwidthPackageAttachment
name: example
properties:
acceleratorId: ${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,
accelerator_id: Optional[str] = None,
bandwidth_package_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:ga: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 alicloudBandwidthPackageAttachmentResource = new AliCloud.Ga.BandwidthPackageAttachment("alicloudBandwidthPackageAttachmentResource", new()
{
AcceleratorId = "string",
BandwidthPackageId = "string",
});
example, err := ga.NewBandwidthPackageAttachment(ctx, "alicloudBandwidthPackageAttachmentResource", &ga.BandwidthPackageAttachmentArgs{
AcceleratorId: pulumi.String("string"),
BandwidthPackageId: pulumi.String("string"),
})
var alicloudBandwidthPackageAttachmentResource = new BandwidthPackageAttachment("alicloudBandwidthPackageAttachmentResource", BandwidthPackageAttachmentArgs.builder()
.acceleratorId("string")
.bandwidthPackageId("string")
.build());
alicloud_bandwidth_package_attachment_resource = alicloud.ga.BandwidthPackageAttachment("alicloudBandwidthPackageAttachmentResource",
accelerator_id="string",
bandwidth_package_id="string")
const alicloudBandwidthPackageAttachmentResource = new alicloud.ga.BandwidthPackageAttachment("alicloudBandwidthPackageAttachmentResource", {
acceleratorId: "string",
bandwidthPackageId: "string",
});
type: alicloud:ga:BandwidthPackageAttachment
properties:
acceleratorId: string
bandwidthPackageId: 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:
- Accelerator
Id string - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- Bandwidth
Package stringId - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified.
- Accelerator
Id string - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- Bandwidth
Package stringId - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified.
- accelerator
Id String - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- bandwidth
Package StringId - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified.
- accelerator
Id string - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- bandwidth
Package stringId - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified.
- accelerator_
id str - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- bandwidth_
package_ strid - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified.
- accelerator
Id String - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- bandwidth
Package StringId - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified.
Outputs
All input properties are implicitly available as output properties. Additionally, the BandwidthPackageAttachment resource produces the following output properties:
- Accelerators List<string>
- Accelerators bound with current Bandwidth Package.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- State of Bandwidth Package.
- Accelerators []string
- Accelerators bound with current Bandwidth Package.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- State of Bandwidth Package.
- accelerators List<String>
- Accelerators bound with current Bandwidth Package.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- State of Bandwidth Package.
- accelerators string[]
- Accelerators bound with current Bandwidth Package.
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- State of Bandwidth Package.
- accelerators Sequence[str]
- Accelerators bound with current Bandwidth Package.
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- State of Bandwidth Package.
- accelerators List<String>
- Accelerators bound with current Bandwidth Package.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- State of Bandwidth Package.
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,
accelerator_id: Optional[str] = None,
accelerators: Optional[Sequence[str]] = None,
bandwidth_package_id: Optional[str] = None,
status: 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.
- Accelerator
Id string - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- Accelerators List<string>
- Accelerators bound with current Bandwidth Package.
- Bandwidth
Package stringId - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified. - Status string
- State of Bandwidth Package.
- Accelerator
Id string - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- Accelerators []string
- Accelerators bound with current Bandwidth Package.
- Bandwidth
Package stringId - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified. - Status string
- State of Bandwidth Package.
- accelerator
Id String - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- accelerators List<String>
- Accelerators bound with current Bandwidth Package.
- bandwidth
Package StringId - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified. - status String
- State of Bandwidth Package.
- accelerator
Id string - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- accelerators string[]
- Accelerators bound with current Bandwidth Package.
- bandwidth
Package stringId - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified. - status string
- State of Bandwidth Package.
- accelerator_
id str - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- accelerators Sequence[str]
- Accelerators bound with current Bandwidth Package.
- bandwidth_
package_ strid - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified. - status str
- State of Bandwidth Package.
- accelerator
Id String - The ID of the Global Accelerator instance from which you want to disassociate the bandwidth plan.
- accelerators List<String>
- Accelerators bound with current Bandwidth Package.
- bandwidth
Package StringId - The ID of the bandwidth plan to disassociate. NOTE: From version 1.192.0,
bandwidth_package_id
can be modified. - status String
- State of Bandwidth Package.
Import
Ga Bandwidth Package Attachment can be imported using the id. Format to <accelerator_id>:<bandwidth_package_id>
, e.g.
$ pulumi import alicloud:ga/bandwidthPackageAttachment:BandwidthPackageAttachment example your_accelerator_id:your_bandwidth_package_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.