Erik Osterman (Cloud Posse)
04/04/2025, 12:37 PMHaitham
04/04/2025, 12:45 PMHaitham
04/04/2025, 12:47 PMErik Osterman (Cloud Posse)
04/05/2025, 12:45 PMErik Osterman (Cloud Posse)
04/05/2025, 12:46 PMErik Osterman (Cloud Posse)
04/05/2025, 12:47 PMHaitham
04/05/2025, 12:50 PMHaitham
04/05/2025, 12:59 PMErik Osterman (Cloud Posse)
04/05/2025, 1:16 PMHaitham
04/05/2025, 1:26 PMHaitham
04/05/2025, 1:33 PMAndriy Knysh (Cloud Posse)
04/05/2025, 1:44 PMAndriy Knysh (Cloud Posse)
04/05/2025, 1:57 PMterraform clean code works OK in this case:
• atmos terraform clean <component> -s <stack> finds the component path (in components/terraform) and deletes the related filesAndriy Knysh (Cloud Posse)
04/05/2025, 1:59 PMatmos terraform clean should find all component paths and delete the relevant files. But it works only on the first sub-folder level, e.g.
repo
components
terraform
component-1Andriy Knysh (Cloud Posse)
04/05/2025, 2:00 PMeks folder will not be processedAndriy Knysh (Cloud Posse)
04/05/2025, 2:00 PMAndriy Knysh (Cloud Posse)
04/05/2025, 2:06 PMrepo
tests
fixtures
scenarios
terraform-sub-components
stacks
components
terraform
component-1
main.tf
component-2
main.tf
• if the commands is executed w/o a component and a stack (to clean everything), atmos terraform clean, execute ExecuteDescribeStacks Go function to find all stacks and all components
• Process the result of the command to find ALL unique Atmos components from all stacks
• For each unique Atmos component, find the component attribute from the output - the component attribute points to the corresponding terraform component pathAndriy Knysh (Cloud Posse)
04/05/2025, 2:10 PMcomponent-1:
`component` will be `component-1`
component-2:
`component` will be `component-1/component-2`Andriy Knysh (Cloud Posse)
04/05/2025, 2:10 PMAndriy Knysh (Cloud Posse)
04/05/2025, 2:12 PMcomponent attribute for each Atmos component - it points to the TF component path
• join the base path (e.g. components/terraform) with the component attribute to find the Terraform path for each component
• delete the relevant files from the pathAndriy Knysh (Cloud Posse)
04/05/2025, 2:13 PMAndriy Knysh (Cloud Posse)
04/05/2025, 2:13 PMHaitham
04/05/2025, 2:46 PMbase_path: "./"
components:
terraform:
base_path: "components/terraform"
apply_auto_approve: false
deploy_run_init: true
init_run_reconfigure: true
auto_generate_backend_file: false
stacks:
base_path: "stacks"
included_paths:
- "deploy/**/*"
excluded_paths:
- "**/_defaults.yaml"
name_pattern: "{stage}"
/stacks/deploy/staging.yaml
vars:
stage: staging
components:
terraform:
component-1:
vars:
location: Los Angeles
lang: enAndriy Knysh (Cloud Posse)
04/05/2025, 2:49 PMHaitham
04/05/2025, 2:53 PMHaitham
04/05/2025, 2:53 PMHaitham
04/05/2025, 2:58 PMHaitham
04/05/2025, 3:09 PMAndriy Knysh (Cloud Posse)
04/05/2025, 3:10 PMapple ) and point to a Terraform component components/terraform/cherry)Andriy Knysh (Cloud Posse)
04/05/2025, 3:11 PMcomponents:
terraform:
component-1
metadata:
component: component-1 # Point to the Terraform component inside `components/terraform`
component-2:
metadata:
component: component-1/component-2 # Point to the Terraform component inside `components/terraform`Andriy Knysh (Cloud Posse)
04/05/2025, 3:15 PMHaitham
04/08/2025, 9:08 PM