I got into a funny situation by moving a component...
# atmos
c
I got into a funny situation by moving a component and migrating the terraform state, I will try to recollect what I did: in a stack called
stack
, a component called
component
, I had this in my stack configuration:
components: {terraform: {component: {}}
. I moved the component into a subfolder so I added this to my component definition in the stack:
metadata: {component: subfolder/component}
. This made terraform prompt for a state migration, which I did by running
atmos terraform init -s stack component -- -migrate-state
. The command succeeded but after running plan, I saw that the state was all gone. Turns out it was migrated into the wrong folder. Looks like atmos terraform init migrated the state into
subfolder-component/stack/terraform.tfstate
but it was supposed to be under
subfolder-component/stack-component/terraform.tfstate
hm, it's not clear to me when the subfolder under the component name is only
stack
or
stack-component