UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

122 lines 4.36 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.AnomalyMonitor = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a CE Anomaly Monitor. * * ## Example Usage * * There are two main types of a Cost Anomaly Monitor: `DIMENSIONAL` and `CUSTOM`. * * ### Dimensional Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const serviceMonitor = new aws.costexplorer.AnomalyMonitor("service_monitor", { * name: "AWSServiceMonitor", * monitorType: "DIMENSIONAL", * monitorDimension: "SERVICE", * }); * ``` * * ### Custom Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = new aws.costexplorer.AnomalyMonitor("test", { * name: "AWSCustomAnomalyMonitor", * monitorType: "CUSTOM", * monitorSpecification: JSON.stringify({ * And: null, * CostCategories: null, * Dimensions: null, * Not: null, * Or: null, * Tags: { * Key: "CostCenter", * MatchOptions: null, * Values: ["10000"], * }, * }), * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * - `arn` (String) Amazon Resource Name (ARN) of the Cost Explorer anomaly monitor. * * Using `pulumi import`, import `aws_ce_anomaly_monitor` using the `id`. For example: * * console * * % pulumi import aws_ce_anomaly_monitor.example costAnomalyMonitorARN */ 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 state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new AnomalyMonitor(name, state, { ...opts, id: id }); } /** * 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) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === AnomalyMonitor.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["monitorDimension"] = state?.monitorDimension; resourceInputs["monitorSpecification"] = state?.monitorSpecification; resourceInputs["monitorType"] = state?.monitorType; resourceInputs["name"] = state?.name; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.monitorType === undefined && !opts.urn) { throw new Error("Missing required property 'monitorType'"); } resourceInputs["monitorDimension"] = args?.monitorDimension; resourceInputs["monitorSpecification"] = args?.monitorSpecification; resourceInputs["monitorType"] = args?.monitorType; resourceInputs["name"] = args?.name; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AnomalyMonitor.__pulumiType, name, resourceInputs, opts); } } exports.AnomalyMonitor = AnomalyMonitor; /** @internal */ AnomalyMonitor.__pulumiType = 'aws:costexplorer/anomalyMonitor:AnomalyMonitor'; //# sourceMappingURL=anomalyMonitor.js.map