"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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CostBudget = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * Provides a Datadog Cost Budget resource.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * // Budget with multiple tag combinations
 * // Note: Each unique tag combination needs its own budget_line block
 * const withTags = new datadog.CostBudget("with_tags", {
 *     name: "Multi-Environment Budget",
 *     metricsQuery: "sum:aws.cost.amortized{*} by {environment}",
 *     startMonth: 202601,
 *     endMonth: 202603,
 *     budgetLines: [
 *         {
 *             amounts: {
 *                 "202601": 2000,
 *                 "202602": 2200,
 *                 "202603": 2000,
 *             },
 *             tagFilters: [{
 *                 tagKey: "environment",
 *                 tagValue: "production",
 *             }],
 *         },
 *         {
 *             amounts: {
 *                 "202601": 1000,
 *                 "202602": 1100,
 *                 "202603": 1000,
 *             },
 *             tagFilters: [{
 *                 tagKey: "environment",
 *                 tagValue: "staging",
 *             }],
 *         },
 *     ],
 * });
 * ```
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * // Hierarchical budget with parent/child tag structure
 * // Note: Order in "by {tag1,tag2}" determines hierarchy (parent,child)
 * // Each unique parent+child combination needs its own budget_line block
 * const hierarchical = new datadog.CostBudget("hierarchical", {
 *     name: "Team-Based AWS Budget",
 *     metricsQuery: "sum:aws.cost.amortized{*} by {team,environment}",
 *     startMonth: 202601,
 *     endMonth: 202603,
 *     budgetLines: [
 *         {
 *             amounts: {
 *                 "202601": 1500,
 *                 "202602": 1600,
 *                 "202603": 1500,
 *             },
 *             parentTagFilters: [{
 *                 tagKey: "team",
 *                 tagValue: "backend",
 *             }],
 *             childTagFilters: [{
 *                 tagKey: "environment",
 *                 tagValue: "production",
 *             }],
 *         },
 *         {
 *             amounts: {
 *                 "202601": 500,
 *                 "202602": 550,
 *                 "202603": 500,
 *             },
 *             parentTagFilters: [{
 *                 tagKey: "team",
 *                 tagValue: "frontend",
 *             }],
 *             childTagFilters: [{
 *                 tagKey: "environment",
 *                 tagValue: "staging",
 *             }],
 *         },
 *     ],
 * });
 * ```
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * // Legacy entries with tag filters (deprecated - use budget_line instead)
 * // Note: Each unique tag combination must have entries for all months
 * const legacyWithTags = new datadog.CostBudget("legacy_with_tags", {
 *     name: "Production Budget (Legacy)",
 *     metricsQuery: "sum:aws.cost.amortized{*} by {environment}",
 *     startMonth: 202601,
 *     endMonth: 202603,
 *     entries: [
 *         {
 *             month: 202601,
 *             amount: 2000,
 *             tagFilters: [{
 *                 tagKey: "environment",
 *                 tagValue: "production",
 *             }],
 *         },
 *         {
 *             month: 202602,
 *             amount: 2200,
 *             tagFilters: [{
 *                 tagKey: "environment",
 *                 tagValue: "production",
 *             }],
 *         },
 *         {
 *             month: 202603,
 *             amount: 2000,
 *             tagFilters: [{
 *                 tagKey: "environment",
 *                 tagValue: "production",
 *             }],
 *         },
 *     ],
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * Cost budgets can be imported using their ID, e.g.
 *
 * ```sh
 * $ pulumi import datadog:index/costBudget:CostBudget example a1b2c3d4-e5f6-7890-abcd-ef1234567890
 * ```
 */
class CostBudget extends pulumi.CustomResource {
    /**
     * Get an existing CostBudget 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 CostBudget(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/costBudget:CostBudget';
    /**
     * Returns true if the given object is an instance of CostBudget.  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'] === CostBudget.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["budgetId"] = state?.budgetId;
            resourceInputs["budgetLines"] = state?.budgetLines;
            resourceInputs["endMonth"] = state?.endMonth;
            resourceInputs["entries"] = state?.entries;
            resourceInputs["metricsQuery"] = state?.metricsQuery;
            resourceInputs["name"] = state?.name;
            resourceInputs["startMonth"] = state?.startMonth;
            resourceInputs["totalAmount"] = state?.totalAmount;
        }
        else {
            const args = argsOrState;
            if (args?.endMonth === undefined && !opts.urn) {
                throw new Error("Missing required property 'endMonth'");
            }
            if (args?.metricsQuery === undefined && !opts.urn) {
                throw new Error("Missing required property 'metricsQuery'");
            }
            if (args?.name === undefined && !opts.urn) {
                throw new Error("Missing required property 'name'");
            }
            if (args?.startMonth === undefined && !opts.urn) {
                throw new Error("Missing required property 'startMonth'");
            }
            resourceInputs["budgetId"] = args?.budgetId;
            resourceInputs["budgetLines"] = args?.budgetLines;
            resourceInputs["endMonth"] = args?.endMonth;
            resourceInputs["entries"] = args?.entries;
            resourceInputs["metricsQuery"] = args?.metricsQuery;
            resourceInputs["name"] = args?.name;
            resourceInputs["startMonth"] = args?.startMonth;
            resourceInputs["totalAmount"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(CostBudget.__pulumiType, name, resourceInputs, opts);
    }
}
exports.CostBudget = CostBudget;
//# sourceMappingURL=costBudget.js.map