Skip to content
Open
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
7 changes: 5 additions & 2 deletions terragrunt/modules/crates-io/s3-index.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
resource "aws_s3_bucket" "index" {
bucket = var.index_bucket_name
}

versioning {
enabled = true
resource "aws_s3_bucket_versioning" "index" {
bucket = aws_s3_bucket.index.bucket
versioning_configuration {
status = "Enabled"
}
}

Expand Down
18 changes: 12 additions & 6 deletions terragrunt/modules/crates-io/s3-static.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
resource "aws_s3_bucket" "static" {
bucket = var.static_bucket_name

versioning {
enabled = true
}

// Allow the crates.io frontend to fetch the READMEs from JavaScript.
cors_rule {
allowed_methods = ["GET"]
Expand Down Expand Up @@ -50,6 +46,13 @@ resource "aws_s3_bucket" "static" {
}
}

resource "aws_s3_bucket_versioning" "static" {
bucket = aws_s3_bucket.static.bucket
versioning_configuration {
status = "Enabled"
}
}

resource "aws_s3_bucket_replication_configuration" "static" {
role = aws_iam_role.s3_replication.arn
bucket = aws_s3_bucket.static.id
Expand Down Expand Up @@ -130,9 +133,12 @@ resource "aws_s3_bucket" "fallback" {
provider = aws.eu-west-1

bucket = "${var.static_bucket_name}-fallback"
}

versioning {
enabled = true
resource "aws_s3_bucket_versioning" "fallback" {
bucket = aws_s3_bucket.fallback.bucket
versioning_configuration {
status = "Enabled"
}
}

Expand Down
Loading