Skip to content

Commit 81d7b51

Browse files
authored
fix: added missing validations (#37)
1 parent 0bc84b4 commit 81d7b51

File tree

2 files changed

+57
-3
lines changed

2 files changed

+57
-3
lines changed

examples/basic/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module "bigtable" {
4343
tables = {
4444
table1 = {
4545
table_name = "test-table1"
46-
split_keys = ["a", "b", "c"]
46+
split_keys = ["a", "b", "c"]
4747
column_family = {
4848
family1 = {
4949
family = "first-family"
@@ -56,12 +56,12 @@ module "bigtable" {
5656
}
5757

5858
table2 = {
59-
table_name = "test-table2"
59+
table_name = "test-table2"
6060
deletion_protection = "UNPROTECTED"
6161
}
6262

6363
table3 = {
64-
table_name = "test-table3"
64+
table_name = "test-table3"
6565
deletion_protection = "UNPROTECTED"
6666
}
6767
}

metadata.display.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ spec:
4848
storage_type:
4949
name: storage_type
5050
title: Storage Type
51+
enumValueLabels:
52+
- label: SSD
53+
value: SSD
54+
- label: HDD
55+
value: HDD
5156
tables:
5257
name: tables
5358
title: Tables
@@ -57,7 +62,56 @@ spec:
5762
value:
5863
table1:
5964
table_name: table-1
65+
properties:
66+
table_name:
67+
name: table_name
68+
title: Table Name
69+
regexValidation: ^[A-Za-z0-9._-]{1,50}$
70+
validation: Must be between 1 and 50 characters, and can contain only lowercase letters, numbers, hyphens, and underscores.
71+
deletion_protection:
72+
name: deletion_protection
73+
title: Deletion Protection
74+
enumValueLabels:
75+
- label: PROTECTED
76+
value: PROTECTED
77+
- label: UNPROTECTED
78+
value: UNPROTECTED
79+
change_stream_retention:
80+
name: change_stream_retention
81+
title: Change Stream Retention
82+
regexValidation: ^(0s|[1-9][0-9]*s|[1-5]?[0-9]m|[1-2]?[0-9]h|[1-7]d)$
83+
validation: A string indicating the duration over which Change Stream data will be retained. Valid units are "s" for seconds, "m" for minutes, "h" for hours, and "d" for days. Must be at least 0s (0 seconds). The maximum duration is 7 days.
84+
automated_backup_policy:
85+
name: automated_backup_policy
86+
title: Automated Backup Policy
87+
properties:
88+
retention_period:
89+
name: retention_period
90+
title: Retention Period
91+
regexValidation: "^(0|(?:[0-9]+h)?(?:[0-9]+m)?(?:[0-9]+s)?)$"
92+
validation: Must be "0" or a valid duration in the format "{h}h{m}m{s}s" (e.g., "72h0m0s"). Hours, minutes, and seconds are optional but must be in order
93+
frequency:
94+
name: frequency
95+
title: Frequency
96+
regexValidation: "^(0|(?:[0-9]+h)?(?:[0-9]+m)?(?:[0-9]+s)?)$"
97+
validation: Must be "0" or a valid duration in the format "{h}h{m}m{s}s" (e.g., "72h0m0s"). Hours, minutes, and seconds are optional but must be in order
6098
zones:
6199
name: zones
62100
title: Zones
63101
level: 1
102+
properties:
103+
cluster_id:
104+
name: cluster_id
105+
title: Cluster ID
106+
regexValidation: ^[a-z0-9-]{6,30}$
107+
validation: Must be between 6 and 30 characters, and can only contain lowercase letters, numbers, and hyphens.
108+
zone:
109+
name: zone
110+
title: Zone
111+
regexValidation: ^[a-z]+(-[a-z0-9]+)+-[a-z]$
112+
validation: Must be a valid google cloud zone.
113+
kms_key_name:
114+
name: kms_key_name
115+
title: KMS Key Name
116+
regexValidation: "^projects/[A-Za-z0-9_-]+/locations/[A-Za-z0-9_-]+/keyRings/[A-Za-z0-9_-]+/cryptoKeys/[A-Za-z0-9_-]+$"
117+
validation: Must be a valid Cloud KMS key resource name in the format:projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]

0 commit comments

Comments
 (0)