gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
7.93k stars 964 forks source link

Terraform >= 1.6.0 endpoints.s3 problem #3169

Open ex12is opened 3 months ago

ex12is commented 3 months ago

Hi

I have a problem with migration from terragrunt 0.55.21 + terraform 1.5.6 to terragrunt 0.55.21 + terraform 1.6.6. We have a non-amazon remote state bucket so we need to specify it via "endpoint" variable.

Before tf version 1.6.0 we can set it like this:

remote_state {
  backend = "s3"
  config = {
    endpoint   = https://storage.somecloud.net"
    bucket     = some_bucket
    region     = "some_region"
    key        = "some_key"
    encrypt    = true
    kms_key_id = "some_kms_key"

    skip_region_validation      = true
    skip_credentials_validation = true
  }
}

For tf version >=1.6.0 we need to specify a map for "endpoints" (endpoint - (Optional, Deprecated) Custom endpoint URL for the AWS S3 API. Use endpoints.s3 instead.)

remote_state {
  backend = "s3"
  config = {
    endpoints  = {
      s3 = "https://storage.somecloud.net"
      }
    bucket     = some_bucket
    region     = "some_region"
    key        = "some_key"
    encrypt    = true
    kms_key_id = "some_kms_key"

    skip_region_validation      = true
    skip_credentials_validation = true
    skip_requesting_account_id  = true
    skip_s3_checksum            = true
  }
}

When i try to use the last example terragrunt ignoring endpoints map. I have checked tg docs, it doesn't support endpoints map

So when i use "endpoint" variable i see the terraform error:

Initializing the backend...
╷
│ Warning: Deprecated Parameter
│
│   on state.tf line 6, in terraform:
│    6:     endpoint                    = "https://storage.somecloud.net"
│
│ The parameter "endpoint" is deprecated. Use parameter "endpoints.s3"
│ instead.
╵

When i use map "endpoints" terragrunt ignoring it and trying to connect to amazonaws.com - "https://some_bucket.s3.some_region.amazonaws.com/?versioning="

ne-olegg commented 1 month ago

same issue

PavelKorchagin commented 1 month ago

same problem

ingvarch commented 3 days ago

Any updates? Same issue

yhakbar commented 3 days ago

This looks like a reasonable request.

As a workaround, consider leveraging the generate configuration.

I'll mark the issue as contributions-requested, as it isn't a priority right now for the team.