alicloud.quotas.QuotaAlarm
Explore with Pulumi AI
Provides a Quotas Quota Alarm resource.
For information about Quotas Quota Alarm and how to use it, see What is Quota Alarm.
NOTE: Available since v1.116.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new random.index.Integer("default", {
min: 10000,
max: 99999,
});
const defaultQuotaAlarm = new alicloud.quotas.QuotaAlarm("default", {
quotaActionCode: "q_desktop-count",
quotaDimensions: [{
key: "regionId",
value: "cn-hangzhou",
}],
thresholdPercent: 80,
productCode: "gws",
quotaAlarmName: `${name}-${_default.result}`,
thresholdType: "used",
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = random.index.Integer("default",
min=10000,
max=99999)
default_quota_alarm = alicloud.quotas.QuotaAlarm("default",
quota_action_code="q_desktop-count",
quota_dimensions=[{
"key": "regionId",
"value": "cn-hangzhou",
}],
threshold_percent=80,
product_code="gws",
quota_alarm_name=f"{name}-{default['result']}",
threshold_type="used")
package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/quotas"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Min: 10000,
Max: 99999,
})
if err != nil {
return err
}
_, err = quotas.NewQuotaAlarm(ctx, "default", "as.QuotaAlarmArgs{
QuotaActionCode: pulumi.String("q_desktop-count"),
QuotaDimensions: quotas.QuotaAlarmQuotaDimensionArray{
"as.QuotaAlarmQuotaDimensionArgs{
Key: pulumi.String("regionId"),
Value: pulumi.String("cn-hangzhou"),
},
},
ThresholdPercent: pulumi.Float64(80),
ProductCode: pulumi.String("gws"),
QuotaAlarmName: pulumi.Sprintf("%v-%v", name, _default.Result),
ThresholdType: pulumi.String("used"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = new Random.Index.Integer("default", new()
{
Min = 10000,
Max = 99999,
});
var defaultQuotaAlarm = new AliCloud.Quotas.QuotaAlarm("default", new()
{
QuotaActionCode = "q_desktop-count",
QuotaDimensions = new[]
{
new AliCloud.Quotas.Inputs.QuotaAlarmQuotaDimensionArgs
{
Key = "regionId",
Value = "cn-hangzhou",
},
},
ThresholdPercent = 80,
ProductCode = "gws",
QuotaAlarmName = $"{name}-{@default.Result}",
ThresholdType = "used",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.IntegerArgs;
import com.pulumi.alicloud.quotas.QuotaAlarm;
import com.pulumi.alicloud.quotas.QuotaAlarmArgs;
import com.pulumi.alicloud.quotas.inputs.QuotaAlarmQuotaDimensionArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var default_ = new Integer("default", IntegerArgs.builder()
.min(10000)
.max(99999)
.build());
var defaultQuotaAlarm = new QuotaAlarm("defaultQuotaAlarm", QuotaAlarmArgs.builder()
.quotaActionCode("q_desktop-count")
.quotaDimensions(QuotaAlarmQuotaDimensionArgs.builder()
.key("regionId")
.value("cn-hangzhou")
.build())
.thresholdPercent(80)
.productCode("gws")
.quotaAlarmName(String.format("%s-%s", name,default_.result()))
.thresholdType("used")
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: random:integer
properties:
min: 10000
max: 99999
defaultQuotaAlarm:
type: alicloud:quotas:QuotaAlarm
name: default
properties:
quotaActionCode: q_desktop-count
quotaDimensions:
- key: regionId
value: cn-hangzhou
thresholdPercent: 80
productCode: gws
quotaAlarmName: ${name}-${default.result}
thresholdType: used
Create QuotaAlarm Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new QuotaAlarm(name: string, args: QuotaAlarmArgs, opts?: CustomResourceOptions);
@overload
def QuotaAlarm(resource_name: str,
args: QuotaAlarmArgs,
opts: Optional[ResourceOptions] = None)
@overload
def QuotaAlarm(resource_name: str,
opts: Optional[ResourceOptions] = None,
product_code: Optional[str] = None,
quota_action_code: Optional[str] = None,
quota_alarm_name: Optional[str] = None,
quota_dimensions: Optional[Sequence[QuotaAlarmQuotaDimensionArgs]] = None,
threshold: Optional[float] = None,
threshold_percent: Optional[float] = None,
threshold_type: Optional[str] = None,
web_hook: Optional[str] = None)
func NewQuotaAlarm(ctx *Context, name string, args QuotaAlarmArgs, opts ...ResourceOption) (*QuotaAlarm, error)
public QuotaAlarm(string name, QuotaAlarmArgs args, CustomResourceOptions? opts = null)
public QuotaAlarm(String name, QuotaAlarmArgs args)
public QuotaAlarm(String name, QuotaAlarmArgs args, CustomResourceOptions options)
type: alicloud:quotas:QuotaAlarm
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 QuotaAlarmArgs
- 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 QuotaAlarmArgs
- 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 QuotaAlarmArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args QuotaAlarmArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args QuotaAlarmArgs
- 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 quotaAlarmResource = new AliCloud.Quotas.QuotaAlarm("quotaAlarmResource", new()
{
ProductCode = "string",
QuotaActionCode = "string",
QuotaAlarmName = "string",
QuotaDimensions = new[]
{
new AliCloud.Quotas.Inputs.QuotaAlarmQuotaDimensionArgs
{
Key = "string",
Value = "string",
},
},
Threshold = 0,
ThresholdPercent = 0,
ThresholdType = "string",
WebHook = "string",
});
example, err := quotas.NewQuotaAlarm(ctx, "quotaAlarmResource", "as.QuotaAlarmArgs{
ProductCode: pulumi.String("string"),
QuotaActionCode: pulumi.String("string"),
QuotaAlarmName: pulumi.String("string"),
QuotaDimensions: quotas.QuotaAlarmQuotaDimensionArray{
"as.QuotaAlarmQuotaDimensionArgs{
Key: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
Threshold: pulumi.Float64(0),
ThresholdPercent: pulumi.Float64(0),
ThresholdType: pulumi.String("string"),
WebHook: pulumi.String("string"),
})
var quotaAlarmResource = new QuotaAlarm("quotaAlarmResource", QuotaAlarmArgs.builder()
.productCode("string")
.quotaActionCode("string")
.quotaAlarmName("string")
.quotaDimensions(QuotaAlarmQuotaDimensionArgs.builder()
.key("string")
.value("string")
.build())
.threshold(0)
.thresholdPercent(0)
.thresholdType("string")
.webHook("string")
.build());
quota_alarm_resource = alicloud.quotas.QuotaAlarm("quotaAlarmResource",
product_code="string",
quota_action_code="string",
quota_alarm_name="string",
quota_dimensions=[{
"key": "string",
"value": "string",
}],
threshold=0,
threshold_percent=0,
threshold_type="string",
web_hook="string")
const quotaAlarmResource = new alicloud.quotas.QuotaAlarm("quotaAlarmResource", {
productCode: "string",
quotaActionCode: "string",
quotaAlarmName: "string",
quotaDimensions: [{
key: "string",
value: "string",
}],
threshold: 0,
thresholdPercent: 0,
thresholdType: "string",
webHook: "string",
});
type: alicloud:quotas:QuotaAlarm
properties:
productCode: string
quotaActionCode: string
quotaAlarmName: string
quotaDimensions:
- key: string
value: string
threshold: 0
thresholdPercent: 0
thresholdType: string
webHook: string
QuotaAlarm 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 QuotaAlarm resource accepts the following input properties:
- Product
Code string - The Product Code.
- Quota
Action stringCode - The Quota Action Code.
- Quota
Alarm stringName - The name of Quota Alarm.
- Quota
Dimensions List<Pulumi.Ali Cloud. Quotas. Inputs. Quota Alarm Quota Dimension> - The Quota Dimensions. See
quota_dimensions
below. - Threshold double
- The threshold of Quota Alarm.
- Threshold
Percent double - The threshold percent of Quota Alarm.
- Threshold
Type string - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- Web
Hook string - The WebHook of Quota Alarm.
- Product
Code string - The Product Code.
- Quota
Action stringCode - The Quota Action Code.
- Quota
Alarm stringName - The name of Quota Alarm.
- Quota
Dimensions []QuotaAlarm Quota Dimension Args - The Quota Dimensions. See
quota_dimensions
below. - Threshold float64
- The threshold of Quota Alarm.
- Threshold
Percent float64 - The threshold percent of Quota Alarm.
- Threshold
Type string - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- Web
Hook string - The WebHook of Quota Alarm.
- product
Code String - The Product Code.
- quota
Action StringCode - The Quota Action Code.
- quota
Alarm StringName - The name of Quota Alarm.
- quota
Dimensions List<QuotaAlarm Quota Dimension> - The Quota Dimensions. See
quota_dimensions
below. - threshold Double
- The threshold of Quota Alarm.
- threshold
Percent Double - The threshold percent of Quota Alarm.
- threshold
Type String - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- web
Hook String - The WebHook of Quota Alarm.
- product
Code string - The Product Code.
- quota
Action stringCode - The Quota Action Code.
- quota
Alarm stringName - The name of Quota Alarm.
- quota
Dimensions QuotaAlarm Quota Dimension[] - The Quota Dimensions. See
quota_dimensions
below. - threshold number
- The threshold of Quota Alarm.
- threshold
Percent number - The threshold percent of Quota Alarm.
- threshold
Type string - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- web
Hook string - The WebHook of Quota Alarm.
- product_
code str - The Product Code.
- quota_
action_ strcode - The Quota Action Code.
- quota_
alarm_ strname - The name of Quota Alarm.
- quota_
dimensions Sequence[QuotaAlarm Quota Dimension Args] - The Quota Dimensions. See
quota_dimensions
below. - threshold float
- The threshold of Quota Alarm.
- threshold_
percent float - The threshold percent of Quota Alarm.
- threshold_
type str - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- web_
hook str - The WebHook of Quota Alarm.
- product
Code String - The Product Code.
- quota
Action StringCode - The Quota Action Code.
- quota
Alarm StringName - The name of Quota Alarm.
- quota
Dimensions List<Property Map> - The Quota Dimensions. See
quota_dimensions
below. - threshold Number
- The threshold of Quota Alarm.
- threshold
Percent Number - The threshold percent of Quota Alarm.
- threshold
Type String - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- web
Hook String - The WebHook of Quota Alarm.
Outputs
All input properties are implicitly available as output properties. Additionally, the QuotaAlarm resource produces the following output properties:
- Create
Time string - The creation time of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Create
Time string - The creation time of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- create
Time String - The creation time of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- create
Time string - The creation time of the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- create_
time str - The creation time of the resource.
- id str
- The provider-assigned unique ID for this managed resource.
- create
Time String - The creation time of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing QuotaAlarm Resource
Get an existing QuotaAlarm 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?: QuotaAlarmState, opts?: CustomResourceOptions): QuotaAlarm
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
product_code: Optional[str] = None,
quota_action_code: Optional[str] = None,
quota_alarm_name: Optional[str] = None,
quota_dimensions: Optional[Sequence[QuotaAlarmQuotaDimensionArgs]] = None,
threshold: Optional[float] = None,
threshold_percent: Optional[float] = None,
threshold_type: Optional[str] = None,
web_hook: Optional[str] = None) -> QuotaAlarm
func GetQuotaAlarm(ctx *Context, name string, id IDInput, state *QuotaAlarmState, opts ...ResourceOption) (*QuotaAlarm, error)
public static QuotaAlarm Get(string name, Input<string> id, QuotaAlarmState? state, CustomResourceOptions? opts = null)
public static QuotaAlarm get(String name, Output<String> id, QuotaAlarmState 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.
- Create
Time string - The creation time of the resource.
- Product
Code string - The Product Code.
- Quota
Action stringCode - The Quota Action Code.
- Quota
Alarm stringName - The name of Quota Alarm.
- Quota
Dimensions List<Pulumi.Ali Cloud. Quotas. Inputs. Quota Alarm Quota Dimension> - The Quota Dimensions. See
quota_dimensions
below. - Threshold double
- The threshold of Quota Alarm.
- Threshold
Percent double - The threshold percent of Quota Alarm.
- Threshold
Type string - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- Web
Hook string - The WebHook of Quota Alarm.
- Create
Time string - The creation time of the resource.
- Product
Code string - The Product Code.
- Quota
Action stringCode - The Quota Action Code.
- Quota
Alarm stringName - The name of Quota Alarm.
- Quota
Dimensions []QuotaAlarm Quota Dimension Args - The Quota Dimensions. See
quota_dimensions
below. - Threshold float64
- The threshold of Quota Alarm.
- Threshold
Percent float64 - The threshold percent of Quota Alarm.
- Threshold
Type string - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- Web
Hook string - The WebHook of Quota Alarm.
- create
Time String - The creation time of the resource.
- product
Code String - The Product Code.
- quota
Action StringCode - The Quota Action Code.
- quota
Alarm StringName - The name of Quota Alarm.
- quota
Dimensions List<QuotaAlarm Quota Dimension> - The Quota Dimensions. See
quota_dimensions
below. - threshold Double
- The threshold of Quota Alarm.
- threshold
Percent Double - The threshold percent of Quota Alarm.
- threshold
Type String - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- web
Hook String - The WebHook of Quota Alarm.
- create
Time string - The creation time of the resource.
- product
Code string - The Product Code.
- quota
Action stringCode - The Quota Action Code.
- quota
Alarm stringName - The name of Quota Alarm.
- quota
Dimensions QuotaAlarm Quota Dimension[] - The Quota Dimensions. See
quota_dimensions
below. - threshold number
- The threshold of Quota Alarm.
- threshold
Percent number - The threshold percent of Quota Alarm.
- threshold
Type string - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- web
Hook string - The WebHook of Quota Alarm.
- create_
time str - The creation time of the resource.
- product_
code str - The Product Code.
- quota_
action_ strcode - The Quota Action Code.
- quota_
alarm_ strname - The name of Quota Alarm.
- quota_
dimensions Sequence[QuotaAlarm Quota Dimension Args] - The Quota Dimensions. See
quota_dimensions
below. - threshold float
- The threshold of Quota Alarm.
- threshold_
percent float - The threshold percent of Quota Alarm.
- threshold_
type str - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- web_
hook str - The WebHook of Quota Alarm.
- create
Time String - The creation time of the resource.
- product
Code String - The Product Code.
- quota
Action StringCode - The Quota Action Code.
- quota
Alarm StringName - The name of Quota Alarm.
- quota
Dimensions List<Property Map> - The Quota Dimensions. See
quota_dimensions
below. - threshold Number
- The threshold of Quota Alarm.
- threshold
Percent Number - The threshold percent of Quota Alarm.
- threshold
Type String - Quota alarm type. Value:
- used: Quota used alarm.
- usable: alarm for the remaining available quota.
- web
Hook String - The WebHook of Quota Alarm.
Supporting Types
QuotaAlarmQuotaDimension, QuotaAlarmQuotaDimensionArgs
Import
Quotas Quota Alarm can be imported using the id, e.g.
$ pulumi import alicloud:quotas/quotaAlarm:QuotaAlarm example <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.