Skip to content

Commit

Permalink
fix: fixed bug in validation of resource_keys roles. It was incorre…
Browse files Browse the repository at this point in the history
…ctly checking for `None` an now it correctly checks for `NONE` (#632)

Co-authored-by: Jordan-Williams2 <[email protected]>
  • Loading branch information
jor2 and Jordan-Williams2 authored Jun 4, 2024
1 parent 49cd08a commit 5473ee2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ variable "resource_keys" {
validation {
# From: https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_key
# Service roles (for Cloud Object Storage) https://cloud.ibm.com/iam/roles
# Reader, Writer, Manager, Content Reader, Object Reader, Object Writer, None
# Reader, Writer, Manager, Content Reader, Object Reader, Object Writer, NONE
condition = alltrue([
for key in var.resource_keys : contains(["Writer", "Reader", "Manager", "Content Reader", "Object Reader", "Object Writer", "None"], key.role)
for key in var.resource_keys : contains(["Writer", "Reader", "Manager", "Content Reader", "Object Reader", "Object Writer", "NONE"], key.role)
])
error_message = "resource_keys role must be one of 'Writer', 'Reader', 'Manager', 'Content Reader', 'Onject Reader', 'Object Writer', 'None', reference https://cloud.ibm.com/iam/roles and `Cloud Object Storage`"
error_message = "resource_keys role must be one of 'Writer', 'Reader', 'Manager', 'Content Reader', 'Onject Reader', 'Object Writer', 'NONE', reference https://cloud.ibm.com/iam/roles and `Cloud Object Storage`"
}
}

Expand Down

0 comments on commit 5473ee2

Please sign in to comment.