UNPKG

@pulumi/aws

Version:

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

116 lines 4.51 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 * * Using `pulumi import`, import `aws_ce_anomaly_monitor` using the `id`. For example: * * ```sh * $ pulumi import aws:costexplorer/anomalyMonitor:AnomalyMonitor 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, Object.assign(Object.assign({}, 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 ? state.arn : undefined; resourceInputs["monitorDimension"] = state ? state.monitorDimension : undefined; resourceInputs["monitorSpecification"] = state ? state.monitorSpecification : undefined; resourceInputs["monitorType"] = state ? state.monitorType : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; } else { const args = argsOrState; if ((!args || args.monitorType === undefined) && !opts.urn) { throw new Error("Missing required property 'monitorType'"); } resourceInputs["monitorDimension"] = args ? args.monitorDimension : undefined; resourceInputs["monitorSpecification"] = args ? args.monitorSpecification : undefined; resourceInputs["monitorType"] = args ? args.monitorType : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["tags"] = args ? args.tags : undefined; 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