Skip to content

Commit 2d5569b

Browse files
committed
feat(ram-share): support aws v6
1 parent 11476c3 commit 2d5569b

File tree

6 files changed

+34
-6
lines changed

6 files changed

+34
-6
lines changed

modules/ram-share/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ This module creates following resources.
1111

1212
| Name | Version |
1313
|------|---------|
14-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.6 |
15-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.29 |
14+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.12 |
15+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.12 |
1616

1717
## Providers
1818

@@ -39,10 +39,11 @@ This module creates following resources.
3939
| Name | Description | Type | Default | Required |
4040
|------|-------------|------|---------|:--------:|
4141
| <a name="input_name"></a> [name](#input\_name) | (Required) The name of the resource share. | `string` | n/a | yes |
42-
| <a name="input_external_principals_allowed"></a> [external\_principals\_allowed](#input\_external\_principals\_allowed) | (Optional) Indicates whether principals outside your organization can be associated with a resource share. | `bool` | `false` | no |
42+
| <a name="input_external_principals_allowed"></a> [external\_principals\_allowed](#input\_external\_principals\_allowed) | (Optional) Indicates whether principals outside your organization can be associated with a resource share. Defaults to `false`. | `bool` | `false` | no |
4343
| <a name="input_module_tags_enabled"></a> [module\_tags\_enabled](#input\_module\_tags\_enabled) | (Optional) Whether to create AWS Resource Tags for the module informations. | `bool` | `true` | no |
4444
| <a name="input_permissions"></a> [permissions](#input\_permissions) | (Optional) A list of the names of the RAM permission to associate with the resource share. If you do not specify, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share. | `list(string)` | `[]` | no |
4545
| <a name="input_principals"></a> [principals](#input\_principals) | (Optional) A list of the Amazon Resource Names (ARNs) of the principal to associate with the RAM Resource Share. Possible values are an AWS account ID, an AWS Organizations Organization ARN, or an AWS Organizations Organization Unit ARN. | `list(string)` | `[]` | no |
46+
| <a name="input_region"></a> [region](#input\_region) | (Optional) The region in which to create the module resources. If not provided, the module resources will be created in the provider's configured region. | `string` | `null` | no |
4647
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group) | (Optional) A configurations of Resource Group for this module. `resource_group` as defined below.<br/> (Optional) `enabled` - Whether to create Resource Group to find and group AWS resources which are created by this module. Defaults to `true`.<br/> (Optional) `name` - The name of Resource Group. A Resource Group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with `AWS` or `aws`. If not provided, a name will be generated using the module name and instance name.<br/> (Optional) `description` - The description of Resource Group. Defaults to `Managed by Terraform.`. | <pre>object({<br/> enabled = optional(bool, true)<br/> name = optional(string, "")<br/> description = optional(string, "Managed by Terraform.")<br/> })</pre> | `{}` | no |
4748
| <a name="input_resources"></a> [resources](#input\_resources) | (Optional) A list of the Amazon Resource Names (ARNs) of the resource to associate with the RAM Resource Share. | `list(string)` | `[]` | no |
4849
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) A map of tags to add to all resources. | `map(string)` | `{}` | no |
@@ -57,6 +58,7 @@ This module creates following resources.
5758
| <a name="output_name"></a> [name](#output\_name) | The name of the resource share. |
5859
| <a name="output_permissions"></a> [permissions](#output\_permissions) | A list of the Amazon Resource Names (ARNs) of the RAM permission associated with the resource share. |
5960
| <a name="output_principals"></a> [principals](#output\_principals) | A list of the Amazon Resource Names (ARNs) of the principal associated with the resource share. |
61+
| <a name="output_region"></a> [region](#output\_region) | The AWS region this module resources resides in. |
6062
| <a name="output_resource_group"></a> [resource\_group](#output\_resource\_group) | The resource group created to manage resources in this module. |
6163
| <a name="output_resources"></a> [resources](#output\_resources) | A list of the Amazon Resource Names (ARNs) of the resource associated with the resource share. |
6264
<!-- END_TF_DOCS -->

modules/ram-share/main.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ locals {
2121
]
2222
}
2323

24+
25+
###################################################
26+
# Resource Share
27+
###################################################
28+
2429
resource "aws_ram_resource_share" "this" {
30+
region = var.region
31+
2532
name = var.name
2633

2734
allow_external_principals = var.external_principals_allowed
@@ -44,6 +51,8 @@ resource "aws_ram_resource_share" "this" {
4451
resource "aws_ram_principal_association" "this" {
4552
for_each = toset(var.principals)
4653

54+
region = var.region
55+
4756
resource_share_arn = aws_ram_resource_share.this.arn
4857
principal = each.value
4958
}
@@ -56,6 +65,8 @@ resource "aws_ram_principal_association" "this" {
5665
resource "aws_ram_resource_association" "this" {
5766
for_each = toset(var.resources)
5867

68+
region = var.region
69+
5970
resource_share_arn = aws_ram_resource_share.this.arn
6071
resource_arn = each.value
6172
}

modules/ram-share/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
output "region" {
2+
description = "The AWS region this module resources resides in."
3+
value = aws_ram_resource_share.this.region
4+
}
5+
16
output "name" {
27
description = "The name of the resource share."
38
value = aws_ram_resource_share.this.name

modules/ram-share/resource-group.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ module "resource_group" {
1616

1717
count = (var.resource_group.enabled && var.module_tags_enabled) ? 1 : 0
1818

19+
region = var.region
20+
1921
name = local.resource_group_name
2022
description = var.resource_group.description
2123

modules/ram-share/variables.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
variable "region" {
2+
description = "(Optional) The region in which to create the module resources. If not provided, the module resources will be created in the provider's configured region."
3+
type = string
4+
default = null
5+
nullable = true
6+
}
7+
18
variable "name" {
29
description = "(Required) The name of the resource share."
310
type = string
11+
nullable = false
412
}
513

614
variable "external_principals_allowed" {
7-
description = "(Optional) Indicates whether principals outside your organization can be associated with a resource share."
15+
description = "(Optional) Indicates whether principals outside your organization can be associated with a resource share. Defaults to `false`."
816
type = bool
917
default = false
1018
nullable = false

modules/ram-share/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 1.6"
2+
required_version = ">= 1.12"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.29"
7+
version = ">= 6.12"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)