"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServiceControlPolicyAttachment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage organization service control policy attachment
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooServiceControlPolicy = new volcengine.organization.ServiceControlPolicy("fooServiceControlPolicy", {
 *     policyName: "tfpolicy11",
 *     description: "tftest1",
 *     statement: "{\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ecs:RunInstances\"],\"Resource\":[\"*\"]}]}",
 * });
 * const fooServiceControlPolicyAttachment = new volcengine.organization.ServiceControlPolicyAttachment("fooServiceControlPolicyAttachment", {
 *     policyId: fooServiceControlPolicy.id,
 *     targetId: "21*********94",
 *     targetType: "Account",
 * });
 * const foo1 = new volcengine.organization.ServiceControlPolicyAttachment("foo1", {
 *     policyId: fooServiceControlPolicy.id,
 *     targetId: "73*********9",
 *     targetType: "OU",
 * });
 * ```
 *
 * ## Import
 *
 * Service Control policy attachment can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:organization/serviceControlPolicyAttachment:ServiceControlPolicyAttachment default PolicyID:TargetID
 * ```
 */
class ServiceControlPolicyAttachment extends pulumi.CustomResource {
    /**
     * Get an existing ServiceControlPolicyAttachment 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 ServiceControlPolicyAttachment(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of ServiceControlPolicyAttachment.  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'] === ServiceControlPolicyAttachment.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["policyId"] = state ? state.policyId : undefined;
            resourceInputs["targetId"] = state ? state.targetId : undefined;
            resourceInputs["targetType"] = state ? state.targetType : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.policyId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'policyId'");
            }
            if ((!args || args.targetId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'targetId'");
            }
            if ((!args || args.targetType === undefined) && !opts.urn) {
                throw new Error("Missing required property 'targetType'");
            }
            resourceInputs["policyId"] = args ? args.policyId : undefined;
            resourceInputs["targetId"] = args ? args.targetId : undefined;
            resourceInputs["targetType"] = args ? args.targetType : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ServiceControlPolicyAttachment.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ServiceControlPolicyAttachment = ServiceControlPolicyAttachment;
/** @internal */
ServiceControlPolicyAttachment.__pulumiType = 'volcengine:organization/serviceControlPolicyAttachment:ServiceControlPolicyAttachment';
//# sourceMappingURL=serviceControlPolicyAttachment.js.map