Skip to content

Commit 0c83ece

Browse files
committed
fix: Update s3 backup policy
1 parent 421fc76 commit 0c83ece

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

modules/mpc-backup-vault/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ No modules.
8282

8383
| Name | Description | Type | Default | Required |
8484
|------|-------------|------|---------|:--------:|
85-
| <a name="input_bucket_cross_account_id"></a> [bucket\_cross\_account\_id](#input\_bucket\_cross\_account\_id) | ID of the AWS account that can access the backup bucket. | `string` | n/a | yes |
8685
| <a name="input_bucket_prefix"></a> [bucket\_prefix](#input\_bucket\_prefix) | The prefix for the S3 bucket names | `string` | `"mpc-backup-vault"` | no |
8786
| <a name="input_enable_replication"></a> [enable\_replication](#input\_enable\_replication) | Enable cross-region replication for the backup bucket. | `bool` | `false` | no |
8887
| <a name="input_mpc_backup_replication_role_name"></a> [mpc\_backup\_replication\_role\_name](#input\_mpc\_backup\_replication\_role\_name) | The name of the MPC backup replication role. | `string` | `null` | no |

modules/mpc-backup-vault/main.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ resource "aws_s3_bucket_policy" "backup_bucket" {
6161
Sid = "AllowCrossAccountBackup"
6262
Effect = "Allow"
6363
Principal = {
64-
AWS = "arn:aws:iam::${var.bucket_cross_account_id}:root"
64+
AWS = var.trusted_principal_arns
6565
}
66-
Action = "s3:*"
66+
Action = [
67+
"s3:GetObject",
68+
"s3:PutObject",
69+
"s3:ListBucket"
70+
]
6771
Resource = [
6872
"arn:aws:s3:::${aws_s3_bucket.backup_bucket.id}",
6973
"arn:aws:s3:::${aws_s3_bucket.backup_bucket.id}/*"

modules/mpc-backup-vault/variables.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ variable "trusted_principal_arns" {
3131
default = []
3232
}
3333

34-
variable "bucket_cross_account_id" {
35-
type = string
36-
description = "ID of the AWS account that can access the backup bucket."
37-
}
38-
3934
# Replication Configuration
4035
variable "enable_replication" {
4136
type = bool

0 commit comments

Comments
 (0)