UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

88 lines 3.56 kB
"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.GroupPolicyAttachment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Attaches a Managed IAM Policy to an IAM group * * > **NOTE:** The usage of this resource conflicts with the `aws.iam.PolicyAttachment` resource and will permanently show a difference if both are defined. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const group = new aws.iam.Group("group", {name: "test-group"}); * const policy = new aws.iam.Policy("policy", { * name: "test-policy", * description: "A test policy", * policy: "{ ... policy JSON ... }", * }); * const test_attach = new aws.iam.GroupPolicyAttachment("test-attach", { * group: group.name, * policyArn: policy.arn, * }); * ``` * * ## Import * * Using `pulumi import`, import IAM group policy attachments using the group name and policy arn separated by `/`. For example: * * ```sh * $ pulumi import aws:iam/groupPolicyAttachment:GroupPolicyAttachment test-attach test-group/arn:aws:iam::xxxxxxxxxxxx:policy/test-policy * ``` */ class GroupPolicyAttachment extends pulumi.CustomResource { /** * Get an existing GroupPolicyAttachment 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 GroupPolicyAttachment(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of GroupPolicyAttachment. 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'] === GroupPolicyAttachment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["group"] = state?.group; resourceInputs["policyArn"] = state?.policyArn; } else { const args = argsOrState; if (args?.group === undefined && !opts.urn) { throw new Error("Missing required property 'group'"); } if (args?.policyArn === undefined && !opts.urn) { throw new Error("Missing required property 'policyArn'"); } resourceInputs["group"] = args?.group; resourceInputs["policyArn"] = args?.policyArn; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(GroupPolicyAttachment.__pulumiType, name, resourceInputs, opts); } } exports.GroupPolicyAttachment = GroupPolicyAttachment; /** @internal */ GroupPolicyAttachment.__pulumiType = 'aws:iam/groupPolicyAttachment:GroupPolicyAttachment'; //# sourceMappingURL=groupPolicyAttachment.js.map