Sunday, May 15, 2022

Set Env. variable for Terraform on Windows

 We will explain how you can put your Terraform variable in your windows environment variables.

Note: you can for example put your VMC Token in your windows variables. This will avoid you from 2 things:

1. Put the token in the code itself, which is not recommended at all for security reasons.

2. Write the token every time when you plan or apply the code.


Note: The below variable is changeable based on the variable name in your code.


Set-Item -Path env:TF_VAR_token -Value “token_value“


To set the backend access key and secret key:


Set-Item -Path env:AWS_ACCESS_KEY_ID -Value "xyxyxyxyxyx12345"

Set-Item -Path env:AWS_SECRET_ACCESS_KEY -Value "abcabcabcabcabcabcabc12345"


Source: https://www.terraform.io/language/settings/backends/s3 

No comments:

Post a Comment

NSX-T (local log in) with VIDM integration

We will explain how to log in with a local account to your NSX-T which integrated with VIDM. We integrated our NSX-T into the VIDM. We had a...