Provides a Resource Access Manager (RAM) principal association. Depending if RAM Sharing with AWS Organizations is enabled, the RAM behavior with different principal types changes.
When RAM Sharing with AWS Organizations is enabled:
aws_ram_resource_share_accepter
resource to accept these invitations.When RAM Sharing with AWS Organizations is not enabled:
aws_ram_resource_share_accepter
resource to accept these invitations.resource "aws_ram_resource_share" "example" {
# ... other configuration ...
allow_external_principals = true
}
resource "aws_ram_principal_association" "example" {
principal = "111111111111"
resource_share_arn = aws_ram_resource_share.example.arn
}
resource "aws_ram_principal_association" "example" {
principal = aws_organizations_organization.example.arn
resource_share_arn = aws_ram_resource_share.example.arn
}
This resource supports the following arguments:
principal
- (Required) 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.resource_share_arn
- (Required) The Amazon Resource Name (ARN) of the resource share.This resource exports the following attributes in addition to the arguments above:
id
- The Amazon Resource Name (ARN) of the Resource Share and the principal, separated by a comma.In Terraform v1.5.0 and later, use an import
block to import RAM Principal Associations using their Resource Share ARN and the principal
separated by a comma. For example:
import {
to = aws_ram_principal_association.example
id = "arn:aws:ram:eu-west-1:123456789012:resource-share/73da1ab9-b94a-4ba3-8eb4-45917f7f4b12,123456789012"
}
Using terraform import
, import RAM Principal Associations using their Resource Share ARN and the principal
separated by a comma. For example:
% terraform import aws_ram_principal_association.example arn:aws:ram:eu-west-1:123456789012:resource-share/73da1ab9-b94a-4ba3-8eb4-45917f7f4b12,123456789012