Package com.pulumi.aws.ram
Class PrincipalAssociation
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.ram.PrincipalAssociation
-
public class PrincipalAssociation extends com.pulumi.resources.CustomResourceProvides 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
### AWS Organizationpackage generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.ram.ResourceShare; import com.pulumi.aws.ram.ResourceShareArgs; import com.pulumi.aws.ram.PrincipalAssociation; import com.pulumi.aws.ram.PrincipalAssociationArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var example = new ResourceShare("example", ResourceShareArgs.builder() .allowExternalPrincipals(true) .build()); var examplePrincipalAssociation = new PrincipalAssociation("examplePrincipalAssociation", PrincipalAssociationArgs.builder() .principal("111111111111") .resourceShareArn(example.arn()) .build()); } }
## Import ### Identity Schema #### Required * `principal` (String) Principal associated with the resource share. * `resourceShareArn` (String) ARN of the resource share. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. 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 ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.ram.PrincipalAssociation; import com.pulumi.aws.ram.PrincipalAssociationArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var example = new PrincipalAssociation("example", PrincipalAssociationArgs.builder() .principal(exampleAwsOrganizationsOrganization.arn()) .resourceShareArn(exampleAwsRamResourceShare.arn()) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description PrincipalAssociation(java.lang.String name)PrincipalAssociation(java.lang.String name, PrincipalAssociationArgs args)PrincipalAssociation(java.lang.String name, PrincipalAssociationArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PrincipalAssociationget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, PrincipalAssociationState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>principal()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.lang.String>resourceShareArn()
-
-
-
Constructor Detail
-
PrincipalAssociation
public PrincipalAssociation(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
PrincipalAssociation
public PrincipalAssociation(java.lang.String name, PrincipalAssociationArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
PrincipalAssociation
public PrincipalAssociation(java.lang.String name, PrincipalAssociationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
principal
public com.pulumi.core.Output<java.lang.String> principal()
- Returns:
- 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.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- 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.
-
resourceShareArn
public com.pulumi.core.Output<java.lang.String> resourceShareArn()
- Returns:
- ARN of the resource share.
-
get
public static PrincipalAssociation get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable PrincipalAssociationState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-