Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update variable's order in variables.tf and update display metad… #368

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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