File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -161,9 +161,9 @@ resource "aws_ram_resource_association" "this" {
161
161
}
162
162
163
163
resource "aws_ram_principal_association" "this" {
164
- count = var. create_tgw && var. share_tgw ? length (var. ram_principals ) : 0
164
+ for_each = var. create_tgw && var. share_tgw ? toset (var. ram_principals ) : []
165
165
166
- principal = var . ram_principals [ count . index ]
166
+ principal = each . value
167
167
resource_share_arn = aws_ram_resource_share. this [0 ]. arn
168
168
}
169
169
Original file line number Diff line number Diff line change @@ -96,5 +96,5 @@ output "ram_resource_share_id" {
96
96
97
97
output "ram_principal_association_id" {
98
98
description = " The Amazon Resource Name (ARN) of the Resource Share and the principal, separated by a comma"
99
- value = try ( aws_ram_principal_association. this [ 0 ] . id , " " )
99
+ value = [ for k , v in aws_ram_principal_association . this : v . id ]
100
100
}
You can’t perform that action at this time.
0 commit comments