Terraform allows accessing states stored on remote backends using its built in terraform_remote_state data resource, env0 allows specifying which environments would be allowed to access an environment's state on env0 triggered deployments.
To set your environment's state access, simply go to the Environment -> Settings tab and select which projects are allowed to access the environment's state. You can choose to allow access to all environments in your organization or limit access to specific projects or their subprojects.
After saving these settings only environments in the selected projects or their subprojects will be allowed to fetch that environment's state.
These settings will only affect deployments that are running inside env0, for local runs or state access that is from outside env0 the logged-in API key / User personal key permissions will determine if they can access the state or not.
Updated 8 months ago