Hi, I have a quick question. I use `!terraform.st...
# atmos
e
Hi, I have a quick question. I use
!terraform.state
and
dependencies.components
between components in the same stack, for example, VPC and subnets. When I run
atmos terraform apply --all -s stack-name
, it does not work as expected and throws an error while trying to create the subnets after the VPC is created. The subnets provision successfully only after a second deployment. Is this expected behavior? I assumed using dependencies and
terraform.state
would create all components in a stack in order without errors.
a
@Elon can you please create a GH issue and describe the problem and add your config. > The subnets provision successfully only after a second deployment. That might be a timing issue with AWS, or a timing issue with Atmos +
!terraform.state
- I'd like to see your configuration
also,
dependencies.components
is a new feature (introduced in the last release). Did you try using the old one (
settings.depends_on
)? https://atmos.tools/stacks/settings/depends_on Can you try it? If it works for you, will be easier for us to debug
dependencies.components
e
Hi, I tried: settings: depends_on: 1: component: vpc Instead, and got the same result while trying: atmos terraform apply --all -s dev-ue1 The subnets get created before the VPC, even though I'm using
depends_on
. This looks inconsistant because on a second run it tried to create the vpc and then the ec2 and not the subnets, which caused another error even though I configured the ec2 to be dependent on the subnets. If I use
atmos describe dependents vpc -s dev-ue1
, I do see the subnets component as a dependency, so the configuration looks valid. Also,
atmos validate stacks
is okay. So either the dependencies are for reference only and don't actually do anything, or I'm missing something because
atmos terraform apply
with
--all
does not take the dependencies into consideration. Also, on another note, I saw that only
apply
and
plan
have
--all
flags. What about
init
and
destroy
? Do I have to go manually component by component in a stack for those? Because
apply
or
plan
do not create the underlying S3 bucket for the backend; I have to
init
first. So I have to
init
each component individually and delete each component individually?
a
@Elon thanks for reporting, we'll review the two issues and fix them asap
e
Thank you!
j
I'm using v1.215.0 and using
atmos terraform plan --all
. Should I be using Configure Dependencies Between Components (Legacy) | atmos or Component Dependencies | atmos to define dependencies?