Skip to content

Commit 519ca9e

Browse files
Shikha MaheshwariShikha Maheshwari
authored andcommitted
address review comments
1 parent a552fa4 commit 519ca9e

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ You can see the published documentation at https://terraform-ibm-modules.github.
2121
- Maintaining the GitHub project
2222
- [Maintainers contribution process](https://terraform-ibm-modules.github.io/documentation/#/maintain-module.md)
2323
- [About merging pull requests](https://terraform-ibm-modules.github.io/documentation/#/merging.md)
24-
- Deployable Architecture Reference Docs
25-
- [Prefix Usage Guide](https://terraform-ibm-modules.github.io/documentation/#/DA-prefix.md)
2624
- Reference
2725
- [Module authoring guidelines](https://terraform-ibm-modules.github.io/documentation/#/implementation-guidelines.md)
26+
- [Deployable Architecture authoring guidelines](https://terraform-ibm-modules.github.io/documentation/#/da-implementation-guidelines.md)
2827
- [Design guidelines](https://terraform-ibm-modules.github.io/documentation/#/design-guidelines.md)
2928
- [Module structure](https://terraform-ibm-modules.github.io/documentation/#/module-structure.md)
3029
- [Metadata file (index.yml)](https://terraform-ibm-modules.github.io/documentation/#/module-catalog-metadata.md)

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- [About merging pull requests](merging.md)
1414
- Reference
1515
- [Module authoring guidelines](implementation-guidelines.md)
16+
- [Deployable Architecture authoring guidelines](da-implementation-guidelines.md)
1617
- [Design guidelines](design-guidelines.md)
1718
- [Module structure](module-structure.md)
1819
- [Metadata file (index.yml)](module-catalog-metadata.md)

docs/DA-prefix.md renamed to docs/da-implementation-guidelines.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Prefix in Deployable Architecture
1+
# Deployable Architecture authoring guidelines
2+
3+
## Prefix in Deployable Architecture
24

35
The **`prefix`** input variable allows you to prepend a custom string to the names of all resources created by this automation. This is especially useful for:
46

@@ -40,7 +42,17 @@ To ensure compatibility and consistency, the prefix must follow these rules:
4042
Here is the code snippet for your reference.
4143

4244
```hcl
43-
validation {
45+
variable "prefix" {
46+
type = string
47+
nullable = true
48+
description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: prod-0205-cos."
49+
50+
validation {
51+
# - null and empty string is allowed
52+
# - Must not contain consecutive hyphens (--): length(regexall("--", var.prefix)) == 0
53+
# - Starts with a lowercase letter: [a-z]
54+
# - Contains only lowercase letters (a–z), digits (0–9), and hyphens (-)
55+
# - Must not end with a hyphen (-): [a-z0-9]
4456
condition = (var.prefix == null || var.prefix == "" ? true :
4557
alltrue([
4658
can(regex("^[a-z][-a-z0-9]*[a-z0-9]$", var.prefix)),
@@ -49,10 +61,10 @@ validation {
4961
)
5062
error_message = "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--')."
5163
}
52-
5364
validation {
5465
# must not exceed 16 characters in length
5566
condition = length(var.prefix) <= 16
5667
error_message = "Prefix must not exceed 16 characters."
57-
}
68+
}
69+
}
5870
```

0 commit comments

Comments
 (0)