UNPKG

@pulumi/aws

Version:

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

104 lines 5.35 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.ResourceShareAccepter = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manage accepting a Resource Access Manager (RAM) Resource Share invitation. From a _receiver_ AWS account, accept an invitation to share resources that were shared by a _sender_ AWS account. To create a resource share in the _sender_, see the `aws.ram.ResourceShare` resource. * * > **Note:** If both AWS accounts are in the same Organization and [RAM Sharing with AWS Organizations is enabled](https://docs.aws.amazon.com/ram/latest/userguide/getting-started-sharing.html#getting-started-sharing-orgs), this resource is not necessary as RAM Resource Share invitations are not used. * * ## Example Usage * * This configuration provides an example of using multiple AWS providers to configure two different AWS accounts. In the _sender_ account, the configuration creates a `aws.ram.ResourceShare` and uses a data source in the _receiver_ account to create a `aws.ram.PrincipalAssociation` resource with the _receiver's_ account ID. In the _receiver_ account, the configuration accepts the invitation to share resources with the `aws.ram.ResourceShareAccepter`. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const senderShare = new aws.ram.ResourceShare("sender_share", { * name: "tf-test-resource-share", * allowExternalPrincipals: true, * tags: { * Name: "tf-test-resource-share", * }, * }); * const receiver = aws.getCallerIdentity({}); * const senderInvite = new aws.ram.PrincipalAssociation("sender_invite", { * principal: receiver.then(receiver => receiver.accountId), * resourceShareArn: senderShare.arn, * }); * const receiverAccept = new aws.ram.ResourceShareAccepter("receiver_accept", {shareArn: senderInvite.resourceShareArn}); * ``` * * ## Import * * Using `pulumi import`, import resource share accepters using the resource share ARN. For example: * * ```sh * $ pulumi import aws:ram/resourceShareAccepter:ResourceShareAccepter example arn:aws:ram:us-east-1:123456789012:resource-share/c4b56393-e8d9-89d9-6dc9-883752de4767 * ``` */ class ResourceShareAccepter extends pulumi.CustomResource { /** * Get an existing ResourceShareAccepter 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 ResourceShareAccepter(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ResourceShareAccepter. 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'] === ResourceShareAccepter.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["invitationArn"] = state?.invitationArn; resourceInputs["receiverAccountId"] = state?.receiverAccountId; resourceInputs["region"] = state?.region; resourceInputs["resources"] = state?.resources; resourceInputs["senderAccountId"] = state?.senderAccountId; resourceInputs["shareArn"] = state?.shareArn; resourceInputs["shareId"] = state?.shareId; resourceInputs["shareName"] = state?.shareName; resourceInputs["status"] = state?.status; } else { const args = argsOrState; if (args?.shareArn === undefined && !opts.urn) { throw new Error("Missing required property 'shareArn'"); } resourceInputs["region"] = args?.region; resourceInputs["shareArn"] = args?.shareArn; resourceInputs["invitationArn"] = undefined /*out*/; resourceInputs["receiverAccountId"] = undefined /*out*/; resourceInputs["resources"] = undefined /*out*/; resourceInputs["senderAccountId"] = undefined /*out*/; resourceInputs["shareId"] = undefined /*out*/; resourceInputs["shareName"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ResourceShareAccepter.__pulumiType, name, resourceInputs, opts); } } exports.ResourceShareAccepter = ResourceShareAccepter; /** @internal */ ResourceShareAccepter.__pulumiType = 'aws:ram/resourceShareAccepter:ResourceShareAccepter'; //# sourceMappingURL=resourceShareAccepter.js.map