BandwidthAllocation resource
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as scm from "@pulumi/scm";
//#######################################################
// Create
//#######################################################
// 1000 mbps leads to 1 spn (eg: taiwan-raspberry)
// >1000 mbps leads to 2 spns (eg: taiwan-raspberry, taiwan-larch)
// >2000 mbps leads to 3 spns and so on. (eg: taiwan-raspberry, taiwan-larch, taiwan-peng)
// The API is smart enough to generate these spn's and return to us.
// To create with qos use following example
// resource "scm_bandwidth_allocation" "example" {
// name = "taiwan"
// allocated_bandwidth = 50 # In Mbps
//
// qos = {
// enabled = true
// customized = false # Set to true if using a custom profile
// profile = "Default Profile" # Name of the QoS Profile
// guaranteed_ratio = 20 # 20% guaranteed bandwidth ratio. API seems to accept only round integers
// }
//}
// When creating, we never specify an spn_name_list. That is purely during update
const example = new scm.BandwidthAllocation("example", {
name: "taiwan",
allocatedBandwidth: 50,
});
import pulumi
import pulumi_scm as scm
########################################################
# Create
########################################################
# 1000 mbps leads to 1 spn (eg: taiwan-raspberry)
# >1000 mbps leads to 2 spns (eg: taiwan-raspberry, taiwan-larch)
# >2000 mbps leads to 3 spns and so on. (eg: taiwan-raspberry, taiwan-larch, taiwan-peng)
# The API is smart enough to generate these spn's and return to us.
# To create with qos use following example
# resource "scm_bandwidth_allocation" "example" {
# name = "taiwan"
# allocated_bandwidth = 50 # In Mbps
#
# qos = {
# enabled = true
# customized = false # Set to true if using a custom profile
# profile = "Default Profile" # Name of the QoS Profile
# guaranteed_ratio = 20 # 20% guaranteed bandwidth ratio. API seems to accept only round integers
# }
#}
# When creating, we never specify an spn_name_list. That is purely during update
example = scm.BandwidthAllocation("example",
name="taiwan",
allocated_bandwidth=50)
package main
import (
"github.com/pulumi/pulumi-scm/sdk/go/scm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// #######################################################
// Create
// #######################################################
// 1000 mbps leads to 1 spn (eg: taiwan-raspberry)
// >1000 mbps leads to 2 spns (eg: taiwan-raspberry, taiwan-larch)
// >2000 mbps leads to 3 spns and so on. (eg: taiwan-raspberry, taiwan-larch, taiwan-peng)
// The API is smart enough to generate these spn's and return to us.
// To create with qos use following example
//
// resource "scm_bandwidth_allocation" "example" {
// name = "taiwan"
// allocated_bandwidth = 50 # In Mbps
//
// qos = {
// enabled = true
// customized = false # Set to true if using a custom profile
// profile = "Default Profile" # Name of the QoS Profile
// guaranteed_ratio = 20 # 20% guaranteed bandwidth ratio. API seems to accept only round integers
// }
// }
//
// When creating, we never specify an spn_name_list. That is purely during update
_, err := scm.NewBandwidthAllocation(ctx, "example", &scm.BandwidthAllocationArgs{
Name: pulumi.String("taiwan"),
AllocatedBandwidth: pulumi.Int(50),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scm = Pulumi.Scm;
return await Deployment.RunAsync(() =>
{
//#######################################################
// Create
//#######################################################
// 1000 mbps leads to 1 spn (eg: taiwan-raspberry)
// >1000 mbps leads to 2 spns (eg: taiwan-raspberry, taiwan-larch)
// >2000 mbps leads to 3 spns and so on. (eg: taiwan-raspberry, taiwan-larch, taiwan-peng)
// The API is smart enough to generate these spn's and return to us.
// To create with qos use following example
// resource "scm_bandwidth_allocation" "example" {
// name = "taiwan"
// allocated_bandwidth = 50 # In Mbps
//
// qos = {
// enabled = true
// customized = false # Set to true if using a custom profile
// profile = "Default Profile" # Name of the QoS Profile
// guaranteed_ratio = 20 # 20% guaranteed bandwidth ratio. API seems to accept only round integers
// }
//}
// When creating, we never specify an spn_name_list. That is purely during update
var example = new Scm.BandwidthAllocation("example", new()
{
Name = "taiwan",
AllocatedBandwidth = 50,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scm.BandwidthAllocation;
import com.pulumi.scm.BandwidthAllocationArgs;
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) {
//#######################################################
// Create
//#######################################################
// 1000 mbps leads to 1 spn (eg: taiwan-raspberry)
// >1000 mbps leads to 2 spns (eg: taiwan-raspberry, taiwan-larch)
// >2000 mbps leads to 3 spns and so on. (eg: taiwan-raspberry, taiwan-larch, taiwan-peng)
// The API is smart enough to generate these spn's and return to us.
// To create with qos use following example
// resource "scm_bandwidth_allocation" "example" {
// name = "taiwan"
// allocated_bandwidth = 50 # In Mbps
//
// qos = {
// enabled = true
// customized = false # Set to true if using a custom profile
// profile = "Default Profile" # Name of the QoS Profile
// guaranteed_ratio = 20 # 20% guaranteed bandwidth ratio. API seems to accept only round integers
// }
//}
// When creating, we never specify an spn_name_list. That is purely during update
var example = new BandwidthAllocation("example", BandwidthAllocationArgs.builder()
.name("taiwan")
.allocatedBandwidth(50)
.build());
}
}
resources:
########################################################
# Create
########################################################
# 1000 mbps leads to 1 spn (eg: taiwan-raspberry)
# >1000 mbps leads to 2 spns (eg: taiwan-raspberry, taiwan-larch)
# >2000 mbps leads to 3 spns and so on. (eg: taiwan-raspberry, taiwan-larch, taiwan-peng)
# The API is smart enough to generate these spn's and return to us.
# To create with qos use following example
# resource "scm_bandwidth_allocation" "example" {
# name = "taiwan"
# allocated_bandwidth = 50 # In Mbps
#
# qos = {
# enabled = true
# customized = false # Set to true if using a custom profile
# profile = "Default Profile" # Name of the QoS Profile
# guaranteed_ratio = 20 # 20% guaranteed bandwidth ratio. API seems to accept only round integers
# }
#}
# When creating, we never specify an spn_name_list. That is purely during update
example:
type: scm:BandwidthAllocation
properties:
name: taiwan
allocatedBandwidth: 50 # In Mbps
Create BandwidthAllocation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BandwidthAllocation(name: string, args: BandwidthAllocationArgs, opts?: CustomResourceOptions);@overload
def BandwidthAllocation(resource_name: str,
args: BandwidthAllocationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BandwidthAllocation(resource_name: str,
opts: Optional[ResourceOptions] = None,
allocated_bandwidth: Optional[int] = None,
name: Optional[str] = None,
qos: Optional[BandwidthAllocationQosArgs] = None,
spn_name_lists: Optional[Sequence[str]] = None)func NewBandwidthAllocation(ctx *Context, name string, args BandwidthAllocationArgs, opts ...ResourceOption) (*BandwidthAllocation, error)public BandwidthAllocation(string name, BandwidthAllocationArgs args, CustomResourceOptions? opts = null)
public BandwidthAllocation(String name, BandwidthAllocationArgs args)
public BandwidthAllocation(String name, BandwidthAllocationArgs args, CustomResourceOptions options)
type: scm:BandwidthAllocation
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 BandwidthAllocationArgs
- 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 BandwidthAllocationArgs
- 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 BandwidthAllocationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BandwidthAllocationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BandwidthAllocationArgs
- 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 bandwidthAllocationResource = new Scm.BandwidthAllocation("bandwidthAllocationResource", new()
{
AllocatedBandwidth = 0,
Name = "string",
Qos = new Scm.Inputs.BandwidthAllocationQosArgs
{
Customized = false,
Enabled = false,
GuaranteedRatio = 0,
Profile = "string",
},
SpnNameLists = new[]
{
"string",
},
});
example, err := scm.NewBandwidthAllocation(ctx, "bandwidthAllocationResource", &scm.BandwidthAllocationArgs{
AllocatedBandwidth: pulumi.Int(0),
Name: pulumi.String("string"),
Qos: &scm.BandwidthAllocationQosArgs{
Customized: pulumi.Bool(false),
Enabled: pulumi.Bool(false),
GuaranteedRatio: pulumi.Float64(0),
Profile: pulumi.String("string"),
},
SpnNameLists: pulumi.StringArray{
pulumi.String("string"),
},
})
var bandwidthAllocationResource = new BandwidthAllocation("bandwidthAllocationResource", BandwidthAllocationArgs.builder()
.allocatedBandwidth(0)
.name("string")
.qos(BandwidthAllocationQosArgs.builder()
.customized(false)
.enabled(false)
.guaranteedRatio(0.0)
.profile("string")
.build())
.spnNameLists("string")
.build());
bandwidth_allocation_resource = scm.BandwidthAllocation("bandwidthAllocationResource",
allocated_bandwidth=0,
name="string",
qos={
"customized": False,
"enabled": False,
"guaranteed_ratio": 0,
"profile": "string",
},
spn_name_lists=["string"])
const bandwidthAllocationResource = new scm.BandwidthAllocation("bandwidthAllocationResource", {
allocatedBandwidth: 0,
name: "string",
qos: {
customized: false,
enabled: false,
guaranteedRatio: 0,
profile: "string",
},
spnNameLists: ["string"],
});
type: scm:BandwidthAllocation
properties:
allocatedBandwidth: 0
name: string
qos:
customized: false
enabled: false
guaranteedRatio: 0
profile: string
spnNameLists:
- string
BandwidthAllocation 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 BandwidthAllocation resource accepts the following input properties:
- Allocated
Bandwidth int - bandwidth to allocate in Mbps
- Name string
- name of the aggregated bandwidth region
- Qos
Bandwidth
Allocation Qos - Qos
- Spn
Name List<string>Lists - Spn name list
- Allocated
Bandwidth int - bandwidth to allocate in Mbps
- Name string
- name of the aggregated bandwidth region
- Qos
Bandwidth
Allocation Qos Args - Qos
- Spn
Name []stringLists - Spn name list
- allocated
Bandwidth Integer - bandwidth to allocate in Mbps
- name String
- name of the aggregated bandwidth region
- qos
Bandwidth
Allocation Qos - Qos
- spn
Name List<String>Lists - Spn name list
- allocated
Bandwidth number - bandwidth to allocate in Mbps
- name string
- name of the aggregated bandwidth region
- qos
Bandwidth
Allocation Qos - Qos
- spn
Name string[]Lists - Spn name list
- allocated_
bandwidth int - bandwidth to allocate in Mbps
- name str
- name of the aggregated bandwidth region
- qos
Bandwidth
Allocation Qos Args - Qos
- spn_
name_ Sequence[str]lists - Spn name list
- allocated
Bandwidth Number - bandwidth to allocate in Mbps
- name String
- name of the aggregated bandwidth region
- qos Property Map
- Qos
- spn
Name List<String>Lists - Spn name list
Outputs
All input properties are implicitly available as output properties. Additionally, the BandwidthAllocation resource produces the following output properties:
Look up Existing BandwidthAllocation Resource
Get an existing BandwidthAllocation 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?: BandwidthAllocationState, opts?: CustomResourceOptions): BandwidthAllocation@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
allocated_bandwidth: Optional[int] = None,
name: Optional[str] = None,
qos: Optional[BandwidthAllocationQosArgs] = None,
spn_name_lists: Optional[Sequence[str]] = None,
tfid: Optional[str] = None) -> BandwidthAllocationfunc GetBandwidthAllocation(ctx *Context, name string, id IDInput, state *BandwidthAllocationState, opts ...ResourceOption) (*BandwidthAllocation, error)public static BandwidthAllocation Get(string name, Input<string> id, BandwidthAllocationState? state, CustomResourceOptions? opts = null)public static BandwidthAllocation get(String name, Output<String> id, BandwidthAllocationState state, CustomResourceOptions options)resources: _: type: scm:BandwidthAllocation get: id: ${id}- 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.
- Allocated
Bandwidth int - bandwidth to allocate in Mbps
- Name string
- name of the aggregated bandwidth region
- Qos
Bandwidth
Allocation Qos - Qos
- Spn
Name List<string>Lists - Spn name list
- Tfid string
- Allocated
Bandwidth int - bandwidth to allocate in Mbps
- Name string
- name of the aggregated bandwidth region
- Qos
Bandwidth
Allocation Qos Args - Qos
- Spn
Name []stringLists - Spn name list
- Tfid string
- allocated
Bandwidth Integer - bandwidth to allocate in Mbps
- name String
- name of the aggregated bandwidth region
- qos
Bandwidth
Allocation Qos - Qos
- spn
Name List<String>Lists - Spn name list
- tfid String
- allocated
Bandwidth number - bandwidth to allocate in Mbps
- name string
- name of the aggregated bandwidth region
- qos
Bandwidth
Allocation Qos - Qos
- spn
Name string[]Lists - Spn name list
- tfid string
- allocated_
bandwidth int - bandwidth to allocate in Mbps
- name str
- name of the aggregated bandwidth region
- qos
Bandwidth
Allocation Qos Args - Qos
- spn_
name_ Sequence[str]lists - Spn name list
- tfid str
- allocated
Bandwidth Number - bandwidth to allocate in Mbps
- name String
- name of the aggregated bandwidth region
- qos Property Map
- Qos
- spn
Name List<String>Lists - Spn name list
- tfid String
Supporting Types
BandwidthAllocationQos, BandwidthAllocationQosArgs
- Customized bool
- Customized
- Enabled bool
- Enabled
- Guaranteed
Ratio double - Guaranteed ratio
- Profile string
- Profile
- Customized bool
- Customized
- Enabled bool
- Enabled
- Guaranteed
Ratio float64 - Guaranteed ratio
- Profile string
- Profile
- customized Boolean
- Customized
- enabled Boolean
- Enabled
- guaranteed
Ratio Double - Guaranteed ratio
- profile String
- Profile
- customized boolean
- Customized
- enabled boolean
- Enabled
- guaranteed
Ratio number - Guaranteed ratio
- profile string
- Profile
- customized bool
- Customized
- enabled bool
- Enabled
- guaranteed_
ratio float - Guaranteed ratio
- profile str
- Profile
- customized Boolean
- Customized
- enabled Boolean
- Enabled
- guaranteed
Ratio Number - Guaranteed ratio
- profile String
- Profile
Import
The following command can be used to import a resource not managed by Terraform:
bash
$ pulumi import scm:index/bandwidthAllocation:BandwidthAllocation example <name_value_of_the_resource>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- scm pulumi/pulumi-scm
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scmTerraform Provider.
