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

main.tf#L2
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
main.tf#L32
resource "aws_ram_resource_share_accepter" "this" {
  provider  = aws.protected
  share_arn = [time_sleep.ram_resource_propagation.triggers["tgw_resource_arn"]]
}
main.tf#L1
resource "aws_ram_resource_share_accepter" "this" {
  share_arn = var.resource_share_arn
}
main.tf#L7
resource "aws_ram_resource_share_accepter" "this" {
  share_arn = var.share_arn

  dynamic "timeouts" {
    for_each = var.timeouts
    content {
ram_resource_share_accepter.tf#L4
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 {

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

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

1-BIU_transitgwprod.yml#L34
    Type: AWS::RAM::ResourceShare
    DependsOn: TransitGateway
    Properties:
      AllowExternalPrincipals: false
      Name: "Transit Gateway Resource Share"
      ResourceArns:
2-BIU_transitgwprod.yml#L34
    Type: AWS::RAM::ResourceShare
    DependsOn: TransitGateway
    Properties:
      AllowExternalPrincipals: false
      Name: "Transit Gateway Resource Share"
      ResourceArns:
share_resources.yml#L18
    Type: AWS::RAM::ResourceShare
    Properties:
      AllowExternalPrincipals: true
      Name: mesh-share
      Principals:
        - !Ref ConsumerAccountId
share_resources.yml#L18
    Type: AWS::RAM::ResourceShare
    Properties:
      AllowExternalPrincipals: true
      Name: mesh-share
      Principals:
        - !Ref ConsumerAccountId
share_resources.yml#L18
    Type: AWS::RAM::ResourceShare
    Properties:
      AllowExternalPrincipals: true
      Name: mesh-share
      Principals:
        - !Ref ConsumerAccountId
nonprod-resource-share-subnets.json#L46
            "Type": "AWS::RAM::ResourceShare",
            "Properties": {
                "Name": {
                    "Ref": "ResourceShareName"
                },
                "AllowExternalPrincipals": false,
prod-resource-share-subnets.json#L46
            "Type": "AWS::RAM::ResourceShare",
            "Properties": {
                "Name": {
                    "Ref": "ResourceShareName"
                },
                "AllowExternalPrincipals": false,
RAMResourceShareSpecification.json#L22
    "AWS::RAM::ResourceShare": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-resourceshare.html",
      "Attributes": {
        "Arn": {
          "PrimitiveType": "String"
        }
RAMResourceShareSpecification.json#L22
    "AWS::RAM::ResourceShare": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-resourceshare.html",
      "Attributes": {
        "Arn": {
          "PrimitiveType": "String"
        }
RAMResourceShareSpecification.json#L22
    "AWS::RAM::ResourceShare": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-resourceshare.html",
      "Attributes": {
        "Arn": {
          "PrimitiveType": "String"
        }

Parameters

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.