AWS RAM Resource Association

This page shows how to write Terraform and CloudFormation for AWS RAM Resource Association and write them securely.

code-icon

Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.

get-started-button

Terraform Example (aws_ram_resource_association)

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 and AWS service specific documentation for additional information.

Parameters

Example Usage (from GitHub)

github-icontrilogy-group/CENPRO-24625
resource "aws_ram_resource_association" "ram-prod-priv-1x" {
  resource_arn       = aws_subnet.privsubnet-1.arn
  resource_share_arn = aws_ram_resource_share.rams-prod-1x.arn
}

resource "aws_ram_resource_association" "ram-prod-priv-1y" {
github-iconministryofjustice/modernisation-platform
resource "aws_ram_resource_association" "transit-gateway" {
  resource_arn       = aws_ec2_transit_gateway.transit-gateway.arn
  resource_share_arn = aws_ram_resource_share.transit-gateway.id
}

# Create a resource share for the Certificate Manager
github-iconcicdenv/cicdenv
resource "aws_ram_resource_association" "internet" {
  resource_share_arn = aws_ram_resource_share.internet.arn
  resource_arn       = aws_ec2_transit_gateway.internet.arn
}

resource "aws_ram_principal_association" "internet" {
github-iconGSA/grace-paas-dns
resource "aws_ram_resource_association" "internal_rule" {
  count              = var.is_hub ? 1 : 0
  resource_arn       = aws_route53_resolver_rule.forward_internal[0]
  resource_share_arn = aws_ram_resource_share.dns[0]
}

github-iconinfraxys-aws/aws-ec2
resource "aws_ram_resource_association" "$instance.getAttribute("association_name")" {
  resource_arn       = $instance.getAttribute("resource_arn")
  resource_share_arn = $instance.getAttribute("resource_share_arn")

CloudFormation Example (AWS::RAM::ResourceShare)

Specifies a resource share.

Parameters

Frequently asked questions

What is AWS RAM Resource Association?

AWS RAM Resource Association is a resource for RAM of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS RAM Resource Association?

For Terraform, the trilogy-group/CENPRO-24625, ministryofjustice/modernisation-platform and cicdenv/cicdenv source code examples are useful. See the Terraform Example section for further details.