Open baitoz opened 1 year ago
Hello @baitoz , in a normal way as standard terraspace read your local ~/.aws/config and ~/.aws/credentials file. in this file there are the predefined variables AWS_REGION and AWS_PROFILE. these elements existing in your environment ?
Used terraform example code to test: terraspace new project infra --plugin aws --examples
Updated provider.tf provider 'aws' with a region and profile.
When either region or provider are not set, but environment var AWS_REGION or "AWS_PROFILE" are set, then terraspace reports the setting is not set.
ie. no env variables, and no provider.tf (region and profile) reports that these settings are missing. but adding the settings to provider.tf does not work for either setting.
Adding 'default_tags' in provider.tf does work in the provider section, as such I conclude the issue with with profile and region specifically.
My Environment
Expected Behaviour
The provider.tf must be read for profile specifically. Cannot expect environment vars to be correct for multi AWS environments.
Current Behavior
The profile and region settings in provider.tf are not used.
Step-by-step reproduction instructions
Output log:
Code Sample
export AWS_PROFILE="dev" ; export AWS_REGION="ap-southeast-2"
vs
Solution Suggestion
None. Tried removing spaces and padding and uppercase/lowercase.