Skip to content

Commit bb1eb41

Browse files
committed
provider v6 upgrade
1 parent 6f7113e commit bb1eb41

File tree

19 files changed

+69
-34
lines changed

19 files changed

+69
-34
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.96.1
3+
rev: v1.99.4
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_wrapper_module_for_each

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
143143

144144
| Name | Version |
145145
|------|---------|
146-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
147-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.90 |
146+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10 |
147+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0 |
148148

149149
## Providers
150150

151151
| Name | Version |
152152
|------|---------|
153-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.90 |
153+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.0 |
154154

155155
## Modules
156156

@@ -215,6 +215,7 @@ No modules.
215215
| <a name="input_off_peak_window_options"></a> [off\_peak\_window\_options](#input\_off\_peak\_window\_options) | Configuration to add Off Peak update options | `any` | <pre>{<br/> "enabled": true,<br/> "off_peak_window": {<br/> "hours": 7<br/> }<br/>}</pre> | no |
216216
| <a name="input_outbound_connections"></a> [outbound\_connections](#input\_outbound\_connections) | Map of AWS OpenSearch outbound connections to create | `any` | `{}` | no |
217217
| <a name="input_package_associations"></a> [package\_associations](#input\_package\_associations) | Map of package association IDs to associate with the domain | `map(string)` | `{}` | no |
218+
| <a name="input_region"></a> [region](#input\_region) | Region where this resource will be managed. Defaults to the Region set in the provider configuration | `string` | `null` | no |
218219
| <a name="input_saml_options"></a> [saml\_options](#input\_saml\_options) | SAML authentication options for an AWS OpenSearch Domain | `any` | `{}` | no |
219220
| <a name="input_security_group_description"></a> [security\_group\_description](#input\_security\_group\_description) | Description of the security group created | `string` | `null` | no |
220221
| <a name="input_security_group_name"></a> [security\_group\_name](#input\_security\_group\_name) | Name to use on security group created | `string` | `null` | no |

examples/collection/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ Note that this example may create resources which will incur monetary charges on
1919

2020
| Name | Version |
2121
|------|---------|
22-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.90 |
22+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.90 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.0 |
3030

3131
## Modules
3232

@@ -35,7 +35,7 @@ Note that this example may create resources which will incur monetary charges on
3535
| <a name="module_opensearch_collection_disabled"></a> [opensearch\_collection\_disabled](#module\_opensearch\_collection\_disabled) | ../../modules/collection | n/a |
3636
| <a name="module_opensearch_collection_private"></a> [opensearch\_collection\_private](#module\_opensearch\_collection\_private) | ../../modules/collection | n/a |
3737
| <a name="module_opensearch_collection_public"></a> [opensearch\_collection\_public](#module\_opensearch\_collection\_public) | ../../modules/collection | n/a |
38-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |
38+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |
3939

4040
## Resources
4141

examples/collection/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ module "opensearch_collection_disabled" {
6767

6868
module "vpc" {
6969
source = "terraform-aws-modules/vpc/aws"
70-
version = "~> 5.0"
70+
version = "~> 6.0"
7171

7272
name = local.name
7373
cidr = local.vpc_cidr

examples/collection/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.0"
2+
required_version = ">= 1.10"
33

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

examples/complete/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ Note that this example may create resources which will incur monetary charges on
2525

2626
| Name | Version |
2727
|------|---------|
28-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
29-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.90 |
28+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10 |
29+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0 |
3030

3131
## Providers
3232

3333
| Name | Version |
3434
|------|---------|
35-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.90 |
35+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.0 |
3636

3737
## Modules
3838

3939
| Name | Source | Version |
4040
|------|--------|---------|
4141
| <a name="module_opensearch"></a> [opensearch](#module\_opensearch) | ../.. | n/a |
4242
| <a name="module_opensearch_disabled"></a> [opensearch\_disabled](#module\_opensearch\_disabled) | ../.. | n/a |
43-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |
43+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |
4444

4545
## Resources
4646

examples/complete/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ module "opensearch_disabled" {
175175

176176
module "vpc" {
177177
source = "terraform-aws-modules/vpc/aws"
178-
version = "~> 5.0"
178+
version = "~> 6.0"
179179

180180
name = local.name
181181
cidr = local.vpc_cidr

examples/complete/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.0"
2+
required_version = ">= 1.10"
33

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

main.tf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ data "aws_iam_session_context" "current" {
1515
locals {
1616
account_id = try(data.aws_caller_identity.current[0].account_id, "")
1717
partition = try(data.aws_partition.current[0].partition, "")
18-
region = try(data.aws_region.current[0].name, "")
18+
region = try(data.aws_region.current[0].region, "")
1919

2020
static_domain_arn = "arn:${local.partition}:es:${local.region}:${local.account_id}:domain/${var.domain_name}"
2121

@@ -226,6 +226,8 @@ resource "aws_opensearch_domain" "this" {
226226
}
227227
}
228228

229+
region = var.region
230+
229231
dynamic "software_update_options" {
230232
for_each = length(var.software_update_options) > 0 ? [var.software_update_options] : []
231233

@@ -260,6 +262,7 @@ resource "aws_opensearch_package_association" "this" {
260262

261263
package_id = try(each.value.package_id, each.key)
262264
domain_name = aws_opensearch_domain.this[0].domain_name
265+
region = try(each.value.region, var.region)
263266
}
264267

265268
################################################################################
@@ -270,6 +273,7 @@ resource "aws_opensearch_vpc_endpoint" "this" {
270273
for_each = { for k, v in var.vpc_endpoints : k => v if var.create }
271274

272275
domain_arn = aws_opensearch_domain.this[0].arn
276+
region = try(each.value.region, var.region)
273277

274278
vpc_options {
275279
security_group_ids = try(each.value.security_group_ids, null)
@@ -290,6 +294,7 @@ resource "aws_opensearch_domain_policy" "this" {
290294

291295
domain_name = aws_opensearch_domain.this[0].domain_name
292296
access_policies = local.create_access_policy ? data.aws_iam_policy_document.this[0].json : var.access_policies
297+
region = var.region
293298
}
294299

295300
data "aws_iam_policy_document" "this" {
@@ -350,6 +355,7 @@ resource "aws_opensearch_domain_saml_options" "this" {
350355
count = var.create && var.create_saml_options ? 1 : 0
351356

352357
domain_name = aws_opensearch_domain.this[0].domain_name
358+
region = var.region
353359

354360
dynamic "saml_options" {
355361
for_each = length(var.saml_options) > 0 ? [var.saml_options] : []
@@ -385,6 +391,7 @@ resource "aws_opensearch_outbound_connection" "this" {
385391
accept_connection = try(each.value.accept_connection, null)
386392
connection_alias = try(each.value.connection_alias, each.key)
387393
connection_mode = each.value.connection_mode
394+
region = try(each.value.region, var.region)
388395

389396
dynamic "connection_properties" {
390397
for_each = try([each.value.connection_properties], [])
@@ -429,6 +436,7 @@ resource "aws_cloudwatch_log_group" "this" {
429436
kms_key_id = try(each.value.log_group_kms_key_id, var.cloudwatch_log_group_kms_key_id)
430437
skip_destroy = try(each.value.log_group_skip_destroy, var.cloudwatch_log_group_skip_destroy)
431438
log_group_class = try(each.value.log_group_class, var.cloudwatch_log_group_class)
439+
region = try(each.value.region, var.region)
432440

433441
tags = merge(local.tags, try(each.value.log_group_tags, {}))
434442
}
@@ -471,6 +479,7 @@ resource "aws_cloudwatch_log_resource_policy" "this" {
471479

472480
policy_document = data.aws_iam_policy_document.cloudwatch[0].json
473481
policy_name = coalesce(var.cloudwatch_log_resource_policy_name, "opensearch-${var.domain_name}")
482+
region = var.region
474483
}
475484

476485
################################################################################
@@ -495,6 +504,7 @@ resource "aws_security_group" "this" {
495504
name_prefix = var.security_group_use_name_prefix ? "${local.security_group_name}-" : null
496505
description = var.security_group_description
497506
vpc_id = data.aws_subnet.this[0].vpc_id
507+
region = var.region
498508
revoke_rules_on_delete = true
499509

500510
tags = merge(local.tags, var.security_group_tags)
@@ -519,6 +529,7 @@ resource "aws_vpc_security_group_ingress_rule" "this" {
519529
prefix_list_id = lookup(each.value, "prefix_list_id", null)
520530
referenced_security_group_id = lookup(each.value, "referenced_security_group_id", null)
521531
to_port = try(each.value.to_port, 443)
532+
region = try(each.value.region, var.region)
522533

523534
tags = merge(local.tags, var.security_group_tags, try(each.value.tags, {}))
524535
}
@@ -538,6 +549,7 @@ resource "aws_vpc_security_group_egress_rule" "this" {
538549
prefix_list_id = lookup(each.value, "prefix_list_id", null)
539550
referenced_security_group_id = lookup(each.value, "referenced_security_group_id", null)
540551
to_port = try(each.value.to_port, null)
552+
region = try(each.value.region, var.region)
541553

542554
tags = merge(local.tags, var.security_group_tags, try(each.value.tags, {}))
543555
}

modules/collection/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
4141

4242
| Name | Version |
4343
|------|---------|
44-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
45-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.90 |
44+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10 |
45+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0 |
4646

4747
## Providers
4848

4949
| Name | Version |
5050
|------|---------|
51-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.90 |
51+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.0 |
5252

5353
## Modules
5454

@@ -92,6 +92,7 @@ No modules.
9292
| <a name="input_network_policy"></a> [network\_policy](#input\_network\_policy) | Network policy to apply to the collection | `any` | `{}` | no |
9393
| <a name="input_network_policy_description"></a> [network\_policy\_description](#input\_network\_policy\_description) | Description of the network policy | `string` | `null` | no |
9494
| <a name="input_network_policy_name"></a> [network\_policy\_name](#input\_network\_policy\_name) | Name of the network policy | `string` | `null` | no |
95+
| <a name="input_region"></a> [region](#input\_region) | Region where this resource will be managed. Defaults to the Region set in the provider configuration | `string` | `null` | no |
9596
| <a name="input_standby_replicas"></a> [standby\_replicas](#input\_standby\_replicas) | Indicates whether standby replicas should be used for a collection. One of ENABLED or DISABLED. Defaults to ENABLED. | `string` | `null` | no |
9697
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |
9798
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Create and delete timeout configurations for the collection | `map(string)` | `{}` | no |

modules/collection/main.tf

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ resource "aws_opensearchserverless_collection" "this" {
1515

1616
description = var.description
1717
name = var.name
18+
region = var.region
1819
type = var.type
1920
standby_replicas = var.standby_replicas
2021

@@ -54,7 +55,8 @@ resource "aws_opensearchserverless_security_policy" "encryption" {
5455
var.encryption_policy
5556
))
5657

57-
type = "encryption"
58+
region = var.region
59+
type = "encryption"
5860
}
5961

6062
################################################################################
@@ -83,7 +85,8 @@ resource "aws_opensearchserverless_security_policy" "network" {
8385
var.network_policy
8486
)])
8587

86-
type = "network"
88+
region = var.region
89+
type = "network"
8790
}
8891

8992
################################################################################
@@ -113,7 +116,9 @@ resource "aws_opensearchserverless_access_policy" "this" {
113116
},
114117
var.access_policy
115118
)])
116-
type = "data"
119+
120+
region = var.region
121+
type = "data"
117122
}
118123

119124
################################################################################
@@ -138,5 +143,7 @@ resource "aws_opensearchserverless_lifecycle_policy" "this" {
138143
]
139144
}
140145
)
141-
type = "retention"
146+
147+
region = var.region
148+
type = "retention"
142149
}

modules/collection/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ variable "create" {
44
default = true
55
}
66

7+
variable "region" {
8+
description = "Region where this resource will be managed. Defaults to the Region set in the provider configuration"
9+
type = string
10+
default = null
11+
}
12+
713
variable "tags" {
814
description = "A map of tags to add to all resources"
915
type = map(string)

modules/collection/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.0"
2+
required_version = ">= 1.10"
33

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

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ variable "off_peak_window_options" {
125125
}
126126
}
127127

128+
variable "region" {
129+
description = "Region where this resource will be managed. Defaults to the Region set in the provider configuration"
130+
type = string
131+
default = null
132+
}
133+
128134
variable "software_update_options" {
129135
description = "Software update options for the domain"
130136
type = any

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.0"
2+
required_version = ">= 1.10"
33

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

wrappers/collection/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module "wrapper" {
2626
network_policy = try(each.value.network_policy, var.defaults.network_policy, {})
2727
network_policy_description = try(each.value.network_policy_description, var.defaults.network_policy_description, null)
2828
network_policy_name = try(each.value.network_policy_name, var.defaults.network_policy_name, null)
29+
region = try(each.value.region, var.defaults.region, null)
2930
standby_replicas = try(each.value.standby_replicas, var.defaults.standby_replicas, null)
3031
tags = try(each.value.tags, var.defaults.tags, {})
3132
timeouts = try(each.value.timeouts, var.defaults.timeouts, {})

wrappers/collection/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.0"
2+
required_version = ">= 1.10"
33

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

wrappers/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ module "wrapper" {
6262
})
6363
outbound_connections = try(each.value.outbound_connections, var.defaults.outbound_connections, {})
6464
package_associations = try(each.value.package_associations, var.defaults.package_associations, {})
65+
region = try(each.value.region, var.defaults.region, null)
6566
saml_options = try(each.value.saml_options, var.defaults.saml_options, {})
6667
security_group_description = try(each.value.security_group_description, var.defaults.security_group_description, null)
6768
security_group_name = try(each.value.security_group_name, var.defaults.security_group_name, null)

wrappers/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.0"
2+
required_version = ">= 1.10"
33

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

0 commit comments

Comments
 (0)