Open
Description
Terraform Version
1.11.2 and later
Terraform Configuration Files
Showing here just the Terraform S3 backend configuration.
terraform {
backend "s3" {
endpoints = { s3 = "<url>"}
shared_credentials_files = ["./.tf-s3-creds"]
bucket = "$CONTAINER_NAME"
use_path_style = true
key = "terraform.tfstate"
workspace_key_prefix = "<ostack-container-name>"
region = "<ostack-region>"
skip_credentials_validation = true
skip_region_validation = true
skip_requesting_account_id = true
skip_metadata_api_check = true
skip_s3_checksum = true
}
}
Debug Output
│ Error: failed to upload state: operation error S3: PutObject, https response error StatusCode: 400, RequestID: tx00000a93590afd2885bfb-0068232994-e806fab1-cloud-ceph-objectstore-prod-brno, HostID: e806fab1-cloud-ceph-objectstore-prod-brno-cloud-ceph-objectstore-prod-brno, api error XAmzContentSHA256Mismatch: UnknownError
Expected Behavior
I understand S3 v2 API is not the recent one and maybe should not be enabled by default.
On the other side I believe this behavior is regression and there has to be decision from Terraform community whether to support S3 v2 API. I'd propose to additional parameter to S3 backend enforcing S3 v2 API.
Actual Behavior
Unable to push terraform state to S3 backend over S3 v2 API. Fails with:
│ Error: failed to upload state: operation error S3: PutObject, https response error StatusCode: 400, RequestID: tx00000a93590afd2885bfb-0068232994-e806fab1-cloud-ceph-objectstore-prod-brno, HostID: e806fab1-cloud-ceph-objectstore-prod-brno-cloud-ceph-objectstore-prod-brno, api error XAmzContentSHA256Mismatch: UnknownError
Steps to Reproduce
- Let's have S3 backend available based ceph rados-gateway
- Terraform infrastructure uses s3 backend
- Classical terraform workflow start to fail (since Terraform 1.11.2)
- terraform init
- terraform validate
- terraform plan -out plan
- terraform apply plan
Additional Context
On prem clouds with ceph distributed storage backends still use ceph rados gateway for Swift / S3 object-store offerings.
References
This issue is related to #36625 change.
Generative AI / LLM assisted development?
No response