Skip to content

Commit 29eb7e2

Browse files
authored
fix: Update variable's order in variables.tf and update display metad… (#368)
1 parent 0a119a5 commit 29eb7e2

File tree

3 files changed

+48
-45
lines changed

3 files changed

+48
-45
lines changed

modules/simple_bucket/metadata.display.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ spec:
4646
force_destroy:
4747
name: force_destroy
4848
title: Force Destroy
49+
invisible: false
4950
iam_members:
5051
name: iam_members
5152
title: Iam Members
@@ -67,6 +68,8 @@ spec:
6768
name:
6869
name: name
6970
title: Name
71+
regexValidation: ^[a-z0-9][a-z0-9-_.]{2,61}[a-z0-9]$
72+
validation: Use lowercase letters, numbers,underscores, periods and hyphens. Start with a letter/number and end with letter/number. Must be between 3 and 63 characters.
7073
project_id:
7174
name: project_id
7275
title: Project Id

modules/simple_bucket/metadata.yaml

+25-25
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ spec:
3838
location: examples/simple_bucket
3939
interfaces:
4040
variables:
41-
- name: name
42-
description: The name of the bucket.
43-
varType: string
44-
required: true
4541
- name: project_id
4642
description: The ID of the project to create the bucket in.
4743
varType: string
@@ -50,24 +46,10 @@ spec:
5046
description: The location of the bucket. See https://cloud.google.com/storage/docs/locations.
5147
varType: string
5248
required: true
53-
- name: storage_class
54-
description: The Storage Class of the new bucket.
49+
- name: name
50+
description: The name of the bucket.
5551
varType: string
56-
- name: labels
57-
description: A set of key/value label pairs to assign to the bucket.
58-
varType: map(string)
59-
- name: bucket_policy_only
60-
description: Enables Bucket Policy Only access to a bucket.
61-
varType: bool
62-
defaultValue: true
63-
- name: versioning
64-
description: While set to true, versioning is fully enabled for this bucket.
65-
varType: bool
66-
defaultValue: true
67-
- name: autoclass
68-
description: While set to true, autoclass is enabled for this bucket.
69-
varType: bool
70-
defaultValue: false
52+
required: true
7153
- name: force_destroy
7254
description: When deleting a bucket, this boolean option will delete all contained objects. If false, Terraform will fail to delete buckets which contain objects.
7355
varType: bool
@@ -83,14 +65,32 @@ spec:
8365
connections:
8466
- source:
8567
source: github.com/GoogleCloudPlatform/terraform-google-cloud-run//modules/v2
86-
version: ~> 0.13
68+
version: ">= 0.13"
8769
spec:
88-
outputExpr: '{"member": service_account_id.member, "role": "roles/storage.objectAdmin"}'
70+
outputExpr: "{\"member\": service_account_id.member, \"role\": \"roles/storage.objectAdmin\"}"
8971
- source:
9072
source: github.com/terraform-google-modules/terraform-google-service-accounts//modules/simple-sa
91-
version: ~> 4.4
73+
version: ">= 4.4"
9274
spec:
93-
outputExpr: '{"member": iam_email, "role": "roles/storage.objectAdmin"}'
75+
outputExpr: "{\"member\": iam_email, \"role\": \"roles/storage.objectAdmin\"}"
76+
- name: storage_class
77+
description: The Storage Class of the new bucket.
78+
varType: string
79+
- name: labels
80+
description: A set of key/value label pairs to assign to the bucket.
81+
varType: map(string)
82+
- name: bucket_policy_only
83+
description: Enables Bucket Policy Only access to a bucket.
84+
varType: bool
85+
defaultValue: true
86+
- name: versioning
87+
description: While set to true, versioning is fully enabled for this bucket.
88+
varType: bool
89+
defaultValue: true
90+
- name: autoclass
91+
description: While set to true, autoclass is enabled for this bucket.
92+
varType: bool
93+
defaultValue: false
9494
- name: retention_policy
9595
description: Configuration of the bucket's data retention policy for how long objects in the bucket should be retained.
9696
varType: |-

modules/simple_bucket/variables.tf

+20-20
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "name" {
18-
description = "The name of the bucket."
19-
type = string
20-
}
21-
2217
variable "project_id" {
2318
description = "The ID of the project to create the bucket in."
2419
type = string
@@ -29,6 +24,26 @@ variable "location" {
2924
type = string
3025
}
3126

27+
variable "name" {
28+
description = "The name of the bucket."
29+
type = string
30+
}
31+
32+
variable "force_destroy" {
33+
description = "When deleting a bucket, this boolean option will delete all contained objects. If false, Terraform will fail to delete buckets which contain objects."
34+
type = bool
35+
default = false
36+
}
37+
38+
variable "iam_members" {
39+
description = "The list of IAM members to grant permissions on the bucket."
40+
type = list(object({
41+
role = string
42+
member = string
43+
}))
44+
default = []
45+
}
46+
3247
variable "storage_class" {
3348
description = "The Storage Class of the new bucket."
3449
type = string
@@ -60,21 +75,6 @@ variable "autoclass" {
6075
default = false
6176
}
6277

63-
variable "force_destroy" {
64-
description = "When deleting a bucket, this boolean option will delete all contained objects. If false, Terraform will fail to delete buckets which contain objects."
65-
type = bool
66-
default = false
67-
}
68-
69-
variable "iam_members" {
70-
description = "The list of IAM members to grant permissions on the bucket."
71-
type = list(object({
72-
role = string
73-
member = string
74-
}))
75-
default = []
76-
}
77-
7878
variable "retention_policy" {
7979
description = "Configuration of the bucket's data retention policy for how long objects in the bucket should be retained."
8080
type = object({

0 commit comments

Comments
 (0)