Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using Minio bucket as terraform backend #36301

Open
vpdevx opened this issue Jan 9, 2025 · 1 comment
Open

Error when using Minio bucket as terraform backend #36301

vpdevx opened this issue Jan 9, 2025 · 1 comment
Labels
backend/s3 bug new new issue not yet triaged

Comments

@vpdevx
Copy link

vpdevx commented Jan 9, 2025

Terraform Version

Terraform v1.10.2

Terraform Configuration Files

terraform {
  backend "s3" {
    bucket = "vinitfstate"
    key    = "tfstate"

    endpoints = { s3 = "https://minioapi.mydomain.xyz" }

    access_key = "my_access_key"
    secret_key = "my_secret_key"

    region                      = "main"
    use_path_style = true
    skip_region_validation = true
    skip_credentials_validation = true
    skip_metadata_api_check = true
    skip_requesting_account_id = true
    skip_s3_checksum = true
  }
}

Debug Output

Initializing the backend...
Initializing modules...
╷
│ Error: Error inspecting states in the "local" backend:
│     Unable to list objects in S3 bucket "vinitfstate" with prefix "env:/": operation error S3: ListObjectsV2, https response error StatusCode: 403, RequestID: xxxxxxxxxx, HostID: xxxxxxxx, api error SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
│ 
│ Prior to changing backends, Terraform inspects the source and destination
│ states to determine what kind of migration steps need to be taken, if any.
│ Terraform failed to load the states. The data in both the source and the
│ destination remain unmodified. Please resolve the above error and try again.

Expected Behavior

It should run smoothly

Actual Behavior

Getting 403 while trying to setup terraform backend as a bucket in Minio:
Initializing the backend...
Initializing modules...

│ Error: Error inspecting states in the "local" backend:
│ Unable to list objects in S3 bucket "vinitfstate" with prefix "env:/": operation error S3: ListObjectsV2, https response error StatusCode: 403, RequestID: 1818DCEBCA790BDB, HostID: dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8, api error SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.

│ Prior to changing backends, Terraform inspects the source and destination
│ states to determine what kind of migration steps need to be taken, if any.
│ Terraform failed to load the states. The data in both the source and the
│ destination remain unmodified. Please resolve the above error and try again.

Steps to Reproduce

  1. terraform init

Additional Context

No response

References

No response

Generative AI / LLM assisted development?

No response

@vpdevx vpdevx added bug new new issue not yet triaged labels Jan 9, 2025
@crw
Copy link
Contributor

crw commented Jan 9, 2025

Hi @vpdevx, thanks for this report. You may also want to contact Minio to report that their S3-compatible storage is having S3 compatibility issues. I am making a guess that whatever is calculating the signature on their end is out of sync with something in the AWS SDK v2. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend/s3 bug new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants