# Components Cheatsheet

**Folder Structure**

```
├── atmos.yaml
├── components
│   └── myapp
│       ├── main.tf
│       ├── outputs.tf
│       └── variables.tf
└── stacks
    ├── catalog
    │   └── myapp.yaml
    └── deploy
        ├── dev.yaml
        ├── prod.yaml
        └── staging.yaml
```

**List Components**

```shell
atmos list components
```

**Validate Components**

```shell
atmos validate component $component -s $stack
atmos validate component $component -s $stack --schema-type jsonschema --schema-path $component.json
atmos validate component $component -s $stack --schema-type opa --schema-path $component.rego
atmos validate component $component -s $stack --schema-type opa --schema-path $component.rego  --module-paths catalog
atmos validate component $component -s $stack --timeout 15
```

**Plan Root Modules**

```shell
atmos terraform plan $component --stack $stack
atmos terraform plan $component --stack $stack -out $planfile
```

**Apply Root Modules**

```shell
atmos terraform apply $component --stack $stack
atmos terraform apply $component --stack $stack -auto-approve
atmos terraform apply $component --stack $stack $planfile
```

**Deploy Root Modules**

```shell
atmos terraform deploy
atmos terraform deploy $component --stack $stack -out $planfile
atmos terraform deploy $component --stack $stack -var "key=value"
```
