1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. quotas
  5. QuotaAlarm
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.quotas.QuotaAlarm

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    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=[alicloud.quotas.QuotaAlarmQuotaDimensionArgs(
            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", &quotas.QuotaAlarmArgs{
    			QuotaActionCode: pulumi.String("q_desktop-count"),
    			QuotaDimensions: quotas.QuotaAlarmQuotaDimensionArray{
    				&quotas.QuotaAlarmQuotaDimensionArgs{
    					Key:   pulumi.String("regionId"),
    					Value: pulumi.String("cn-hangzhou"),
    				},
    			},
    			ThresholdPercent: pulumi.Float64(80),
    			ProductCode:      pulumi.String("gws"),
    			QuotaAlarmName:   pulumi.String(fmt.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", &quotas.QuotaAlarmArgs{
    	ProductCode:     pulumi.String("string"),
    	QuotaActionCode: pulumi.String("string"),
    	QuotaAlarmName:  pulumi.String("string"),
    	QuotaDimensions: quotas.QuotaAlarmQuotaDimensionArray{
    		&quotas.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=[alicloud.quotas.QuotaAlarmQuotaDimensionArgs(
            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

    The QuotaAlarm resource accepts the following input properties:

    ProductCode string
    The Product Code.
    QuotaActionCode string
    The Quota Action Code.
    QuotaAlarmName string
    The name of Quota Alarm.
    QuotaDimensions List<Pulumi.AliCloud.Quotas.Inputs.QuotaAlarmQuotaDimension>
    The Quota Dimensions. See quota_dimensions below.
    Threshold double
    The threshold of Quota Alarm.
    ThresholdPercent double
    The threshold percent of Quota Alarm.
    ThresholdType string
    Quota alarm type. Value:

    • used: Quota used alarm.
    • usable: alarm for the remaining available quota.
    WebHook string
    The WebHook of Quota Alarm.
    ProductCode string
    The Product Code.
    QuotaActionCode string
    The Quota Action Code.
    QuotaAlarmName string
    The name of Quota Alarm.
    QuotaDimensions []QuotaAlarmQuotaDimensionArgs
    The Quota Dimensions. See quota_dimensions below.
    Threshold float64
    The threshold of Quota Alarm.
    ThresholdPercent float64
    The threshold percent of Quota Alarm.
    ThresholdType string
    Quota alarm type. Value:

    • used: Quota used alarm.
    • usable: alarm for the remaining available quota.
    WebHook string
    The WebHook of Quota Alarm.
    productCode String
    The Product Code.
    quotaActionCode String
    The Quota Action Code.
    quotaAlarmName String
    The name of Quota Alarm.
    quotaDimensions List<QuotaAlarmQuotaDimension>
    The Quota Dimensions. See quota_dimensions below.
    threshold Double
    The threshold of Quota Alarm.
    thresholdPercent Double
    The threshold percent of Quota Alarm.
    thresholdType String
    Quota alarm type. Value:

    • used: Quota used alarm.
    • usable: alarm for the remaining available quota.
    webHook String
    The WebHook of Quota Alarm.
    productCode string
    The Product Code.
    quotaActionCode string
    The Quota Action Code.
    quotaAlarmName string
    The name of Quota Alarm.
    quotaDimensions QuotaAlarmQuotaDimension[]
    The Quota Dimensions. See quota_dimensions below.
    threshold number
    The threshold of Quota Alarm.
    thresholdPercent number
    The threshold percent of Quota Alarm.
    thresholdType string
    Quota alarm type. Value:

    • used: Quota used alarm.
    • usable: alarm for the remaining available quota.
    webHook string
    The WebHook of Quota Alarm.
    product_code str
    The Product Code.
    quota_action_code str
    The Quota Action Code.
    quota_alarm_name str
    The name of Quota Alarm.
    quota_dimensions Sequence[QuotaAlarmQuotaDimensionArgs]
    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.
    productCode String
    The Product Code.
    quotaActionCode String
    The Quota Action Code.
    quotaAlarmName String
    The name of Quota Alarm.
    quotaDimensions List<Property Map>
    The Quota Dimensions. See quota_dimensions below.
    threshold Number
    The threshold of Quota Alarm.
    thresholdPercent Number
    The threshold percent of Quota Alarm.
    thresholdType String
    Quota alarm type. Value:

    • used: Quota used alarm.
    • usable: alarm for the remaining available quota.
    webHook 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:

    CreateTime string
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    CreateTime string
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    createTime String
    The creation time of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    createTime 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.
    createTime 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.
    The following state arguments are supported:
    CreateTime string
    The creation time of the resource.
    ProductCode string
    The Product Code.
    QuotaActionCode string
    The Quota Action Code.
    QuotaAlarmName string
    The name of Quota Alarm.
    QuotaDimensions List<Pulumi.AliCloud.Quotas.Inputs.QuotaAlarmQuotaDimension>
    The Quota Dimensions. See quota_dimensions below.
    Threshold double
    The threshold of Quota Alarm.
    ThresholdPercent double
    The threshold percent of Quota Alarm.
    ThresholdType string
    Quota alarm type. Value:

    • used: Quota used alarm.
    • usable: alarm for the remaining available quota.
    WebHook string
    The WebHook of Quota Alarm.
    CreateTime string
    The creation time of the resource.
    ProductCode string
    The Product Code.
    QuotaActionCode string
    The Quota Action Code.
    QuotaAlarmName string
    The name of Quota Alarm.
    QuotaDimensions []QuotaAlarmQuotaDimensionArgs
    The Quota Dimensions. See quota_dimensions below.
    Threshold float64
    The threshold of Quota Alarm.
    ThresholdPercent float64
    The threshold percent of Quota Alarm.
    ThresholdType string
    Quota alarm type. Value:

    • used: Quota used alarm.
    • usable: alarm for the remaining available quota.
    WebHook string
    The WebHook of Quota Alarm.
    createTime String
    The creation time of the resource.
    productCode String
    The Product Code.
    quotaActionCode String
    The Quota Action Code.
    quotaAlarmName String
    The name of Quota Alarm.
    quotaDimensions List<QuotaAlarmQuotaDimension>
    The Quota Dimensions. See quota_dimensions below.
    threshold Double
    The threshold of Quota Alarm.
    thresholdPercent Double
    The threshold percent of Quota Alarm.
    thresholdType String
    Quota alarm type. Value:

    • used: Quota used alarm.
    • usable: alarm for the remaining available quota.
    webHook String
    The WebHook of Quota Alarm.
    createTime string
    The creation time of the resource.
    productCode string
    The Product Code.
    quotaActionCode string
    The Quota Action Code.
    quotaAlarmName string
    The name of Quota Alarm.
    quotaDimensions QuotaAlarmQuotaDimension[]
    The Quota Dimensions. See quota_dimensions below.
    threshold number
    The threshold of Quota Alarm.
    thresholdPercent number
    The threshold percent of Quota Alarm.
    thresholdType string
    Quota alarm type. Value:

    • used: Quota used alarm.
    • usable: alarm for the remaining available quota.
    webHook string
    The WebHook of Quota Alarm.
    create_time str
    The creation time of the resource.
    product_code str
    The Product Code.
    quota_action_code str
    The Quota Action Code.
    quota_alarm_name str
    The name of Quota Alarm.
    quota_dimensions Sequence[QuotaAlarmQuotaDimensionArgs]
    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.
    createTime String
    The creation time of the resource.
    productCode String
    The Product Code.
    quotaActionCode String
    The Quota Action Code.
    quotaAlarmName String
    The name of Quota Alarm.
    quotaDimensions List<Property Map>
    The Quota Dimensions. See quota_dimensions below.
    threshold Number
    The threshold of Quota Alarm.
    thresholdPercent Number
    The threshold percent of Quota Alarm.
    thresholdType String
    Quota alarm type. Value:

    • used: Quota used alarm.
    • usable: alarm for the remaining available quota.
    webHook String
    The WebHook of Quota Alarm.

    Supporting Types

    QuotaAlarmQuotaDimension, QuotaAlarmQuotaDimensionArgs

    Key string
    The Key of quota_dimensions.
    Value string
    The Value of quota_dimensions.
    Key string
    The Key of quota_dimensions.
    Value string
    The Value of quota_dimensions.
    key String
    The Key of quota_dimensions.
    value String
    The Value of quota_dimensions.
    key string
    The Key of quota_dimensions.
    value string
    The Value of quota_dimensions.
    key str
    The Key of quota_dimensions.
    value str
    The Value of quota_dimensions.
    key String
    The Key of quota_dimensions.
    value String
    The Value of quota_dimensions.

    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.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi