Skip to main content

2 posts tagged with "environment-variables"

View All Tags

Using dotenv (.env) files with Atlas

A .env file is a simple text file used to store environment variables for applications. It helps developers manage configuration settings, such as database credentials, API keys, and other sensitive information, without hardcoding them into the source code. By using a .env file, developers can keep their codebase clean, secure, and easily configurable across different environments.

For developers who want to use .env files with Atlas, there are two ways users can do so through the standard Atlas HCL configuration file:

How can I keep sensitive values out of Terraform state?

Terraform can write resource arguments into state and saved plans. HashiCorp's Terraform state documentation warns that state files can expose stored secrets. The sensitive flag redacts CLI and UI output, but Terraform can still record the value in state.

With the atlas_schema resource, Terraform can pass connection metadata while Atlas resolves the credential when it evaluates atlas.hcl.