I had been using credential files in my terraform projects. Recently I switch to use AWS SSO and providing the profile name in the code. At runtime (plan, apply, etc.) terraform will use the token from the given profile. If AWS returns expired, the command will stop with authentication errors. Simply authenticate by cli via […]
Don’t add account id to your Terraform code
I discovered a handy trick to get the account id of the given profile/account. The key is to use a new data source object and pass it the provider. See the code below. So no need to ever put account ids in terraform code again? I’m good with that. Happy building, D