Skip to content

Commit

Permalink
fix: Update variable's order in variables.tf and update display metad… (
Browse files Browse the repository at this point in the history
  • Loading branch information
q2w authored Nov 27, 2024
1 parent 0a119a5 commit 29eb7e2
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 45 deletions.
3 changes: 3 additions & 0 deletions modules/simple_bucket/metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ spec:
force_destroy:
name: force_destroy
title: Force Destroy
invisible: false
iam_members:
name: iam_members
title: Iam Members
Expand All @@ -67,6 +68,8 @@ spec:
name:
name: name
title: Name
regexValidation: ^[a-z0-9][a-z0-9-_.]{2,61}[a-z0-9]$
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.
project_id:
name: project_id
title: Project Id
Expand Down
50 changes: 25 additions & 25 deletions modules/simple_bucket/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ spec:
location: examples/simple_bucket
interfaces:
variables:
- name: name
description: The name of the bucket.
varType: string
required: true
- name: project_id
description: The ID of the project to create the bucket in.
varType: string
Expand All @@ -50,24 +46,10 @@ spec:
description: The location of the bucket. See https://cloud.google.com/storage/docs/locations.
varType: string
required: true
- name: storage_class
description: The Storage Class of the new bucket.
- name: name
description: The name of the bucket.
varType: string
- name: labels
description: A set of key/value label pairs to assign to the bucket.
varType: map(string)
- name: bucket_policy_only
description: Enables Bucket Policy Only access to a bucket.
varType: bool
defaultValue: true
- name: versioning
description: While set to true, versioning is fully enabled for this bucket.
varType: bool
defaultValue: true
- name: autoclass
description: While set to true, autoclass is enabled for this bucket.
varType: bool
defaultValue: false
required: true
- name: force_destroy
description: When deleting a bucket, this boolean option will delete all contained objects. If false, Terraform will fail to delete buckets which contain objects.
varType: bool
Expand All @@ -83,14 +65,32 @@ spec:
connections:
- source:
source: github.com/GoogleCloudPlatform/terraform-google-cloud-run//modules/v2
version: ~> 0.13
version: ">= 0.13"
spec:
outputExpr: '{"member": service_account_id.member, "role": "roles/storage.objectAdmin"}'
outputExpr: "{\"member\": service_account_id.member, \"role\": \"roles/storage.objectAdmin\"}"
- source:
source: github.com/terraform-google-modules/terraform-google-service-accounts//modules/simple-sa
version: ~> 4.4
version: ">= 4.4"
spec:
outputExpr: '{"member": iam_email, "role": "roles/storage.objectAdmin"}'
outputExpr: "{\"member\": iam_email, \"role\": \"roles/storage.objectAdmin\"}"
- name: storage_class
description: The Storage Class of the new bucket.
varType: string
- name: labels
description: A set of key/value label pairs to assign to the bucket.
varType: map(string)
- name: bucket_policy_only
description: Enables Bucket Policy Only access to a bucket.
varType: bool
defaultValue: true
- name: versioning
description: While set to true, versioning is fully enabled for this bucket.
varType: bool
defaultValue: true
- name: autoclass
description: While set to true, autoclass is enabled for this bucket.
varType: bool
defaultValue: false
- name: retention_policy
description: Configuration of the bucket's data retention policy for how long objects in the bucket should be retained.
varType: |-
Expand Down
40 changes: 20 additions & 20 deletions modules/simple_bucket/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
* limitations under the License.
*/

variable "name" {
description = "The name of the bucket."
type = string
}

variable "project_id" {
description = "The ID of the project to create the bucket in."
type = string
Expand All @@ -29,6 +24,26 @@ variable "location" {
type = string
}

variable "name" {
description = "The name of the bucket."
type = string
}

variable "force_destroy" {
description = "When deleting a bucket, this boolean option will delete all contained objects. If false, Terraform will fail to delete buckets which contain objects."
type = bool
default = false
}

variable "iam_members" {
description = "The list of IAM members to grant permissions on the bucket."
type = list(object({
role = string
member = string
}))
default = []
}

variable "storage_class" {
description = "The Storage Class of the new bucket."
type = string
Expand Down Expand Up @@ -60,21 +75,6 @@ variable "autoclass" {
default = false
}

variable "force_destroy" {
description = "When deleting a bucket, this boolean option will delete all contained objects. If false, Terraform will fail to delete buckets which contain objects."
type = bool
default = false
}

variable "iam_members" {
description = "The list of IAM members to grant permissions on the bucket."
type = list(object({
role = string
member = string
}))
default = []
}

variable "retention_policy" {
description = "Configuration of the bucket's data retention policy for how long objects in the bucket should be retained."
type = object({
Expand Down

0 comments on commit 29eb7e2

Please sign in to comment.