"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.ProtectionGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A grouping of protected resources so they can be handled as a collective. This resource grouping improves the accuracy of detection and reduces false positives.
 *
 * ## Example Usage
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const protectionGroup = new aws_native.shield.ProtectionGroup("protectionGroup", {
 *     protectionGroupId: "ProtectionGroupForAllResources",
 *     aggregation: aws_native.shield.ProtectionGroupAggregation.Sum,
 *     pattern: aws_native.shield.ProtectionGroupPattern.All,
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const protectionGroup = new aws_native.shield.ProtectionGroup("protectionGroup", {
 *     protectionGroupId: "ProtectionGroupForAllResources",
 *     aggregation: aws_native.shield.ProtectionGroupAggregation.Sum,
 *     pattern: aws_native.shield.ProtectionGroupPattern.All,
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const protectionGroup = new aws_native.shield.ProtectionGroup("protectionGroup", {
 *     protectionGroupId: "ProtectionGroupForAllEIPResources",
 *     aggregation: aws_native.shield.ProtectionGroupAggregation.Sum,
 *     pattern: aws_native.shield.ProtectionGroupPattern.ByResourceType,
 *     resourceType: aws_native.shield.ProtectionGroupResourceType.ElasticIpAllocation,
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const protectionGroup = new aws_native.shield.ProtectionGroup("protectionGroup", {
 *     protectionGroupId: "ProtectionGroupForAllEIPResources",
 *     aggregation: aws_native.shield.ProtectionGroupAggregation.Sum,
 *     pattern: aws_native.shield.ProtectionGroupPattern.ByResourceType,
 *     resourceType: aws_native.shield.ProtectionGroupResourceType.ElasticIpAllocation,
 * });
 *
 * ```
 */
class ProtectionGroup extends pulumi.CustomResource {
    /**
     * Get an existing ProtectionGroup 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, id, opts) {
        return new ProtectionGroup(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ProtectionGroup.  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'] === ProtectionGroup.__pulumiType;
    }
    /**
     * Create a ProtectionGroup 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, args, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (!opts.id) {
            if (args?.aggregation === undefined && !opts.urn) {
                throw new Error("Missing required property 'aggregation'");
            }
            if (args?.pattern === undefined && !opts.urn) {
                throw new Error("Missing required property 'pattern'");
            }
            if (args?.protectionGroupId === undefined && !opts.urn) {
                throw new Error("Missing required property 'protectionGroupId'");
            }
            resourceInputs["aggregation"] = args?.aggregation;
            resourceInputs["members"] = args?.members;
            resourceInputs["pattern"] = args?.pattern;
            resourceInputs["protectionGroupId"] = args?.protectionGroupId;
            resourceInputs["resourceType"] = args?.resourceType;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["protectionGroupArn"] = undefined /*out*/;
        }
        else {
            resourceInputs["aggregation"] = undefined /*out*/;
            resourceInputs["members"] = undefined /*out*/;
            resourceInputs["pattern"] = undefined /*out*/;
            resourceInputs["protectionGroupArn"] = undefined /*out*/;
            resourceInputs["protectionGroupId"] = undefined /*out*/;
            resourceInputs["resourceType"] = undefined /*out*/;
            resourceInputs["tags"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["protectionGroupId"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(ProtectionGroup.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ProtectionGroup = ProtectionGroup;
/** @internal */
ProtectionGroup.__pulumiType = 'aws-native:shield:ProtectionGroup';
//# sourceMappingURL=protectionGroup.js.map