"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.ManagedPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Creates a new managed policy for your AWS-account.
 *  This operation creates a policy version with a version identifier of ``v1`` and sets v1 as the policy's default version. For more information about policy versions, see [Versioning for managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) in the *IAM User Guide*.
 *  As a best practice, you can validate your IAM policies. To learn more, see [Validating IAM policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_policy-validator.html) in the *IAM User Guide*.
 *  For more information about managed policies in general, see [Managed policies and inline policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the *IAM User Guide*.
 */
class ManagedPolicy extends pulumi.CustomResource {
    /**
     * Get an existing ManagedPolicy 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 ManagedPolicy(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ManagedPolicy.  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'] === ManagedPolicy.__pulumiType;
    }
    /**
     * Create a ManagedPolicy 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?.policyDocument === undefined && !opts.urn) {
                throw new Error("Missing required property 'policyDocument'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["groups"] = args?.groups;
            resourceInputs["managedPolicyName"] = args?.managedPolicyName;
            resourceInputs["path"] = args?.path;
            resourceInputs["policyDocument"] = args?.policyDocument;
            resourceInputs["roles"] = args?.roles;
            resourceInputs["users"] = args?.users;
            resourceInputs["attachmentCount"] = undefined /*out*/;
            resourceInputs["createDate"] = undefined /*out*/;
            resourceInputs["defaultVersionId"] = undefined /*out*/;
            resourceInputs["isAttachable"] = undefined /*out*/;
            resourceInputs["permissionsBoundaryUsageCount"] = undefined /*out*/;
            resourceInputs["policyArn"] = undefined /*out*/;
            resourceInputs["policyId"] = undefined /*out*/;
            resourceInputs["updateDate"] = undefined /*out*/;
        }
        else {
            resourceInputs["attachmentCount"] = undefined /*out*/;
            resourceInputs["createDate"] = undefined /*out*/;
            resourceInputs["defaultVersionId"] = undefined /*out*/;
            resourceInputs["description"] = undefined /*out*/;
            resourceInputs["groups"] = undefined /*out*/;
            resourceInputs["isAttachable"] = undefined /*out*/;
            resourceInputs["managedPolicyName"] = undefined /*out*/;
            resourceInputs["path"] = undefined /*out*/;
            resourceInputs["permissionsBoundaryUsageCount"] = undefined /*out*/;
            resourceInputs["policyArn"] = undefined /*out*/;
            resourceInputs["policyDocument"] = undefined /*out*/;
            resourceInputs["policyId"] = undefined /*out*/;
            resourceInputs["roles"] = undefined /*out*/;
            resourceInputs["updateDate"] = undefined /*out*/;
            resourceInputs["users"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["description", "managedPolicyName", "path"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(ManagedPolicy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ManagedPolicy = ManagedPolicy;
/** @internal */
ManagedPolicy.__pulumiType = 'aws-native:iam:ManagedPolicy';
//# sourceMappingURL=managedPolicy.js.map