You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/da-implementation-guidelines.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,6 @@
1
-
# Prefix in Deployable Architecture
1
+
# Deployable Architecture authoring guidelines
2
+
3
+
## Prefix in Deployable Architecture
2
4
3
5
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:
4
6
@@ -40,7 +42,17 @@ To ensure compatibility and consistency, the prefix must follow these rules:
40
42
Here is the code snippet for your reference.
41
43
42
44
```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 (-)
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 ('--')."
51
63
}
52
-
53
64
validation {
54
65
# must not exceed 16 characters in length
55
66
condition = length(var.prefix) <= 16
56
67
error_message = "Prefix must not exceed 16 characters."
0 commit comments