Hello, I have a deploy-layers workflow, in which I...
# atmos
b
Hello, I have a deploy-layers workflow, in which I run a plan between applying each layer, and I wanted to know if there was a way to have atmos skip a workflow step if the plan step didn't detect any changes?
Copy code
deploy-layers:
    description: "Deploy infrastructure layers with plans between each layer"
    steps:
      - command: terraform plan network
      - command: terraform apply network --from-plan -auto-approve
      - command: terraform plan security-groups
      - command: terraform apply security-groups --from-plan -auto-approve
      - command: terraform plan eks-cluster
      - command: terraform apply eks-cluster --from-plan -auto-approve
      - command: terraform plan eks-bootstrap
      - command: terraform apply eks-bootstrap --from-plan -auto-approve
z
Why not just always apply
Otherwise the only way to accomplish that would be to rewrite this in bash
but if the goal is to apply only if there's drift, there's no reason not to just always apply
b
2 concerns 1. at some point, I'll have to implement an approval gate so we can review the plan before allowing the apply to proceed 2. eks-bootstrap runs api calls (via the k8s provider) against the EKS cluster, there may be circumstances (i.e. a brand new environment) where that cluster does not exist yet, so I need a way to ensure the eks-cluster layer has applied before I can attempt an apply
z
yeah if you want that type of logic you're probably going to want to rewrite in
type: shell
or do some kind of master workflow that dynamically calls other workflows, probably still in shell
e
I'll have to implement an approval gate so we can review the plan before allowing the apply to proceed
Won't that gate exist in CI?
b
Yes
e
What is your CI platform?
b
github