"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.CloudConfigurationRule = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * Provides a Datadog Cloud Configuration Rule resource.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * const myrule = new datadog.CloudConfigurationRule("myrule", {
 *     name: "My cloud configuration rule",
 *     message: "Rule has triggered",
 *     enabled: true,
 *     policy: `package datadog
 *
 * import data.datadog.output as dd_output
 *
 * import future.keywords.contains
 * import future.keywords.if
 * import future.keywords.in
 *
 * eval(resource) = "skip" if {
 *     # Logic that evaluates to true if the resource should be skipped
 *     true
 * } else = "pass" {
 *     # Logic that evaluates to true if the resource is compliant
 *     true
 * } else = "fail" {
 *     # Logic that evaluates to true if the resource is not compliant
 *     true
 * }
 *
 * # This part remains unchanged for all rules
 * results contains result if {
 *     some resource in input.resources[input.main_resource_type]
 *     result := dd_output.format(resource, eval(resource))
 * }
 * `,
 *     resourceType: "aws_s3_bucket",
 *     relatedResourceTypes: [],
 *     severity: "high",
 *     groupBies: ["@resource"],
 *     notifications: ["@channel"],
 *     tags: ["some:tag"],
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * Security monitoring rules can be imported using ID, e.g.
 *
 * ```sh
 * $ pulumi import datadog:index/cloudConfigurationRule:CloudConfigurationRule my_rule m0o-hto-lkb
 * ```
 */
class CloudConfigurationRule extends pulumi.CustomResource {
    /**
     * Get an existing CloudConfigurationRule 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 CloudConfigurationRule(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/cloudConfigurationRule:CloudConfigurationRule';
    /**
     * Returns true if the given object is an instance of CloudConfigurationRule.  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'] === CloudConfigurationRule.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["filters"] = state?.filters;
            resourceInputs["groupBies"] = state?.groupBies;
            resourceInputs["message"] = state?.message;
            resourceInputs["name"] = state?.name;
            resourceInputs["notifications"] = state?.notifications;
            resourceInputs["policy"] = state?.policy;
            resourceInputs["relatedResourceTypes"] = state?.relatedResourceTypes;
            resourceInputs["resourceType"] = state?.resourceType;
            resourceInputs["severity"] = state?.severity;
            resourceInputs["tags"] = state?.tags;
        }
        else {
            const args = argsOrState;
            if (args?.enabled === undefined && !opts.urn) {
                throw new Error("Missing required property 'enabled'");
            }
            if (args?.message === undefined && !opts.urn) {
                throw new Error("Missing required property 'message'");
            }
            if (args?.name === undefined && !opts.urn) {
                throw new Error("Missing required property 'name'");
            }
            if (args?.policy === undefined && !opts.urn) {
                throw new Error("Missing required property 'policy'");
            }
            if (args?.resourceType === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceType'");
            }
            if (args?.severity === undefined && !opts.urn) {
                throw new Error("Missing required property 'severity'");
            }
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["filters"] = args?.filters;
            resourceInputs["groupBies"] = args?.groupBies;
            resourceInputs["message"] = args?.message;
            resourceInputs["name"] = args?.name;
            resourceInputs["notifications"] = args?.notifications;
            resourceInputs["policy"] = args?.policy;
            resourceInputs["relatedResourceTypes"] = args?.relatedResourceTypes;
            resourceInputs["resourceType"] = args?.resourceType;
            resourceInputs["severity"] = args?.severity;
            resourceInputs["tags"] = args?.tags;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(CloudConfigurationRule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.CloudConfigurationRule = CloudConfigurationRule;
//# sourceMappingURL=cloudConfigurationRule.js.map