AWS RAM Resource Share Accepter
This page shows how to write Terraform and CloudFormation for AWS RAM Resource Share Accepter and write them securely.
aws_ram_resource_share_accepter (Terraform)
The Resource Share Accepter in AWS RAM can be configured in Terraform with the resource name aws_ram_resource_share_accepter
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_ram_resource_share_accepter" "shared_rules_accept" {
count = length(var.pending_rams)
share_arn = element(var.pending_rams, count.index)
}
#Looking for the shared rules on a Customer Account
resource "aws_ram_resource_share_accepter" "this" {
provider = aws.protected
share_arn = [time_sleep.ram_resource_propagation.triggers["tgw_resource_arn"]]
}
resource "aws_ram_resource_share_accepter" "this" {
share_arn = var.resource_share_arn
}
resource "aws_ram_resource_share_accepter" "this" {
share_arn = var.share_arn
dynamic "timeouts" {
for_each = var.timeouts
content {
resource "aws_ram_resource_share_accepter" "ram_resource_share_accepter" {
count = var.enable_ram_resource_share_accepter ? 1 : 0
share_arn = var.ram_resource_share_accepter_share_arn != "" ? var.ram_resource_share_accepter_share_arn : (var.enable_ram_principal_association ? aws_ram_principal_association.ram_principal_association.0.resource_share_arn : null)
lifecycle {
Parameters
-
id
optional computed - string -
invitation_arn
optional computed - string -
receiver_account_id
optional computed - string -
resources
optional computed - list of string -
sender_account_id
optional computed - string -
share_arn
required - string -
share_id
optional computed - string -
share_name
optional computed - string -
status
optional computed - string -
timeouts
single block
Explanation in Terraform Registry
Manage accepting a Resource Access Manager (RAM) Resource Share invitation. From a receiver AWS account, accept an invitation to share resources that were shared by a sender AWS account. To create a resource share in the sender, see the
aws_ram_resource_share
resource.Note: If both AWS accounts are in the same Organization and RAM Sharing with AWS Organizations is enabled, this resource is not necessary as RAM Resource Share invitations are not used.
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 Accepter?
AWS RAM Resource Share Accepter 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 Accepter?
For Terraform, the banslt/dns_resolver_cross_accounts, eddievaltix/terraform-valtix-modules and plus3it/terraform-aws-tardigrade-ram-share source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the deiselira/aws, deiselira/aws and awsandy/ecs-workshop source code examples are useful. See the CloudFormation Example section for further details.