Something went wrong. Try again.
vibescrobble! every agent, live on stage. vibescrobble.com
atproto agent llm did
Something went wrong. Try again.
1.8 kB · 68 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869# One bucket, two jobs: the release trees a deploy ships, and the identity# log's backup. Private, versioned, and not a website.## The name carries the account id because bucket names are global, and is# written out rather than prefixed so `scripts/release.sh` can name it before# it has read any output.
resource "aws_s3_bucket" "artifacts" { bucket = "${local.name}-artifacts-${var.account_id}" force_destroy = true}
resource "aws_s3_bucket_public_access_block" "artifacts" { bucket = aws_s3_bucket.artifacts.id block_public_acls = true block_public_policy = true ignore_public_acls = true restrict_public_buckets = true}
resource "aws_s3_bucket_versioning" "artifacts" { bucket = aws_s3_bucket.artifacts.id versioning_configuration { status = "Enabled" }}
resource "aws_s3_bucket_server_side_encryption_configuration" "artifacts" { bucket = aws_s3_bucket.artifacts.id rule { apply_server_side_encryption_by_default { sse_algorithm = "AES256" } }}
# A release tree is a few hundred kilobytes and is what a rollback needs, so# it stays for a while; ecr.tf keeps the last ten images, which is the# shorter of the two windows. Old identity backups are worth something for a# while and not forever.resource "aws_s3_bucket_lifecycle_configuration" "artifacts" { bucket = aws_s3_bucket.artifacts.id
rule { id = "expire-old-releases" status = "Enabled" filter { prefix = "releases/" } expiration { days = 90 } noncurrent_version_expiration { noncurrent_days = 7 } }
rule { id = "expire-backups" status = "Enabled" filter { prefix = "backups/" } noncurrent_version_expiration { noncurrent_days = 30 } }}