UNPKG

@pulumi/aws

Version:

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

121 lines (120 loc) 5.79 kB
import * as pulumi from "@pulumi/pulumi"; /** * Provides a Resource Access Manager (RAM) principal association. Depending if [RAM Sharing with AWS Organizations is enabled](https://docs.aws.amazon.com/ram/latest/userguide/getting-started-sharing.html#getting-started-sharing-orgs), the RAM behavior with different principal types changes. * * When RAM Sharing with AWS Organizations is enabled: * * - For AWS Account ID, Organization, and Organizational Unit principals within the same AWS Organization, no resource share invitation is sent and resources become available automatically after creating the association. * - For AWS Account ID principals outside the AWS Organization, a resource share invitation is sent and must be accepted before resources become available. See the `aws.ram.ResourceShareAccepter` resource to accept these invitations. * * When RAM Sharing with AWS Organizations is not enabled: * * - Organization and Organizational Unit principals cannot be used. * - For AWS Account ID principals, a resource share invitation is sent and must be accepted before resources become available. See the `aws.ram.ResourceShareAccepter` resource to accept these invitations. * * ## Example Usage * * ### AWS Account ID * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ram.ResourceShare("example", {allowExternalPrincipals: true}); * const examplePrincipalAssociation = new aws.ram.PrincipalAssociation("example", { * principal: "111111111111", * resourceShareArn: example.arn, * }); * ``` * * ### AWS Organization * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ram.PrincipalAssociation("example", { * principal: exampleAwsOrganizationsOrganization.arn, * resourceShareArn: exampleAwsRamResourceShare.arn, * }); * ``` * * ## Import * * Using `pulumi import`, import RAM Principal Associations using their Resource Share ARN and the `principal` separated by a comma. For example: * * ```sh * $ pulumi import aws:ram/principalAssociation:PrincipalAssociation example arn:aws:ram:eu-west-1:123456789012:resource-share/73da1ab9-b94a-4ba3-8eb4-45917f7f4b12,123456789012 * ``` */ export declare class PrincipalAssociation extends pulumi.CustomResource { /** * Get an existing PrincipalAssociation 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: string, id: pulumi.Input<pulumi.ID>, state?: PrincipalAssociationState, opts?: pulumi.CustomResourceOptions): PrincipalAssociation; /** * Returns true if the given object is an instance of PrincipalAssociation. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is PrincipalAssociation; /** * The principal to associate with the resource share. Possible values are an AWS account ID, an AWS Organizations Organization ARN, or an AWS Organizations Organization Unit ARN. */ readonly principal: pulumi.Output<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * The Amazon Resource Name (ARN) of the resource share. */ readonly resourceShareArn: pulumi.Output<string>; /** * Create a PrincipalAssociation 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: string, args: PrincipalAssociationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering PrincipalAssociation resources. */ export interface PrincipalAssociationState { /** * The principal to associate with the resource share. Possible values are an AWS account ID, an AWS Organizations Organization ARN, or an AWS Organizations Organization Unit ARN. */ principal?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * The Amazon Resource Name (ARN) of the resource share. */ resourceShareArn?: pulumi.Input<string>; } /** * The set of arguments for constructing a PrincipalAssociation resource. */ export interface PrincipalAssociationArgs { /** * The principal to associate with the resource share. Possible values are an AWS account ID, an AWS Organizations Organization ARN, or an AWS Organizations Organization Unit ARN. */ principal: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * The Amazon Resource Name (ARN) of the resource share. */ resourceShareArn: pulumi.Input<string>; }