Skip to content

Commit 800016b

Browse files
authored
Merge branch 'main' into pulumi-doc
2 parents b0656d9 + eeb18f2 commit 800016b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/da-implementation-guidelines.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Below you will find some guidance on best practises that should be used when aut
77
## Prefix
88

99
All Deployable Architecture solutions should have an optional **`prefix`** input variable that complies with the following criteria:
10-
- Input should have no default value, but set `nullable = true` to allow user to pass `null` incase they do not wish to use a prefix. This would be for advanced users who may need full control over resource naming.
10+
- Input should have no default value in terraform, but set `nullable = true` to allow user to pass `null` incase they do not wish to use a prefix. This would be for advanced users who may need full control over resource naming.
11+
- There should be a default value added to the input in the ibm_catalog.json. The default should be "dev" but it should use the `random_string` functionality to add 4 random characters to it (see below code snippet). The input should be marked as `"required": true` in the ibm_cataog.json so it appears in the required tab in projects and allows consumers to see the random string that is going to be added.
1112
- Add validation to the variable. Validation should be added in both the terraform code and the ibm_catalog.json. See the below code snippets for the recommended validation to be added across all DAs. Ideally all DAs should have the same validation so the `prefix` value is accepted for all DAs for the case where it may be used for input mapping when configuring dependant (add-on) DAs.
1213
- Ensure to include the details of the required format in the variable description, an example value, and link to the helper doc just like what is shown in the code snippet below. This should be consistent across all DAs.
1314
- The prefix variable logic should be handled in a local variable so logic does not have repeated in the terraform code. For example:
@@ -65,6 +66,11 @@ variable "prefix" {
6566
```json
6667
{
6768
"key": "prefix",
69+
"required": true,
70+
"default_value": "dev",
71+
"random_string": {
72+
"length": 4
73+
},
6874
"value_constraints": [
6975
{
7076
"type": "regex",

0 commit comments

Comments
 (0)