Skip to content

Commit

Permalink
add locking support to the -write policy
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Aug 27, 2025
1 parent d6f1a1b commit 4dba20e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion terraform-state/policy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ data "aws_iam_policy_document" "tfstate" {
}

# https://developer.hashicorp.com/terraform/language/backend/s3

statement {
sid = "TFRemoteStateLocking"
effect = "Allow"
Expand Down Expand Up @@ -175,6 +174,17 @@ data "aws_iam_policy_document" "tfstate_write" {
]
resources = ["${aws_s3_bucket.tfstate.arn}/*"]
}
# https://developer.hashicorp.com/terraform/language/backend/s3
statement {
sid = "TFRemoteStateLocking"
effect = "Allow"
resources = ["${aws_s3_bucket.tfstate.arn}/*.tflock"]
actions = [
# "s3:GetObject",
# "s3:PutObject"
"s3:DeleteObject"
]
}
statement {
sid = "TFRemoteStateDDB"
effect = "Allow"
Expand Down

0 comments on commit 4dba20e

Please sign in to comment.