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)

211 lines (210 loc) 8.81 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; import * as enums from "../types/enums"; /** * 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", * }], * }); * * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): AnomalySubscription; /** * 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: any): obj is AnomalySubscription; /** * The accountId */ readonly accountId: pulumi.Output<string>; /** * The frequency at which anomaly reports are sent over email. */ readonly frequency: pulumi.Output<enums.ce.AnomalySubscriptionFrequency>; /** * A list of cost anomaly monitors. */ readonly monitorArnList: pulumi.Output<string[]>; /** * Tags to assign to subscription. */ readonly resourceTags: pulumi.Output<outputs.CreateOnlyTag[] | undefined>; /** * A list of subscriber */ readonly subscribers: pulumi.Output<outputs.ce.AnomalySubscriptionSubscriber[]>; /** * The `AnomalySubscription` Amazon Resource Name (ARN). */ readonly subscriptionArn: pulumi.Output<string>; /** * The name of the subscription. */ readonly subscriptionName: pulumi.Output<string>; /** * The dollar value that triggers a notification if the threshold is exceeded. */ readonly threshold: pulumi.Output<number | undefined>; /** * An Expression object in JSON String format used to specify the anomalies that you want to generate alerts for. */ readonly thresholdExpression: pulumi.Output<string | undefined>; /** * 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: string, args: AnomalySubscriptionArgs, opts?: pulumi.CustomResourceOptions); } /** * The set of arguments for constructing a AnomalySubscription resource. */ export interface AnomalySubscriptionArgs { /** * The frequency at which anomaly reports are sent over email. */ frequency: pulumi.Input<enums.ce.AnomalySubscriptionFrequency>; /** * A list of cost anomaly monitors. */ monitorArnList: pulumi.Input<pulumi.Input<string>[]>; /** * Tags to assign to subscription. */ resourceTags?: pulumi.Input<pulumi.Input<inputs.CreateOnlyTagArgs>[]>; /** * A list of subscriber */ subscribers: pulumi.Input<pulumi.Input<inputs.ce.AnomalySubscriptionSubscriberArgs>[]>; /** * The name of the subscription. */ subscriptionName?: pulumi.Input<string>; /** * The dollar value that triggers a notification if the threshold is exceeded. */ threshold?: pulumi.Input<number>; /** * An Expression object in JSON String format used to specify the anomalies that you want to generate alerts for. */ thresholdExpression?: pulumi.Input<string>; }