Where can I find the tf state on an EFS filesystem...
# atlantis-community
c
Where can I find the tf state on an EFS filesystem for Atlantis? under ~/.atlantis?
g
Atlantis will use whatever you have on your tf files. Are you not setting a remote state?
c
yeah i had a module that wasn't setting a remote state so was saving to terraform.tfstate locally... luckily I was able to find it and copy it since when I unlocked it the terraform.tfstate got deleted so I had to copy it back
🙏 1
it just had created 100 resources so I really need state in order to do cleanup of that last run
i'm going to set a default http backend so it doesn't happen again just wish could use dynamic backend configuration which I know isn't allowed in TF
so I still might have issue were things get stepped on 😞
g
if you manage to get a script to check that you can run it as a pre-hook
so it fails if the state is not defined
we use terragrunt with a specific structure, so it will always set the remote state, it just might fail if the calculated bucket + remote path does not exist
c
yeah this is the module that gets wrapped by our terragrunt project... so essentially I'm trying to use atlantis to test the project first... and then when good I tag it for release and then that updates the TG project with the new release tag and does the testing there... TG has a backend dynamic config for this it's just the project itself I'm trying to figure out best way to handle... if it was just me it would be one thing but I use renovate for dependency checking on the module which opens a bunch of PR/MR's so now I'm afraid each of those being hardcoded to a default backend.tf state would cause issue... which is why it would be useful if the state could be set as the CI_COMMIT_REF_NAME or something
I'm looking in Atlantis docs and don't see but is there environment variables set for each job... looking for the branch name from the PR that I can possibly use a environment variable and then have atlantis do the init --backend_config using those ENV vars?
g