1
- data "aws_region" "current" {
2
- count = var. create ? 1 : 0
3
- }
4
1
data "aws_partition" "current" {
5
2
count = var. create ? 1 : 0
6
3
}
@@ -15,9 +12,8 @@ data "aws_iam_session_context" "current" {
15
12
locals {
16
13
account_id = try (data. aws_caller_identity . current [0 ]. account_id , " " )
17
14
partition = try (data. aws_partition . current [0 ]. partition , " " )
18
- region = try (data. aws_region . current [0 ]. region , " " )
19
15
20
- static_domain_arn = " arn:${ local . partition } :es:${ local . region } :${ local . account_id } :domain/${ var . domain_name } "
16
+ static_domain_arn = " arn:${ local . partition } :es:${ var . region } :${ local . account_id } :domain/${ var . domain_name } "
21
17
22
18
tags = merge (var. tags , { terraform-aws-modules = " opensearch" })
23
19
}
@@ -409,7 +405,7 @@ resource "aws_opensearch_outbound_connection" "this" {
409
405
410
406
local_domain_info {
411
407
owner_id = try (each. value . local_domain_info . owner_id , local. account_id )
412
- region = try (each. value . local_domain_info . region , local . region )
408
+ region = try (each. value . local_domain_info . region , var . region )
413
409
domain_name = try (each. value . local_domain_info . domain_name , aws_opensearch_domain. this [0 ]. domain_name )
414
410
}
415
411
@@ -494,7 +490,8 @@ locals {
494
490
data "aws_subnet" "this" {
495
491
count = local. create_security_group ? 1 : 0
496
492
497
- id = element (var. vpc_options . subnet_ids , 0 )
493
+ region = var. region
494
+ id = element (var. vpc_options . subnet_ids , 0 )
498
495
}
499
496
500
497
resource "aws_security_group" "this" {
0 commit comments