boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
678 stars 46 forks source link

.env TS_PROJECT don't get evaluated in S3 backend key #241

Closed matteo-mazzanti-aws closed 2 years ago

matteo-mazzanti-aws commented 2 years ago

Checklist

My Environment

Software Version
Operating System macos 11.6.5
Terraform v1.1.4
Terraspace v2.0.1
Ruby v3.1.2p20

Expected Behaviour

Defined variable TS_PROJECT in .env file (file in TS root folder) Backend S3 key value has expansion that includes PROJECT The tf state in S3 bucket is inside a folder named as TS_PROJECT

Current Behavior

The tf.state is inside folder named 'main' (that is teh default TS_PROJECT value, I suppose)

Step-by-step reproduction instructions

Create .env file with TS_PROJECT in TS root folder Create provider file with expansion that includes PROJECT. Create main.tf with a S3 bucket resource for test Run TS up

Code Sample

Solution Suggestion

tongueroo commented 2 years ago

I see. The :PROJECT variable was mapped only to the config.cloud.project = ... setting. https://terraspace.cloud/docs/cloud/config/ Also added a mapping to TS_PROJECT now in #242