Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Terraform Provider got updated and s3 bucket res changes exists #262

Open
T0tt1 opened this issue Feb 22, 2022 · 1 comment · May be fixed by #264
Open

Terraform Provider got updated and s3 bucket res changes exists #262

T0tt1 opened this issue Feb 22, 2022 · 1 comment · May be fixed by #264

Comments

@T0tt1
Copy link

T0tt1 commented Feb 22, 2022

What we need to do here on Line 283 is to delete section for versioning and move it to another resource

resource "aws_s3_bucket_versioning" "versioning_example" {
  bucket = aws_s3_bucket.example.id
  versioning_configuration {
    status = "Enabled"
  }
@T0tt1
Copy link
Author

T0tt1 commented Feb 22, 2022

Please find how it should looks like

resource "aws_s3_bucket" "vault_storage" {
  count         = var.enable_s3_backend ? 1 : 0
  bucket        = var.s3_bucket_name
  force_destroy = var.force_destroy_s3_bucket

  tags = merge(
    {
      "Description" = "Used for secret storage with Vault. DO NOT DELETE this Bucket unless you know what you are doing."
    },
    var.s3_bucket_tags,
  )

  # aws_launch_configuration.launch_configuration in this module sets create_before_destroy to true, which means
  # everything it depends on, including this resource, must set it as well, or you'll get cyclic dependency errors
  # when you try to do a terraform destroy.
  lifecycle {
    create_before_destroy = true
  }
}

resource "aws_s3_bucket_versioning" "vault_storage" {
  count  = var.enable_s3_backend ? 1 : 0
  bucket = aws_s3_bucket.vault_storage[count.index].id
  versioning_configuration {
    status = var.enable_s3_bucket_versioning
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant