Hello! I have an instance of a vpc component in s...
# atmos
c
Hello! I have an instance of a vpc component in stack1, it works exactly as expected. I'm just adding an instance to a new stack, if I run apply, I get "A change in the backend configuration has been detected, which may require migrating existing state." migrate state or reconfigure, etc. Is this normal or am I fundamentally misunderstanding how components instances should work?
✅ 1
e
Are you using our backend provider generation?
c
do you mean`auto_generate_backend_file: true`
👍 1
yep, I am
I have 2 instances of the component in stack1 and this thing didn't happen
e
Are you using remote state (e.g.
!terraform.output
)
...between them
c
!terraform.output no, !terraform.state plenty, only in stack1 though, for now
the new stack has different provider settings obviously, it's a different aws account
there is a terraform.tfstate file under .terraform inside the vpc component, it contains bunch of backed configuration attributes, which all refer to stack1
e
!terraform.state plenty
Hrm.... that should work well, since it doesn't need a provider file to work. The issue can happen if you use
!terraform.output
which executes a subshell that calls
terraform init
. Then if 2 component instances of the same component rely on state between them, you'll get this error.
But that doesn't seem like what's happening now.
c
if I delete the `.terraform/terraform.tfstate`file then it works from stack2 but then running apply in stack1 again produces the same error
e
I think there's an optimization somewhere in the Atmos config for init, which tells Atmos to not reinitialize. Do you know if you have that enabled? That could be exasperating this.
Could you share relevant portions of your Atmos.yaml here?
c
the only option I have is auto generate backend files, I'm going to look at the other options, thanks!
ah, you think it's something I enabled, no. unless some of those features default to true
e
(also, I assume you're running recent/current version of atmos)
c
er, I updated it max 2 weeks ago
from the docs: :
init_run_reconfigure: true
wondering if it's the one I need
e
yes, please try that
@Andriy Knysh (Cloud Posse) what's the default of
init_run_reconfigure
?
c
okay, this seems to have sorted it
a
the default is
false
, we set it in
atmos.yaml
Copy code
# Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_INIT_RUN_RECONFIGURE' ENV var, or '--init-run-reconfigure' command-line argument
    init_run_reconfigure: true
e
Is this a good default @Andriy Knysh (Cloud Posse) if it leads to this error?
a
we had it for a long time, im not sure what would happen if we changed the default (probably will be ok)
e
@Andriy Knysh (Cloud Posse) in your open branch, can you just add a line with the error message that he got and the fix? This is an easy one to get bit by. The nice thing about it is the fix is also so easy. https://atmos.tools/troubleshoot/errors
👍 1
a
the errors doc updated in this release https://github.com/cloudposse/atmos/releases/tag/v1.188.0