juntekim.com/aws_infra/modules/forgejo_backup/main.tf
Jun-te Kim 97bd6854f4
Some checks are pending
Deploy Home Assistant / deploy (push) Waiting to run
Build juntekim.com / Push-to-juntekim-to-docker-hub (push) Waiting to run
Build juntekim.com / run-on-k8s (push) Blocked by required conditions
Deploy n8n / deploy (push) Waiting to run
Build & Deploy stripe-to-invoice (with DB secrets + migrations) / build (push) Waiting to run
Build & Deploy stripe-to-invoice (with DB secrets + migrations) / Deploy Postgres (PV + PVC + Deployment) (push) Blocked by required conditions
Build & Deploy stripe-to-invoice (with DB secrets + migrations) / Apply runtime secrets (push) Blocked by required conditions
Build & Deploy stripe-to-invoice (with DB secrets + migrations) / Run DB migrations (Atlas) (push) Blocked by required conditions
Build & Deploy stripe-to-invoice (with DB secrets + migrations) / deploy (push) Blocked by required conditions
Terraform Apply / Terraform Apply (push) Waiting to run
Terraform Apply / Terraform Apply - SES (push) Blocked by required conditions
made aws infra
2026-03-12 05:56:46 +00:00

39 lines
797 B
HCL

module "bucket" {
source = "../s3_bucket"
bucket_name = var.bucket_name
versioning_enabled = true
retention_days = 90
}
resource "aws_iam_user" "forgejo_backup" {
name = "forgejo-backup"
}
resource "aws_iam_access_key" "forgejo_backup" {
user = aws_iam_user.forgejo_backup.name
}
resource "aws_iam_user_policy" "forgejo_backup" {
name = "forgejo-backup-s3"
user = aws_iam_user.forgejo_backup.name
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Action = [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:ListBucket"
]
Resource = [
module.bucket.bucket_arn,
"${module.bucket.bucket_arn}/*"
]
}
]
})
}