AWS RAM Resource Share
This page shows how to write Terraform and CloudFormation for AWS RAM Resource Share and write them securely.
aws_ram_resource_share (Terraform)
The Resource Share in AWS RAM can be configured in Terraform with the resource name aws_ram_resource_share
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_ram_resource_share" "rams-prod-1x" {
name = "RAMS-Production-1x"
allow_external_principals = true
tags = {
Environment = "Production"
resource "aws_ram_resource_share" "transit-gateway" {
name = "transit-gateway"
allow_external_principals = false
tags = local.tags
}
resource "aws_ram_resource_share" "this" {
name = "transit-share"
allow_external_principals = true
tags = {
resource "aws_ram_resource_share" "_" {
name = "transit_gateway"
allow_external_principals = false
}
data "aws_organizations_organization" "_" {}
resource "aws_ram_resource_share" "this" {
count = var.ram_enabled ? 1 : 0
name = var.name
tags = merge(var.tags, map("Name", var.name))
}
Parameters
-
allow_external_principals
optional - bool -
arn
optional computed - string -
id
optional computed - string -
name
required - string -
tags
optional - map from string to string -
timeouts
single block
Explanation in Terraform Registry
Manages a Resource Access Manager (RAM) Resource Share. To associate principals with the share, see the
aws_ram_principal_association
resource. To associate resources with the share, see theaws_ram_resource_association
resource.
AWS::RAM::ResourceShare (CloudFormation)
The ResourceShare in RAM can be configured in CloudFormation with the resource name AWS::RAM::ResourceShare
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::RAM::ResourceShare
DependsOn: TransitGateway
Properties:
AllowExternalPrincipals: false
Name: "Transit Gateway Resource Share"
ResourceArns:
Type: AWS::RAM::ResourceShare
DependsOn: TransitGateway
Properties:
AllowExternalPrincipals: false
Name: "Transit Gateway Resource Share"
ResourceArns:
Type: AWS::RAM::ResourceShare
Properties:
AllowExternalPrincipals: true
Name: mesh-share
Principals:
- !Ref ConsumerAccountId
Type: AWS::RAM::ResourceShare
Properties:
AllowExternalPrincipals: true
Name: mesh-share
Principals:
- !Ref ConsumerAccountId
Type: AWS::RAM::ResourceShare
Properties:
AllowExternalPrincipals: true
Name: mesh-share
Principals:
- !Ref ConsumerAccountId
"Type": "AWS::RAM::ResourceShare",
"Properties": {
"Name": {
"Ref": "ResourceShareName"
},
"AllowExternalPrincipals": false,
"Type": "AWS::RAM::ResourceShare",
"Properties": {
"Name": {
"Ref": "ResourceShareName"
},
"AllowExternalPrincipals": false,
"AWS::RAM::ResourceShare": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-resourceshare.html",
"Attributes": {
"Arn": {
"PrimitiveType": "String"
}
"AWS::RAM::ResourceShare": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-resourceshare.html",
"Attributes": {
"Arn": {
"PrimitiveType": "String"
}
"AWS::RAM::ResourceShare": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-resourceshare.html",
"Attributes": {
"Arn": {
"PrimitiveType": "String"
}
Parameters
-
PermissionArns
optional - List -
Principals
optional - List -
AllowExternalPrincipals
optional - Boolean -
ResourceArns
optional - List -
Tags
optional - List of Tag -
Name
required - String
Explanation in CloudFormation Registry
Specifies a resource share.
Frequently asked questions
What is AWS RAM Resource Share?
AWS RAM Resource Share 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 Share?
For Terraform, the trilogy-group/CENPRO-24625, ministryofjustice/modernisation-platform and BorisLabs/terraform-aws-transit-gateway source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the deiselira/aws, deiselira/aws and aws/aws-app-mesh-examples source code examples are useful. See the CloudFormation Example section for further details.