UNPKG

@pulumi/aws

Version:

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

84 lines 3.86 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.ResourceAssociation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a Resource Access Manager (RAM) Resource Association. * * > *NOTE:* Certain AWS resources (e.g., EC2 Subnets) can only be shared in an AWS account that is a member of an AWS Organizations organization with organization-wide Resource Access Manager functionality enabled. See the [Resource Access Manager User Guide](https://docs.aws.amazon.com/ram/latest/userguide/what-is.html) and AWS service specific documentation for additional information. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ram.ResourceAssociation("example", { * resourceArn: exampleAwsSubnet.arn, * resourceShareArn: exampleAwsRamResourceShare.arn, * }); * ``` * * ## Import * * Using `pulumi import`, import RAM Resource Associations using their Resource Share ARN and Resource ARN separated by a comma. For example: * * ```sh * $ pulumi import aws:ram/resourceAssociation:ResourceAssociation example arn:aws:ram:eu-west-1:123456789012:resource-share/73da1ab9-b94a-4ba3-8eb4-45917f7f4b12,arn:aws:ec2:eu-west-1:123456789012:subnet/subnet-12345678 * ``` */ class ResourceAssociation extends pulumi.CustomResource { /** * Get an existing ResourceAssociation 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 ResourceAssociation(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ResourceAssociation. 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'] === ResourceAssociation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["region"] = state?.region; resourceInputs["resourceArn"] = state?.resourceArn; resourceInputs["resourceShareArn"] = state?.resourceShareArn; } else { const args = argsOrState; if (args?.resourceArn === undefined && !opts.urn) { throw new Error("Missing required property 'resourceArn'"); } if (args?.resourceShareArn === undefined && !opts.urn) { throw new Error("Missing required property 'resourceShareArn'"); } resourceInputs["region"] = args?.region; resourceInputs["resourceArn"] = args?.resourceArn; resourceInputs["resourceShareArn"] = args?.resourceShareArn; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ResourceAssociation.__pulumiType, name, resourceInputs, opts); } } exports.ResourceAssociation = ResourceAssociation; /** @internal */ ResourceAssociation.__pulumiType = 'aws:ram/resourceAssociation:ResourceAssociation'; //# sourceMappingURL=resourceAssociation.js.map