Skip to content

Commit 9bcd84c

Browse files
authored
[breaking] Modified infraci role to accept a list of dyanmodb table arns (#130)
* testing change with list of arns * allowing infraci to accept multiple dynamodb table arns * removed duplicates from arn list in dynamic statement * unique SIDs
1 parent bcb32ff commit 9bcd84c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

aws-iam-role-infraci/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Creates a role useful for running `terraform plan` in CI jobs.
1010
| iam\_path | | string | `"/"` | no |
1111
| role\_name | | string | `"infraci"` | no |
1212
| source\_account\_id | | string | n/a | yes |
13-
| terraform\_state\_lock\_dynamodb\_arn | "The unique identifier (ARN) of the state file DynamoDB table" | string | `""` | yes |
13+
| terraform\_state\_lock\_dynamodb\_arns | "A list of unique identifiers (ARNs) of state file DynamoDB tables" | string | `[]` | yes |
1414

1515
## Outputs
1616

aws-iam-role-infraci/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ data "aws_iam_policy_document" "secrets" {
6666

6767
dynamic statement {
6868

69-
for_each = compact([var.terraform_state_lock_dynamodb_arn])
69+
for_each = var.terraform_state_lock_dynamodb_arns
7070

7171

7272
content {
73-
sid = "statefileaccess"
73+
sid = "statefileaccess${statement.key}"
7474

7575
actions = [
7676
"dynamodb:GetItem",

aws-iam-role-infraci/variables.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ variable "iam_path" {
1010
default = "/"
1111
}
1212

13-
variable "terraform_state_lock_dynamodb_arn" {
14-
type = "string"
15-
default = ""
16-
description = "The ARN of the state file DynamoDB table"
13+
variable "terraform_state_lock_dynamodb_arns" {
14+
type = list(string)
15+
default = []
16+
description = "ARNs of the state file DynamoDB tables"
1717
}

0 commit comments

Comments
 (0)