Skip to content

Commit

Permalink
Add resource share module
Browse files Browse the repository at this point in the history
  • Loading branch information
ranikamadurawe committed Jun 19, 2024
1 parent 7a764c0 commit 9971d98
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
27 changes: 27 additions & 0 deletions modules/aws/Resource-Share/resource_share.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
#
# This software is the property of WSO2 LLC. and its suppliers, if any.
# Dissemination of any information or reproduction of any material contained
# herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
# You may not alter or remove any copyright or other notice from copies of this content.
#
# --------------------------------------------------------------------------------------

resource "aws_ram_resource_share" "ram_resource_share" {
name = "terraform-example"
tags = var.tags
}

# Share the transit gateway...
resource "aws_ram_resource_association" "aws_ram_resource_association" {
resource_arn = var.resource_arn
resource_share_arn = aws_ram_resource_share.ram_resource_share.id
}

# ...with the second account.
resource "aws_ram_principal_association" "ram_principal_association" {
principal = var.account_id
resource_share_arn = aws_ram_resource_share.ram_resource_share.id
}
23 changes: 23 additions & 0 deletions modules/aws/Resource-Share/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
#
# This software is the property of WSO2 LLC. and its suppliers, if any.
# Dissemination of any information or reproduction of any material contained
# herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
# You may not alter or remove any copyright or other notice from copies of this content.
#
# --------------------------------------------------------------------------------------

variable "tags" {
type = map(string)
description = "Tags to be added with all resources"
}
variable "resource_arn" {
type = string
description = "ARN of the resource to share"
}
variable "account_id" {
type = string
description = "ID of the account to share the resource with"
}

0 comments on commit 9971d98

Please sign in to comment.