UNPKG

@pulumi/aws

Version:

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

110 lines 5.09 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.CustomerManagedPolicyAttachment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a customer managed policy attachment for a Single Sign-On (SSO) Permission Set resource * * > **NOTE:** Creating this resource will automatically [Provision the Permission Set](https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_ProvisionPermissionSet.html) to apply the corresponding updates to all assigned accounts. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.ssoadmin.getInstances({}); * const examplePermissionSet = new aws.ssoadmin.PermissionSet("example", { * name: "Example", * instanceArn: example.then(example => example.arns?.[0]), * }); * const examplePolicy = new aws.iam.Policy("example", { * name: "TestPolicy", * description: "My test policy", * policy: JSON.stringify({ * Version: "2012-10-17", * Statement: [{ * Action: ["ec2:Describe*"], * Effect: "Allow", * Resource: "*", * }], * }), * }); * const exampleCustomerManagedPolicyAttachment = new aws.ssoadmin.CustomerManagedPolicyAttachment("example", { * instanceArn: examplePermissionSet.instanceArn, * permissionSetArn: examplePermissionSet.arn, * customerManagedPolicyReference: { * name: examplePolicy.name, * path: "/", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import SSO Managed Policy Attachments using the `name`, `path`, `permission_set_arn`, and `instance_arn` separated by a comma (`,`). For example: * * ```sh * $ pulumi import aws:ssoadmin/customerManagedPolicyAttachment:CustomerManagedPolicyAttachment example TestPolicy,/,arn:aws:sso:::permissionSet/ssoins-2938j0x8920sbj72/ps-80383020jr9302rk,arn:aws:sso:::instance/ssoins-2938j0x8920sbj72 * ``` */ class CustomerManagedPolicyAttachment extends pulumi.CustomResource { /** * Get an existing CustomerManagedPolicyAttachment 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 CustomerManagedPolicyAttachment(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of CustomerManagedPolicyAttachment. 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'] === CustomerManagedPolicyAttachment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["customerManagedPolicyReference"] = state?.customerManagedPolicyReference; resourceInputs["instanceArn"] = state?.instanceArn; resourceInputs["permissionSetArn"] = state?.permissionSetArn; resourceInputs["region"] = state?.region; } else { const args = argsOrState; if (args?.customerManagedPolicyReference === undefined && !opts.urn) { throw new Error("Missing required property 'customerManagedPolicyReference'"); } if (args?.instanceArn === undefined && !opts.urn) { throw new Error("Missing required property 'instanceArn'"); } if (args?.permissionSetArn === undefined && !opts.urn) { throw new Error("Missing required property 'permissionSetArn'"); } resourceInputs["customerManagedPolicyReference"] = args?.customerManagedPolicyReference; resourceInputs["instanceArn"] = args?.instanceArn; resourceInputs["permissionSetArn"] = args?.permissionSetArn; resourceInputs["region"] = args?.region; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CustomerManagedPolicyAttachment.__pulumiType, name, resourceInputs, opts); } } exports.CustomerManagedPolicyAttachment = CustomerManagedPolicyAttachment; /** @internal */ CustomerManagedPolicyAttachment.__pulumiType = 'aws:ssoadmin/customerManagedPolicyAttachment:CustomerManagedPolicyAttachment'; //# sourceMappingURL=customerManagedPolicyAttachment.js.map