diff --git a/terragrunt/modules/crates-io/s3-index.tf b/terragrunt/modules/crates-io/s3-index.tf index 8ade043de..05062e39e 100644 --- a/terragrunt/modules/crates-io/s3-index.tf +++ b/terragrunt/modules/crates-io/s3-index.tf @@ -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" } } diff --git a/terragrunt/modules/crates-io/s3-static.tf b/terragrunt/modules/crates-io/s3-static.tf index e3b3c6caf..a215727d8 100644 --- a/terragrunt/modules/crates-io/s3-static.tf +++ b/terragrunt/modules/crates-io/s3-static.tf @@ -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"] @@ -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 @@ -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" } }