From c6e0682de837c7e0f8ce8cbe0b60bdf8eca338bc Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Fri, 23 Aug 2024 12:49:11 +0200 Subject: [PATCH] chore(crates-io): remove deprecated field `versioning` --- terragrunt/modules/crates-io/s3-index.tf | 7 +++++-- terragrunt/modules/crates-io/s3-static.tf | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) 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" } }