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

alicloud.quotas.TemplateQuota

Explore with Pulumi AI

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

    Provides a Quotas Template Quota resource.

    For information about Quotas Template Quota and how to use it, see What is Template Quota.

    NOTE: Available since v1.206.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = new alicloud.quotas.TemplateQuota("default", {
        quotaActionCode: "q_desktop-count",
        productCode: "gws",
        noticeType: 3,
        dimensions: [{
            key: "regionId",
            value: "cn-hangzhou",
        }],
        desireValue: 1001,
        envLanguage: "zh",
        quotaCategory: "CommonQuota",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.quotas.TemplateQuota("default",
        quota_action_code="q_desktop-count",
        product_code="gws",
        notice_type=3,
        dimensions=[alicloud.quotas.TemplateQuotaDimensionArgs(
            key="regionId",
            value="cn-hangzhou",
        )],
        desire_value=1001,
        env_language="zh",
        quota_category="CommonQuota")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/quotas"
    	"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 := quotas.NewTemplateQuota(ctx, "default", &quotas.TemplateQuotaArgs{
    			QuotaActionCode: pulumi.String("q_desktop-count"),
    			ProductCode:     pulumi.String("gws"),
    			NoticeType:      pulumi.Int(3),
    			Dimensions: quotas.TemplateQuotaDimensionArray{
    				&quotas.TemplateQuotaDimensionArgs{
    					Key:   pulumi.String("regionId"),
    					Value: pulumi.String("cn-hangzhou"),
    				},
    			},
    			DesireValue:   pulumi.Float64(1001),
    			EnvLanguage:   pulumi.String("zh"),
    			QuotaCategory: pulumi.String("CommonQuota"),
    		})
    		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 config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = new AliCloud.Quotas.TemplateQuota("default", new()
        {
            QuotaActionCode = "q_desktop-count",
            ProductCode = "gws",
            NoticeType = 3,
            Dimensions = new[]
            {
                new AliCloud.Quotas.Inputs.TemplateQuotaDimensionArgs
                {
                    Key = "regionId",
                    Value = "cn-hangzhou",
                },
            },
            DesireValue = 1001,
            EnvLanguage = "zh",
            QuotaCategory = "CommonQuota",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.quotas.TemplateQuota;
    import com.pulumi.alicloud.quotas.TemplateQuotaArgs;
    import com.pulumi.alicloud.quotas.inputs.TemplateQuotaDimensionArgs;
    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 TemplateQuota("default", TemplateQuotaArgs.builder()
                .quotaActionCode("q_desktop-count")
                .productCode("gws")
                .noticeType(3)
                .dimensions(TemplateQuotaDimensionArgs.builder()
                    .key("regionId")
                    .value("cn-hangzhou")
                    .build())
                .desireValue(1001)
                .envLanguage("zh")
                .quotaCategory("CommonQuota")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:quotas:TemplateQuota
        properties:
          quotaActionCode: q_desktop-count
          productCode: gws
          noticeType: 3
          dimensions:
            - key: regionId
              value: cn-hangzhou
          desireValue: 1001
          envLanguage: zh
          quotaCategory: CommonQuota
    

    Create TemplateQuota Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new TemplateQuota(name: string, args: TemplateQuotaArgs, opts?: CustomResourceOptions);
    @overload
    def TemplateQuota(resource_name: str,
                      args: TemplateQuotaArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def TemplateQuota(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      desire_value: Optional[float] = None,
                      product_code: Optional[str] = None,
                      quota_action_code: Optional[str] = None,
                      dimensions: Optional[Sequence[TemplateQuotaDimensionArgs]] = None,
                      effective_time: Optional[str] = None,
                      env_language: Optional[str] = None,
                      expire_time: Optional[str] = None,
                      notice_type: Optional[int] = None,
                      quota_category: Optional[str] = None)
    func NewTemplateQuota(ctx *Context, name string, args TemplateQuotaArgs, opts ...ResourceOption) (*TemplateQuota, error)
    public TemplateQuota(string name, TemplateQuotaArgs args, CustomResourceOptions? opts = null)
    public TemplateQuota(String name, TemplateQuotaArgs args)
    public TemplateQuota(String name, TemplateQuotaArgs args, CustomResourceOptions options)
    
    type: alicloud:quotas:TemplateQuota
    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 TemplateQuotaArgs
    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 TemplateQuotaArgs
    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 TemplateQuotaArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TemplateQuotaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TemplateQuotaArgs
    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 templateQuotaResource = new AliCloud.Quotas.TemplateQuota("templateQuotaResource", new()
    {
        DesireValue = 0,
        ProductCode = "string",
        QuotaActionCode = "string",
        Dimensions = new[]
        {
            new AliCloud.Quotas.Inputs.TemplateQuotaDimensionArgs
            {
                Key = "string",
                Value = "string",
            },
        },
        EffectiveTime = "string",
        EnvLanguage = "string",
        ExpireTime = "string",
        NoticeType = 0,
        QuotaCategory = "string",
    });
    
    example, err := quotas.NewTemplateQuota(ctx, "templateQuotaResource", &quotas.TemplateQuotaArgs{
    	DesireValue:     pulumi.Float64(0),
    	ProductCode:     pulumi.String("string"),
    	QuotaActionCode: pulumi.String("string"),
    	Dimensions: quotas.TemplateQuotaDimensionArray{
    		&quotas.TemplateQuotaDimensionArgs{
    			Key:   pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    	EffectiveTime: pulumi.String("string"),
    	EnvLanguage:   pulumi.String("string"),
    	ExpireTime:    pulumi.String("string"),
    	NoticeType:    pulumi.Int(0),
    	QuotaCategory: pulumi.String("string"),
    })
    
    var templateQuotaResource = new TemplateQuota("templateQuotaResource", TemplateQuotaArgs.builder()
        .desireValue(0)
        .productCode("string")
        .quotaActionCode("string")
        .dimensions(TemplateQuotaDimensionArgs.builder()
            .key("string")
            .value("string")
            .build())
        .effectiveTime("string")
        .envLanguage("string")
        .expireTime("string")
        .noticeType(0)
        .quotaCategory("string")
        .build());
    
    template_quota_resource = alicloud.quotas.TemplateQuota("templateQuotaResource",
        desire_value=0,
        product_code="string",
        quota_action_code="string",
        dimensions=[alicloud.quotas.TemplateQuotaDimensionArgs(
            key="string",
            value="string",
        )],
        effective_time="string",
        env_language="string",
        expire_time="string",
        notice_type=0,
        quota_category="string")
    
    const templateQuotaResource = new alicloud.quotas.TemplateQuota("templateQuotaResource", {
        desireValue: 0,
        productCode: "string",
        quotaActionCode: "string",
        dimensions: [{
            key: "string",
            value: "string",
        }],
        effectiveTime: "string",
        envLanguage: "string",
        expireTime: "string",
        noticeType: 0,
        quotaCategory: "string",
    });
    
    type: alicloud:quotas:TemplateQuota
    properties:
        desireValue: 0
        dimensions:
            - key: string
              value: string
        effectiveTime: string
        envLanguage: string
        expireTime: string
        noticeType: 0
        productCode: string
        quotaActionCode: string
        quotaCategory: string
    

    TemplateQuota 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 TemplateQuota resource accepts the following input properties:

    DesireValue double
    Quota application value.
    ProductCode string
    The abbreviation of the cloud service name.
    QuotaActionCode string
    The quota ID.
    Dimensions List<Pulumi.AliCloud.Quotas.Inputs.TemplateQuotaDimension>
    The Quota Dimensions. See dimensions below.
    EffectiveTime string
    The UTC time when the quota takes effect.
    EnvLanguage string
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    ExpireTime string
    The UTC time when the quota expires.
    NoticeType int
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    QuotaCategory string
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.
    DesireValue float64
    Quota application value.
    ProductCode string
    The abbreviation of the cloud service name.
    QuotaActionCode string
    The quota ID.
    Dimensions []TemplateQuotaDimensionArgs
    The Quota Dimensions. See dimensions below.
    EffectiveTime string
    The UTC time when the quota takes effect.
    EnvLanguage string
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    ExpireTime string
    The UTC time when the quota expires.
    NoticeType int
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    QuotaCategory string
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.
    desireValue Double
    Quota application value.
    productCode String
    The abbreviation of the cloud service name.
    quotaActionCode String
    The quota ID.
    dimensions List<TemplateQuotaDimension>
    The Quota Dimensions. See dimensions below.
    effectiveTime String
    The UTC time when the quota takes effect.
    envLanguage String
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    expireTime String
    The UTC time when the quota expires.
    noticeType Integer
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    quotaCategory String
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.
    desireValue number
    Quota application value.
    productCode string
    The abbreviation of the cloud service name.
    quotaActionCode string
    The quota ID.
    dimensions TemplateQuotaDimension[]
    The Quota Dimensions. See dimensions below.
    effectiveTime string
    The UTC time when the quota takes effect.
    envLanguage string
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    expireTime string
    The UTC time when the quota expires.
    noticeType number
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    quotaCategory string
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.
    desire_value float
    Quota application value.
    product_code str
    The abbreviation of the cloud service name.
    quota_action_code str
    The quota ID.
    dimensions Sequence[TemplateQuotaDimensionArgs]
    The Quota Dimensions. See dimensions below.
    effective_time str
    The UTC time when the quota takes effect.
    env_language str
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    expire_time str
    The UTC time when the quota expires.
    notice_type int
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    quota_category str
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.
    desireValue Number
    Quota application value.
    productCode String
    The abbreviation of the cloud service name.
    quotaActionCode String
    The quota ID.
    dimensions List<Property Map>
    The Quota Dimensions. See dimensions below.
    effectiveTime String
    The UTC time when the quota takes effect.
    envLanguage String
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    expireTime String
    The UTC time when the quota expires.
    noticeType Number
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    quotaCategory String
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TemplateQuota resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing TemplateQuota Resource

    Get an existing TemplateQuota 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?: TemplateQuotaState, opts?: CustomResourceOptions): TemplateQuota
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            desire_value: Optional[float] = None,
            dimensions: Optional[Sequence[TemplateQuotaDimensionArgs]] = None,
            effective_time: Optional[str] = None,
            env_language: Optional[str] = None,
            expire_time: Optional[str] = None,
            notice_type: Optional[int] = None,
            product_code: Optional[str] = None,
            quota_action_code: Optional[str] = None,
            quota_category: Optional[str] = None) -> TemplateQuota
    func GetTemplateQuota(ctx *Context, name string, id IDInput, state *TemplateQuotaState, opts ...ResourceOption) (*TemplateQuota, error)
    public static TemplateQuota Get(string name, Input<string> id, TemplateQuotaState? state, CustomResourceOptions? opts = null)
    public static TemplateQuota get(String name, Output<String> id, TemplateQuotaState 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:
    DesireValue double
    Quota application value.
    Dimensions List<Pulumi.AliCloud.Quotas.Inputs.TemplateQuotaDimension>
    The Quota Dimensions. See dimensions below.
    EffectiveTime string
    The UTC time when the quota takes effect.
    EnvLanguage string
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    ExpireTime string
    The UTC time when the quota expires.
    NoticeType int
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    ProductCode string
    The abbreviation of the cloud service name.
    QuotaActionCode string
    The quota ID.
    QuotaCategory string
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.
    DesireValue float64
    Quota application value.
    Dimensions []TemplateQuotaDimensionArgs
    The Quota Dimensions. See dimensions below.
    EffectiveTime string
    The UTC time when the quota takes effect.
    EnvLanguage string
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    ExpireTime string
    The UTC time when the quota expires.
    NoticeType int
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    ProductCode string
    The abbreviation of the cloud service name.
    QuotaActionCode string
    The quota ID.
    QuotaCategory string
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.
    desireValue Double
    Quota application value.
    dimensions List<TemplateQuotaDimension>
    The Quota Dimensions. See dimensions below.
    effectiveTime String
    The UTC time when the quota takes effect.
    envLanguage String
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    expireTime String
    The UTC time when the quota expires.
    noticeType Integer
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    productCode String
    The abbreviation of the cloud service name.
    quotaActionCode String
    The quota ID.
    quotaCategory String
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.
    desireValue number
    Quota application value.
    dimensions TemplateQuotaDimension[]
    The Quota Dimensions. See dimensions below.
    effectiveTime string
    The UTC time when the quota takes effect.
    envLanguage string
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    expireTime string
    The UTC time when the quota expires.
    noticeType number
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    productCode string
    The abbreviation of the cloud service name.
    quotaActionCode string
    The quota ID.
    quotaCategory string
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.
    desire_value float
    Quota application value.
    dimensions Sequence[TemplateQuotaDimensionArgs]
    The Quota Dimensions. See dimensions below.
    effective_time str
    The UTC time when the quota takes effect.
    env_language str
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    expire_time str
    The UTC time when the quota expires.
    notice_type int
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    product_code str
    The abbreviation of the cloud service name.
    quota_action_code str
    The quota ID.
    quota_category str
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.
    desireValue Number
    Quota application value.
    dimensions List<Property Map>
    The Quota Dimensions. See dimensions below.
    effectiveTime String
    The UTC time when the quota takes effect.
    envLanguage String
    The language of the quota alert notification. Value:

    • zh: Chinese.
    • en: English.
    expireTime String
    The UTC time when the quota expires.
    noticeType Number
    Whether to notify the result of quota promotion application. Value:

    • 0: No.
    • 3: Yes.
    productCode String
    The abbreviation of the cloud service name.
    quotaActionCode String
    The quota ID.
    quotaCategory String
    Type of quota. Value:

    • CommonQuota : Generic quota.
    • WhiteListLabel: Equity quota.
    • FlowControl:API rate quota.

    Supporting Types

    TemplateQuotaDimension, TemplateQuotaDimensionArgs

    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 Template Quota can be imported using the id, e.g.

    $ pulumi import alicloud:quotas/templateQuota:TemplateQuota 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