UNPKG

@pulumi/aws-native

Version:

The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)

193 lines • 9 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.AnomalySubscription = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * AWS Cost Anomaly Detection leverages advanced Machine Learning technologies to identify anomalous spend and root causes, so you can quickly take action. Create subscription to be notified * * ## Example Usage * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const anomalySubscription = new aws_native.ce.AnomalySubscription("anomalySubscription", { * subscriptionName: "SubscriptionName", * thresholdExpression: "{ \"Dimensions\": { \"Key\": \"ANOMALY_TOTAL_IMPACT_PERCENTAGE\", \"Values\": [ \"100\" ], \"MatchOptions\": [ \"GREATER_THAN_OR_EQUAL\" ] } }", * monitorArnList: [], * subscribers: [{ * address: "abc@def.com", * type: aws_native.ce.AnomalySubscriptionSubscriberType.Email, * }], * frequency: aws_native.ce.AnomalySubscriptionFrequency.Daily, * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const anomalySubscription = new aws_native.ce.AnomalySubscription("anomalySubscription", { * subscriptionName: "Subscription 1", * thresholdExpression: "{ \"Dimensions\": { \"Key\": \"ANOMALY_TOTAL_IMPACT_PERCENTAGE\", \"MatchOptions\": [ \"GREATER_THAN_OR_EQUAL\" ], \"Values\": [ \"100\" ] } }", * frequency: aws_native.ce.AnomalySubscriptionFrequency.Daily, * monitorArnList: [], * subscribers: [{ * type: aws_native.ce.AnomalySubscriptionSubscriberType.Email, * address: "abc@def.com", * }], * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const anomalySubscription = new aws_native.ce.AnomalySubscription("anomalySubscription", { * subscriptionName: "SubscriptionName", * thresholdExpression: "{ \"And\": [ { \"Dimensions\": { \"Key\": \"ANOMALY_TOTAL_IMPACT_PERCENTAGE\", \"MatchOptions\": [ \"GREATER_THAN_OR_EQUAL\" ], \"Values\": [ \"100\" ] } }, { \"Dimensions\": { \"Key\": \"ANOMALY_TOTAL_IMPACT_ABSOLUTE\", \"MatchOptions\": [ \"GREATER_THAN_OR_EQUAL\" ], \"Values\": [ \"200\" ] } } ] }", * monitorArnList: [], * subscribers: [{ * address: "abc@def.com", * type: aws_native.ce.AnomalySubscriptionSubscriberType.Email, * }], * frequency: aws_native.ce.AnomalySubscriptionFrequency.Daily, * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const anomalySubscription = new aws_native.ce.AnomalySubscription("anomalySubscription", { * subscriptionName: "SubscriptionName", * thresholdExpression: "{ \"And\": [ { \"Dimensions\": { \"Key\": \"ANOMALY_TOTAL_IMPACT_PERCENTAGE\", \"MatchOptions\": [ \"GREATER_THAN_OR_EQUAL\" ], \"Values\": [ \"100\" ] } }, { \"Dimensions\": { \"Key\": \"ANOMALY_TOTAL_IMPACT_ABSOLUTE\", \"MatchOptions\": [ \"GREATER_THAN_OR_EQUAL\" ], \"Values\": [ \"200\" ] } } ] }", * frequency: aws_native.ce.AnomalySubscriptionFrequency.Daily, * monitorArnList: [], * subscribers: [{ * type: aws_native.ce.AnomalySubscriptionSubscriberType.Email, * address: "abc@def.com", * }], * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const anomalySubscription = new aws_native.ce.AnomalySubscription("anomalySubscription", { * subscriptionName: "SubscriptionName", * thresholdExpression: "{ \"Or\": [ { \"Dimensions\": { \"Key\": \"ANOMALY_TOTAL_IMPACT_PERCENTAGE\", \"MatchOptions\": [ \"GREATER_THAN_OR_EQUAL\" ], \"Values\": [ \"100\" ] } }, { \"Dimensions\": { \"Key\": \"ANOMALY_TOTAL_IMPACT_ABSOLUTE\", \"MatchOptions\": [ \"GREATER_THAN_OR_EQUAL\" ], \"Values\": [ \"200\" ] } } ] }", * monitorArnList: [], * subscribers: [{ * address: "abc@def.com", * type: aws_native.ce.AnomalySubscriptionSubscriberType.Email, * }], * frequency: aws_native.ce.AnomalySubscriptionFrequency.Daily, * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const anomalySubscription = new aws_native.ce.AnomalySubscription("anomalySubscription", { * subscriptionName: "SubscriptionName", * thresholdExpression: "{ \"Or\": [ { \"Dimensions\": { \"Key\": \"ANOMALY_TOTAL_IMPACT_PERCENTAGE\", \"MatchOptions\": [ \"GREATER_THAN_OR_EQUAL\" ], \"Values\": [ \"100\" ] } }, { \"Dimensions\": { \"Key\": \"ANOMALY_TOTAL_IMPACT_ABSOLUTE\", \"MatchOptions\": [ \"GREATER_THAN_OR_EQUAL\" ], \"Values\": [ \"200\" ] } } ] }", * frequency: aws_native.ce.AnomalySubscriptionFrequency.Daily, * monitorArnList: [], * subscribers: [{ * type: aws_native.ce.AnomalySubscriptionSubscriberType.Email, * address: "abc@def.com", * }], * }); * * ``` */ class AnomalySubscription extends pulumi.CustomResource { /** * Get an existing AnomalySubscription 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 opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, opts) { return new AnomalySubscription(name, undefined, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AnomalySubscription. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === AnomalySubscription.__pulumiType; } /** * Create a AnomalySubscription 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, args, opts) { let resourceInputs = {}; opts = opts || {}; if (!opts.id) { if (args?.frequency === undefined && !opts.urn) { throw new Error("Missing required property 'frequency'"); } if (args?.monitorArnList === undefined && !opts.urn) { throw new Error("Missing required property 'monitorArnList'"); } if (args?.subscribers === undefined && !opts.urn) { throw new Error("Missing required property 'subscribers'"); } resourceInputs["frequency"] = args?.frequency; resourceInputs["monitorArnList"] = args?.monitorArnList; resourceInputs["resourceTags"] = args?.resourceTags; resourceInputs["subscribers"] = args?.subscribers; resourceInputs["subscriptionName"] = args?.subscriptionName; resourceInputs["threshold"] = args?.threshold; resourceInputs["thresholdExpression"] = args?.thresholdExpression; resourceInputs["accountId"] = undefined /*out*/; resourceInputs["subscriptionArn"] = undefined /*out*/; } else { resourceInputs["accountId"] = undefined /*out*/; resourceInputs["frequency"] = undefined /*out*/; resourceInputs["monitorArnList"] = undefined /*out*/; resourceInputs["resourceTags"] = undefined /*out*/; resourceInputs["subscribers"] = undefined /*out*/; resourceInputs["subscriptionArn"] = undefined /*out*/; resourceInputs["subscriptionName"] = undefined /*out*/; resourceInputs["threshold"] = undefined /*out*/; resourceInputs["thresholdExpression"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const replaceOnChanges = { replaceOnChanges: ["resourceTags[*]"] }; opts = pulumi.mergeOptions(opts, replaceOnChanges); super(AnomalySubscription.__pulumiType, name, resourceInputs, opts); } } exports.AnomalySubscription = AnomalySubscription; /** @internal */ AnomalySubscription.__pulumiType = 'aws-native:ce:AnomalySubscription'; //# sourceMappingURL=anomalySubscription.js.map