Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow writing to backup bucket #226

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions terraform/aws.tf
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ module "secondary" {
bucket = module.logging_bucket.name
}

backups = {
bucket = module.postgres_backups_bucket.name
}

key_name = aws_key_pair.main.key_name
hosted_zone_id = aws_route53_zone.opentracker.id
}
Expand Down
5 changes: 5 additions & 0 deletions terraform/modules/f2-instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ resource "aws_iam_policy" "this" {
Effect = "Allow"
Resource = format("arn:aws:s3:::%s/*", var.logging.bucket)
},
{
Action = ["s3:PutObject"]
Effect = "Allow"
Resource = format("arn:aws:s3:::%s/*", var.backups.bucket)
},
]
})
}
Expand Down
7 changes: 7 additions & 0 deletions terraform/modules/f2-instance/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ variable "logging" {
description = "Parameters for use in logging output"
}

variable "backups" {
type = object({
bucket = string
})
description = "Parameters for use in taking database backups"
}

variable "key_name" {
type = string
description = "The name of the `aws_key_pair` to use for the instance access"
Expand Down
Loading