upbound / provider-terraform

A @crossplane provider for Terraform
Apache License 2.0
124 stars 55 forks source link

Unable to control absolute state path #250

Closed lukegAtPaxos closed 6 days ago

lukegAtPaxos commented 3 months ago

When using S3 as my state backend, the location in the S3 bucket is prepended with env:/<Kubernetes Workspace Name>/<Desired State Path>

I'm unable to find any information on this - the cached local tfstate indicates the key I want, but scanning Dynamo shows the prepended paths.

Is there any information around this feature?

Using v0.14.1

bobh66 commented 3 months ago

That is the default prefix as defined in the terraform s3 backend code:

https://github.com/hashicorp/terraform/blob/main/internal/backend/remote-state/s3/backend_state.go#L29

and can be overridden in the backend configuration:

https://developer.hashicorp.com/terraform/language/settings/backends/s3#workspace_key_prefix

Also:

https://stackoverflow.com/questions/61875412/can-i-configure-terraform-to-not-use-env-in-the-path-for-a-workspaces-state