Skip to content

Commit

Permalink
docs(component): validate good component
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingandyyy committed Jun 24, 2024
1 parent 501e624 commit 31bc683
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
29 changes: 29 additions & 0 deletions docs/modules/component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Module: Component

## Define component

Component **MUST** use turo component provider to define the component, and the resource name **MUST** suffixed with `_component`.

```tf
module "component_good_foo_bar" {
source = "app.terraform.io/turo/component-metadata/null"
version = "3.1.2"
name = "good-foo-bar"
system_metadata = var.metadata_module.parent_system_metadata
}
```

## Locate the component

### Simple Component

Component **MUST** sit in a terraform file named `<component-name>.tf`

For the above good-foo-bar example, the file name **SHOULD** be `good-foo-bar.tf`

### Component module

Component **MUST** sit in the `main.tf` of the component module/folder.

For the above good-foo-bar example, the file **SHOULD** be `<component-name>-component/main.tf`.
3 changes: 2 additions & 1 deletion docs/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ We use modules for a few reasons:
See:

- [breaking-changes](breaking-changes.md)
- [component](component.md)
- [input-variables](input-variables.md)
- [output-variables](output-variables.md)
- [output-variables](output-variables.md)[outputs.md](outputs.md)

0 comments on commit 31bc683

Please sign in to comment.