-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(component): validate good component
- Loading branch information
1 parent
9c81fe9
commit 5d316a0
Showing
5 changed files
with
46 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Module: Component | ||
|
||
## Define component | ||
|
||
Developer **MUST** use turo component module to define a component, and the resource name **MUST** prefix 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 | ||
|
||
The component definition block **MUST** sit in a terraform file named `<component-name>.tf` | ||
|
||
For the above good-foo-bar example, the file name **MUST** be `good-foo-bar.tf` | ||
|
||
### Component module | ||
|
||
For complex component which has its own component module/folder, the component definition block **MUST** sit in the `main.tf` of the component module/folder. | ||
|
||
For the above good-foo-bar example, the file **MUST** be `<component-name>-component/main.tf`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...alididate/fixtures/good-component/main.tf → ...idate/fixtures/components/foo-bar/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module "component_good_foo_bar" { | ||
module "component_foo_bar" { | ||
source = "app.terraform.io/turo/component-metadata/null" | ||
version = "3.1.2" | ||
|
||
name = "good-foo-bar" | ||
name = "foo-bar" | ||
system_metadata = var.metadata_module.parent_system_metadata | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters