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)

339 lines (338 loc) • 14.9 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. You can use Cost Anomaly Detection by creating monitor. * * ## Example Usage * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const anomalyServiceMonitor = new aws_native.ce.AnomalyMonitor("anomalyServiceMonitor", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Dimensional, * monitorDimension: aws_native.ce.AnomalyMonitorMonitorDimension.Service, * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const anomalyServiceMonitor = new aws_native.ce.AnomalyMonitor("anomalyServiceMonitor", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Dimensional, * monitorDimension: aws_native.ce.AnomalyMonitorMonitorDimension.Service, * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const customAnomalyMonitorWithTags = new aws_native.ce.AnomalyMonitor("customAnomalyMonitorWithTags", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Custom, * monitorSpecification: " { \"Tags\" : { \"Key\" : \"Tag Key\", \"Values\" : [ \"TagValue1\", \"TagValue2\" ] } }", * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const customAnomalyMonitorWithTags = new aws_native.ce.AnomalyMonitor("customAnomalyMonitorWithTags", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Custom, * monitorSpecification: " { \"Tags\" : { \"Key\" : \"Tag Key\", \"Values\" : [ \"TagValue1\", \"TagValue2\" ] } }", * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const customAnomalyMonitorWithCC = new aws_native.ce.AnomalyMonitor("customAnomalyMonitorWithCC", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Custom, * monitorSpecification: " { \"CostCategories\" : { \"Key\" : \"CostCategoryKey\", \"Values\" : [ \"CostCategoryValue\" ] } }", * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const customAnomalyMonitorWithCC = new aws_native.ce.AnomalyMonitor("customAnomalyMonitorWithCC", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Custom, * monitorSpecification: " { \"CostCategories\" : { \"Key\" : \"CostCategoryKey\", \"Values\" : [ \"CostCategoryValue\" ] } }", * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const customAnomalyMonitorWithLinkedAccount = new aws_native.ce.AnomalyMonitor("customAnomalyMonitorWithLinkedAccount", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Custom, * monitorSpecification: " { \"Dimensions\" : { \"Key\" : \"LINKED_ACCOUNT\", \"Values\" : [ \"123456789012\", \"123456789013\" ] } }", * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const customAnomalyMonitorWithLinkedAccount = new aws_native.ce.AnomalyMonitor("customAnomalyMonitorWithLinkedAccount", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Custom, * monitorSpecification: " { \"Dimensions\" : { \"Key\" : \"LINKED_ACCOUNT\", \"Values\" : [ \"123456789012\", \"123456789013\" ] } }", * }); * * ``` * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const customAnomalyMonitorWithLinkedAccount = new aws_native.ce.AnomalyMonitor("customAnomalyMonitorWithLinkedAccount", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Custom, * monitorSpecification: " { \"Dimensions\" : { \"Key\" : \"LINKED_ACCOUNT\", \"Values\" : [ \"123456789012\", \"123456789013\" ] } }", * }); * const anomalyServiceMonitor = new aws_native.ce.AnomalyMonitor("anomalyServiceMonitor", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Dimensional, * monitorDimension: aws_native.ce.AnomalyMonitorMonitorDimension.Service, * }); * const anomalySubscription = new aws_native.ce.AnomalySubscription("anomalySubscription", { * subscriptionName: "SubscriptionName", * threshold: 100, * frequency: aws_native.ce.AnomalySubscriptionFrequency.Daily, * monitorArnList: [ * customAnomalyMonitorWithLinkedAccount.id, * anomalyServiceMonitor.id, * ], * 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 customAnomalyMonitorWithLinkedAccount = new aws_native.ce.AnomalyMonitor("customAnomalyMonitorWithLinkedAccount", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Custom, * monitorSpecification: " { \"Dimensions\" : { \"Key\" : \"LINKED_ACCOUNT\", \"Values\" : [ \"123456789012\", \"123456789013\" ] } }", * }); * const anomalyServiceMonitor = new aws_native.ce.AnomalyMonitor("anomalyServiceMonitor", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Dimensional, * monitorDimension: aws_native.ce.AnomalyMonitorMonitorDimension.Service, * }); * const anomalySubscription = new aws_native.ce.AnomalySubscription("anomalySubscription", { * subscriptionName: "SubscriptionName", * threshold: 100, * frequency: aws_native.ce.AnomalySubscriptionFrequency.Daily, * monitorArnList: [ * customAnomalyMonitorWithLinkedAccount.id, * anomalyServiceMonitor.id, * ], * 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 customAnomalyMonitorWithLinkedAccount = new aws_native.ce.AnomalyMonitor("customAnomalyMonitorWithLinkedAccount", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Custom, * monitorSpecification: " { \"Dimensions\" : { \"Key\" : \"LINKED_ACCOUNT\", \"Values\" : [ \"123456789012\", \"123456789013\" ] } }", * }); * const anomalyServiceMonitor = new aws_native.ce.AnomalyMonitor("anomalyServiceMonitor", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Dimensional, * monitorDimension: aws_native.ce.AnomalyMonitorMonitorDimension.Service, * }); * const anomalySubscription = new aws_native.ce.AnomalySubscription("anomalySubscription", { * subscriptionName: "SubscriptionName", * threshold: 100, * frequency: aws_native.ce.AnomalySubscriptionFrequency.Daily, * monitorArnList: [ * customAnomalyMonitorWithLinkedAccount.id, * anomalyServiceMonitor.id, * ], * 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 customAnomalyMonitorWithLinkedAccount = new aws_native.ce.AnomalyMonitor("customAnomalyMonitorWithLinkedAccount", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Custom, * monitorSpecification: " { \"Dimensions\" : { \"Key\" : \"LINKED_ACCOUNT\", \"Values\" : [ \"123456789012\", \"123456789013\" ] } }", * }); * const anomalyServiceMonitor = new aws_native.ce.AnomalyMonitor("anomalyServiceMonitor", { * monitorName: "MonitorName", * monitorType: aws_native.ce.AnomalyMonitorMonitorType.Dimensional, * monitorDimension: aws_native.ce.AnomalyMonitorMonitorDimension.Service, * }); * const anomalySubscription = new aws_native.ce.AnomalySubscription("anomalySubscription", { * subscriptionName: "SubscriptionName", * threshold: 100, * frequency: aws_native.ce.AnomalySubscriptionFrequency.Daily, * monitorArnList: [ * customAnomalyMonitorWithLinkedAccount.id, * anomalyServiceMonitor.id, * ], * subscribers: [{ * type: aws_native.ce.AnomalySubscriptionSubscriberType.Email, * address: "abc@def.com", * }], * }); * * ``` */ export declare class AnomalyMonitor extends pulumi.CustomResource { /** * Get an existing AnomalyMonitor 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): AnomalyMonitor; /** * Returns true if the given object is an instance of AnomalyMonitor. 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 AnomalyMonitor; /** * The date when the monitor was created. */ readonly creationDate: pulumi.Output<string>; /** * The value for evaluated dimensions. */ readonly dimensionalValueCount: pulumi.Output<number>; /** * The date when the monitor last evaluated for anomalies. */ readonly lastEvaluatedDate: pulumi.Output<string>; /** * The date when the monitor was last updated. */ readonly lastUpdatedDate: pulumi.Output<string>; /** * The Amazon Resource Name (ARN) value for the monitor. */ readonly monitorArn: pulumi.Output<string>; /** * The dimensions to evaluate */ readonly monitorDimension: pulumi.Output<enums.ce.AnomalyMonitorMonitorDimension | undefined>; /** * The name of the monitor. */ readonly monitorName: pulumi.Output<string>; /** * The array of `MonitorSpecification` in JSON array format. For instance, you can use `MonitorSpecification` to specify a tag, Cost Category, or linked account for your custom anomaly monitor. For further information, see the [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ce-anomalymonitor.html#aws-resource-ce-anomalymonitor--examples) section of this page. */ readonly monitorSpecification: pulumi.Output<string | undefined>; /** * The type of the monitor. * * Set this to `DIMENSIONAL` for an AWS managed monitor. AWS managed monitors automatically track up to the top 5,000 values by cost within a dimension of your choosing. Each dimension value is evaluated independently. If you start incurring cost in a new value of your chosen dimension, it will automatically be analyzed by an AWS managed monitor. * * Set this to `CUSTOM` for a customer managed monitor. Customer managed monitors let you select specific dimension values that get monitored in aggregate. * * For more information about monitor types, see [Monitor types](https://docs.aws.amazon.com/cost-management/latest/userguide/getting-started-ad.html#monitor-type-def) in the *Billing and Cost Management User Guide* . */ readonly monitorType: pulumi.Output<enums.ce.AnomalyMonitorMonitorType>; /** * Tags to assign to monitor. */ readonly resourceTags: pulumi.Output<outputs.CreateOnlyTag[] | undefined>; /** * Create a AnomalyMonitor 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: AnomalyMonitorArgs, opts?: pulumi.CustomResourceOptions); } /** * The set of arguments for constructing a AnomalyMonitor resource. */ export interface AnomalyMonitorArgs { /** * The dimensions to evaluate */ monitorDimension?: pulumi.Input<enums.ce.AnomalyMonitorMonitorDimension>; /** * The name of the monitor. */ monitorName?: pulumi.Input<string>; /** * The array of `MonitorSpecification` in JSON array format. For instance, you can use `MonitorSpecification` to specify a tag, Cost Category, or linked account for your custom anomaly monitor. For further information, see the [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ce-anomalymonitor.html#aws-resource-ce-anomalymonitor--examples) section of this page. */ monitorSpecification?: pulumi.Input<string>; /** * The type of the monitor. * * Set this to `DIMENSIONAL` for an AWS managed monitor. AWS managed monitors automatically track up to the top 5,000 values by cost within a dimension of your choosing. Each dimension value is evaluated independently. If you start incurring cost in a new value of your chosen dimension, it will automatically be analyzed by an AWS managed monitor. * * Set this to `CUSTOM` for a customer managed monitor. Customer managed monitors let you select specific dimension values that get monitored in aggregate. * * For more information about monitor types, see [Monitor types](https://docs.aws.amazon.com/cost-management/latest/userguide/getting-started-ad.html#monitor-type-def) in the *Billing and Cost Management User Guide* . */ monitorType: pulumi.Input<enums.ce.AnomalyMonitorMonitorType>; /** * Tags to assign to monitor. */ resourceTags?: pulumi.Input<pulumi.Input<inputs.CreateOnlyTagArgs>[]>; }