I need some help here. I've copied the tutorial an...
# geodesic
j
I need some help here. I've copied the tutorial and started tinkering with changes to make a PoC. I'm running into a wall running
atmos terraform plan tfstate-backend --stack=uw2-root
and can't figure out what knob I turned to end up with
stack name pattern must be provided in 'stacks.name_pattern' config or 'ATMOS_STACKS_NAME_PATTERN' ENV variable
Directory structure looks correct (at least I think)
Copy code
├── components
│   └── terraform
│       └── tfstate-backend
│           ├── README.md
│           ├── <http://context.tf|context.tf>
│           ├── default.auto.tfvars
│           ├── <http://main.tf|main.tf>
│           ├── <http://outputs.tf|outputs.tf>
│           ├── <http://providers.tf|providers.tf>
│           ├── <http://variables.tf|variables.tf>
│           └── <http://versions.tf|versions.tf>
└── stacks
    ├── catalog
    │   ├── globals.yaml
    │   └── uw2-globals.yaml
    ├── uw2-dev.yaml
    ├── uw2-prod.yaml
    └── uw2-root.yaml
a
somewhere in these locations
Copy code
# CLI config is loaded from the following locations (from lowest to highest priority):
# system dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows)
# home dir (~/.atmos)
# current directory
# ENV vars
# Command-line arguments
this is a working example https://github.com/cloudposse/atmos/tree/master/examples/complete that shows how to use atmos, plus all the
stacks
and
components
folders
and this is a list of commands we usually use to test atmos
Copy code
atmos version
atmos terraform plan test/test-component-override -s tenant1/ue2/dev
atmos terraform plan test/test-component-override -s=tenant1-ue2-dev
atmos terraform plan test/test-component-override -s tenant1/ue2/dev --stacks-dir=./examples/complete/stacks
atmos terraform validate test/test-component-override -s tenant1/ue2/dev
atmos terraform output test/test-component-override -s tenant1/ue2/dev
atmos terraform graph test/test-component-override -s tenant1/ue2/dev
atmos terraform show test/test-component-override -s tenant1/ue2/dev
atmos helmfile diff infra/infra-server -s tenant1/ue2/dev
atmos terraform workspace test/test-component-override --stack=tenant1/ue2/dev
atmos --config-dir ./examples/complete/stacks --terraform-dir ./examples/complete/components/terraform terraform workspace test/test-component-override --stack=tenant1/ue2/dev
atmos --config-dir=./examples/complete/stacks --terraform-dir=./examples/complete/components/terraform terraform workspace test/test-component-override --stack tenant1/ue2/dev
atmos terraform workspace test/test-component-override --stack=tenant1/ue2/dev --config-dir ./examples/complete/stacks --terraform-dir ./examples/complete/components/terraform
atmos terraform varfile test/test-component-override -s tenant1/ue2/dev
atmos terraform varfile test/test-component-override -s tenant1/ue2/dev -f ./varfile.json
atmos --config-dir ./examples/complete/stacks --terraform-dir ./examples/complete/components/terraform terraform write varfile test/test-component-override --stack=tenant1/ue2/dev
atmos terraform write varfile test/test-component-override --stack=tenant1/ue2/dev --config-dir ./examples/complete/stacks --terraform-dir ./examples/complete/components/terraform 
atmos --config-dir ./examples/complete/stacks terraform write varfile test/test-component-override --stack=tenant1/ue2/dev --terraform-dir ./examples/complete/components/terraform 
atmos describe component test/test-component-override -s tenant1/ue2/dev
atmos describe component test/test-component-override -s tenant1-ue2-dev
atmos describe component infra/infra-server -s tenant1/ue2/dev
atmos describe component infra/infra-server -s tenant1-ue2-dev
atmos terraform generate backend test/test-component-override -s tenant1-ue2-dev
atmos terraform plan top-level-component1 -s tenant1/ue2/dev
atmos terraform apply top-level-component1 -s tenant1/ue2/dev
atmos terraform deploy top-level-component1 -s tenant1/ue2/dev
ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT=false atmos terraform deploy top-level-component1 -s tenant1/ue2/dev
ATMOS_LOGS_VERBOSE=true atmos terraform deploy top-level-component1 -s tenant1/ue2/dev
atmos terraform deploy top-level-component1 -s tenant1/ue2/dev --deploy-run-init=true
ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT=false atmos terraform deploy top-level-component1 -s tenant1/ue2/dev --deploy-run-init=true
j
@Andriy Knysh (Cloud Posse) Thanks!
And, I'm in business. Thanks again @Andriy Knysh (Cloud Posse)
✅ 1
a
note when you set the ENV var ATMOS_LOGS_VERBOSE=true, the CLI will print a lof more info - how it looks for the config, what config is found and processed, more info for the executing commands, etc.
j
Good to know
Running into the following despite the backend plan and apply successfully completing.
Copy code
⨠ atmos terraform backend generate component tfstate-backend --stack uw2-root
Invalid or missing configuration for the component 'generate' in the stack 'uw2-root'
a
if you are using atmos version >
1.0
, the command is
Copy code
atmos terraform generate backend <component> -s <stack>
also, the latest release will generate backend on the fly https://github.com/cloudposse/atmos/pull/66