com.pulumi.alicloud.quotas.QuotaAlarm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alicloud Show documentation
Show all versions of alicloud Show documentation
A Pulumi package for creating and managing AliCloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.alicloud.quotas;
import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.quotas.QuotaAlarmArgs;
import com.pulumi.alicloud.quotas.inputs.QuotaAlarmState;
import com.pulumi.alicloud.quotas.outputs.QuotaAlarmQuotaDimension;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Double;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Provides a Quotas Quota Alarm resource.
*
* For information about Quotas Quota Alarm and how to use it, see [What is Quota Alarm](https://www.alibabacloud.com/help/en/quota-center/developer-reference/api-quotas-2020-05-10-createquotaalarm).
*
* > **NOTE:** Available since v1.116.0.
*
* ## Example Usage
*
* Basic Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Quotas Quota Alarm can be imported using the id, e.g.
*
* ```sh
* $ pulumi import alicloud:quotas/quotaAlarm:QuotaAlarm example <id>
* ```
*
*/
@ResourceType(type="alicloud:quotas/quotaAlarm:QuotaAlarm")
public class QuotaAlarm extends com.pulumi.resources.CustomResource {
/**
* The creation time of the resource.
*
*/
@Export(name="createTime", refs={String.class}, tree="[0]")
private Output createTime;
/**
* @return The creation time of the resource.
*
*/
public Output createTime() {
return this.createTime;
}
/**
* The Product Code.
*
*/
@Export(name="productCode", refs={String.class}, tree="[0]")
private Output productCode;
/**
* @return The Product Code.
*
*/
public Output productCode() {
return this.productCode;
}
/**
* The Quota Action Code.
*
*/
@Export(name="quotaActionCode", refs={String.class}, tree="[0]")
private Output quotaActionCode;
/**
* @return The Quota Action Code.
*
*/
public Output quotaActionCode() {
return this.quotaActionCode;
}
/**
* The name of Quota Alarm.
*
*/
@Export(name="quotaAlarmName", refs={String.class}, tree="[0]")
private Output quotaAlarmName;
/**
* @return The name of Quota Alarm.
*
*/
public Output quotaAlarmName() {
return this.quotaAlarmName;
}
/**
* The Quota Dimensions. See `quota_dimensions` below.
*
*/
@Export(name="quotaDimensions", refs={List.class,QuotaAlarmQuotaDimension.class}, tree="[0,1]")
private Output> quotaDimensions;
/**
* @return The Quota Dimensions. See `quota_dimensions` below.
*
*/
public Output>> quotaDimensions() {
return Codegen.optional(this.quotaDimensions);
}
/**
* The threshold of Quota Alarm.
*
*/
@Export(name="threshold", refs={Double.class}, tree="[0]")
private Output threshold;
/**
* @return The threshold of Quota Alarm.
*
*/
public Output> threshold() {
return Codegen.optional(this.threshold);
}
/**
* The threshold percent of Quota Alarm.
*
*/
@Export(name="thresholdPercent", refs={Double.class}, tree="[0]")
private Output thresholdPercent;
/**
* @return The threshold percent of Quota Alarm.
*
*/
public Output> thresholdPercent() {
return Codegen.optional(this.thresholdPercent);
}
/**
* Quota alarm type. Value:
* - used: Quota used alarm.
* - usable: alarm for the remaining available quota.
*
*/
@Export(name="thresholdType", refs={String.class}, tree="[0]")
private Output thresholdType;
/**
* @return Quota alarm type. Value:
* - used: Quota used alarm.
* - usable: alarm for the remaining available quota.
*
*/
public Output thresholdType() {
return this.thresholdType;
}
/**
* The WebHook of Quota Alarm.
*
*/
@Export(name="webHook", refs={String.class}, tree="[0]")
private Output webHook;
/**
* @return The WebHook of Quota Alarm.
*
*/
public Output> webHook() {
return Codegen.optional(this.webHook);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public QuotaAlarm(java.lang.String name) {
this(name, QuotaAlarmArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public QuotaAlarm(java.lang.String name, QuotaAlarmArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public QuotaAlarm(java.lang.String name, QuotaAlarmArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:quotas/quotaAlarm:QuotaAlarm", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private QuotaAlarm(java.lang.String name, Output id, @Nullable QuotaAlarmState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:quotas/quotaAlarm:QuotaAlarm", name, state, makeResourceOptions(options, id), false);
}
private static QuotaAlarmArgs makeArgs(QuotaAlarmArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? QuotaAlarmArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host 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
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static QuotaAlarm get(java.lang.String name, Output id, @Nullable QuotaAlarmState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new QuotaAlarm(name, id, state, options);
}
}