File tree 3 files changed +25
-0
lines changed
3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Creates a role useful for running `terraform plan` in CI jobs.
10
10
| iam\_ path | | string | ` "/" ` | no |
11
11
| role\_ name | | string | ` "infraci" ` | no |
12
12
| 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
14
14
15
## Outputs
15
16
Original file line number Diff line number Diff line change @@ -63,6 +63,24 @@ data "aws_iam_policy_document" "secrets" {
63
63
values = [" true" ]
64
64
}
65
65
}
66
+
67
+ dynamic statement {
68
+
69
+ for_each = compact ([var . terraform_state_lock_dynamodb_arn ])
70
+
71
+
72
+ content {
73
+ sid = " statefileaccess"
74
+
75
+ actions = [
76
+ " dynamodb:GetItem" ,
77
+ " dynamodb:PutItem" ,
78
+ " dynamodb:DeleteItem" ,
79
+ ]
80
+
81
+ resources = [statement . value ]
82
+ }
83
+ }
66
84
}
67
85
68
86
resource "aws_iam_policy" "secrets" {
Original file line number Diff line number Diff line change @@ -9,3 +9,9 @@ variable "role_name" {
9
9
variable "iam_path" {
10
10
default = " /"
11
11
}
12
+
13
+ variable "terraform_state_lock_dynamodb_arn" {
14
+ type = " string"
15
+ default = " "
16
+ description = " The ARN of the state file DynamoDB table"
17
+ }
You can’t perform that action at this time.
0 commit comments