UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

288 lines (287 loc) 11.4 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages a **Shared** Bandwidth resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const bandwidth1 = new huaweicloud.Vpc.Bandwidth("bandwidth_1", { * size: 5, * }); * ``` * * ## Import * * Shared Bandwidths can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Vpc/bandwidth:Bandwidth bandwidth_1 7117d38e-4c8f-4624-a505-bd96b97d024c * ``` * * Note that the imported state may not be identical to your resource definition, due to payment attributes missing from the API response. The missing attributes include`period_unit`, `period`, `auto_renew`. It is generally recommended running `terraform plan` after importing a Shared Bandwidth. You can ignore changes as below. hcl resource "huaweicloud_vpc_bandwidth" "bandwidth_1" { * * ... * * lifecycle { * * ignore_changes = [ * * period_unit, period, auto_renew, * * ] * * } } */ export declare class Bandwidth extends pulumi.CustomResource { /** * Get an existing Bandwidth resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BandwidthState, opts?: pulumi.CustomResourceOptions): Bandwidth; /** * Returns true if the given object is an instance of Bandwidth. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Bandwidth; /** * Specifies whether auto renew is enabled. * Valid values are **true** and **false**. Defaults to **false**. */ readonly autoRenew: pulumi.Output<string | undefined>; /** * Specifies the bandwidth type. * Valid values are **share** and **edgeshare**. Default is **share**. */ readonly bandwidthType: pulumi.Output<string>; /** * Specifies whether the billing is based on bandwidth or * 95th percentile bandwidth (enhanced). Possible values can be **bandwidth** and **95peak_plus**. * The default value is **bandwidth**, and **95peak_plus** is only valid for v4 and v5 Customer. */ readonly chargeMode: pulumi.Output<string>; /** * Specifies the charging mode of the Shared Bandwidth. * The valid values are **prePaid** and **postPaid**, defaults to **postPaid**. */ readonly chargingMode: pulumi.Output<string>; /** * Indicates the bandwidth create time. */ readonly createdAt: pulumi.Output<string>; /** * Specifies the enterprise project id of the Shared Bandwidth. * Changing this creates a new bandwidth. */ readonly enterpriseProjectId: pulumi.Output<string>; /** * Specifies the bandwidth name. The value is a string of 1 to 64 characters that * can contain letters, digits, underscores (_), hyphens (-), and periods (.). */ readonly name: pulumi.Output<string>; /** * Specifies the charging period of the Shared Bandwidth. * + If `periodUnit` is set to **month**, the value ranges from `1` to `9`. * + If `periodUnit` is set to **year**, the value ranges from `1` to `3`. */ readonly period: pulumi.Output<number | undefined>; /** * Specifies the charging period unit of the Shared Bandwidth. * Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**. */ readonly periodUnit: pulumi.Output<string | undefined>; /** * Specifies the site is center of border. * Valid values are **center** and the name of the border site. Default is **center**. */ readonly publicBorderGroup: pulumi.Output<string>; /** * An array of EIPs that use the bandwidth. The object includes the following: */ readonly publicips: pulumi.Output<outputs.Vpc.BandwidthPublicip[]>; /** * Specifies the region in which to create the Shared Bandwidth. * If omitted, the provider-level region will be used. Changing this creates a new bandwidth. */ readonly region: pulumi.Output<string>; /** * Indicates whether the bandwidth is shared or dedicated. */ readonly shareType: pulumi.Output<string>; /** * Specifies the size of the Shared Bandwidth. * If `chargeMode` is **bandwidth**, the value ranges from 5 Mbit/s to 2000 Mbit/s. * If `chargeMode` is **95peak_plus**, the value ranges from 300 Mbit/s to 2000 Mbit/s. */ readonly size: pulumi.Output<number>; /** * Indicates the bandwidth status. */ readonly status: pulumi.Output<string>; /** * Indicates the bandwidth update time. */ readonly updatedAt: pulumi.Output<string>; /** * Create a Bandwidth resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: BandwidthArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Bandwidth resources. */ export interface BandwidthState { /** * Specifies whether auto renew is enabled. * Valid values are **true** and **false**. Defaults to **false**. */ autoRenew?: pulumi.Input<string>; /** * Specifies the bandwidth type. * Valid values are **share** and **edgeshare**. Default is **share**. */ bandwidthType?: pulumi.Input<string>; /** * Specifies whether the billing is based on bandwidth or * 95th percentile bandwidth (enhanced). Possible values can be **bandwidth** and **95peak_plus**. * The default value is **bandwidth**, and **95peak_plus** is only valid for v4 and v5 Customer. */ chargeMode?: pulumi.Input<string>; /** * Specifies the charging mode of the Shared Bandwidth. * The valid values are **prePaid** and **postPaid**, defaults to **postPaid**. */ chargingMode?: pulumi.Input<string>; /** * Indicates the bandwidth create time. */ createdAt?: pulumi.Input<string>; /** * Specifies the enterprise project id of the Shared Bandwidth. * Changing this creates a new bandwidth. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the bandwidth name. The value is a string of 1 to 64 characters that * can contain letters, digits, underscores (_), hyphens (-), and periods (.). */ name?: pulumi.Input<string>; /** * Specifies the charging period of the Shared Bandwidth. * + If `periodUnit` is set to **month**, the value ranges from `1` to `9`. * + If `periodUnit` is set to **year**, the value ranges from `1` to `3`. */ period?: pulumi.Input<number>; /** * Specifies the charging period unit of the Shared Bandwidth. * Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**. */ periodUnit?: pulumi.Input<string>; /** * Specifies the site is center of border. * Valid values are **center** and the name of the border site. Default is **center**. */ publicBorderGroup?: pulumi.Input<string>; /** * An array of EIPs that use the bandwidth. The object includes the following: */ publicips?: pulumi.Input<pulumi.Input<inputs.Vpc.BandwidthPublicip>[]>; /** * Specifies the region in which to create the Shared Bandwidth. * If omitted, the provider-level region will be used. Changing this creates a new bandwidth. */ region?: pulumi.Input<string>; /** * Indicates whether the bandwidth is shared or dedicated. */ shareType?: pulumi.Input<string>; /** * Specifies the size of the Shared Bandwidth. * If `chargeMode` is **bandwidth**, the value ranges from 5 Mbit/s to 2000 Mbit/s. * If `chargeMode` is **95peak_plus**, the value ranges from 300 Mbit/s to 2000 Mbit/s. */ size?: pulumi.Input<number>; /** * Indicates the bandwidth status. */ status?: pulumi.Input<string>; /** * Indicates the bandwidth update time. */ updatedAt?: pulumi.Input<string>; } /** * The set of arguments for constructing a Bandwidth resource. */ export interface BandwidthArgs { /** * Specifies whether auto renew is enabled. * Valid values are **true** and **false**. Defaults to **false**. */ autoRenew?: pulumi.Input<string>; /** * Specifies the bandwidth type. * Valid values are **share** and **edgeshare**. Default is **share**. */ bandwidthType?: pulumi.Input<string>; /** * Specifies whether the billing is based on bandwidth or * 95th percentile bandwidth (enhanced). Possible values can be **bandwidth** and **95peak_plus**. * The default value is **bandwidth**, and **95peak_plus** is only valid for v4 and v5 Customer. */ chargeMode?: pulumi.Input<string>; /** * Specifies the charging mode of the Shared Bandwidth. * The valid values are **prePaid** and **postPaid**, defaults to **postPaid**. */ chargingMode?: pulumi.Input<string>; /** * Specifies the enterprise project id of the Shared Bandwidth. * Changing this creates a new bandwidth. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the bandwidth name. The value is a string of 1 to 64 characters that * can contain letters, digits, underscores (_), hyphens (-), and periods (.). */ name?: pulumi.Input<string>; /** * Specifies the charging period of the Shared Bandwidth. * + If `periodUnit` is set to **month**, the value ranges from `1` to `9`. * + If `periodUnit` is set to **year**, the value ranges from `1` to `3`. */ period?: pulumi.Input<number>; /** * Specifies the charging period unit of the Shared Bandwidth. * Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**. */ periodUnit?: pulumi.Input<string>; /** * Specifies the site is center of border. * Valid values are **center** and the name of the border site. Default is **center**. */ publicBorderGroup?: pulumi.Input<string>; /** * Specifies the region in which to create the Shared Bandwidth. * If omitted, the provider-level region will be used. Changing this creates a new bandwidth. */ region?: pulumi.Input<string>; /** * Specifies the size of the Shared Bandwidth. * If `chargeMode` is **bandwidth**, the value ranges from 5 Mbit/s to 2000 Mbit/s. * If `chargeMode` is **95peak_plus**, the value ranges from 300 Mbit/s to 2000 Mbit/s. */ size: pulumi.Input<number>; }