diff --git a/README.md b/README.md index ef43ddb4..ab250073 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ No resources. | [apps](#input\_apps) | A map of code engine apps to be created. |
map(object({
image_reference = string
image_secret = optional(string)
run_env_variables = optional(list(object({
type = optional(string)
name = optional(string)
value = optional(string)
prefix = optional(string)
key = optional(string)
reference = optional(string)
})))
run_volume_mounts = optional(list(object({
mount_path = string
reference = string
name = optional(string)
type = string
})))
image_port = optional(number)
managed_domain_mappings = optional(string)
run_arguments = optional(list(string))
run_as_user = optional(number)
run_commands = optional(list(string))
run_service_account = optional(string)
scale_concurrency = optional(number)
scale_concurrency_target = optional(number)
scale_cpu_limit = optional(string)
scale_ephemeral_storage_limit = optional(string)
scale_initial_instances = optional(number)
scale_max_instances = optional(number)
scale_memory_limit = optional(string)
scale_min_instances = optional(number)
scale_request_timeout = optional(number)
scale_down_delay = optional(number)
})) | `{}` | no |
| [bindings](#input\_bindings) | A map of code engine bindings to be created. | map(object({
secret_name = string
components = list(object({
name = string
resource_type = string
}))
})) | `{}` | no |
| [builds](#input\_builds) | A map of code engine builds to be created. Requires 'ibmcloud\_api\_key' to be set for authentication and execution. | map(object({
output_image = string
output_secret = string # pragma: allowlist secret
source_url = string
strategy_type = string
source_context_dir = optional(string)
source_revision = optional(string)
source_secret = optional(string)
source_type = optional(string)
strategy_size = optional(string)
strategy_spec_file = optional(string)
timeout = optional(number)
})) | `{}` | no |
-| [cbr\_rules](#input\_cbr\_rules) | The list of context-based restrictions rules to create. | list(object({
description = string
account_id = string
rule_contexts = list(object({
attributes = optional(list(object({
name = string
value = string
}))) }))
enforcement_mode = string
operations = optional(list(object({
api_types = list(object({
api_type_id = string
}))
})))
})) | `[]` | no |
+| [cbr\_rules](#input\_cbr\_rules) | The context-based restrictions rule to create. Only one rule is allowed. | list(object({
description = string
account_id = string
rule_contexts = list(object({
attributes = optional(list(object({
name = string
value = string
}))) }))
enforcement_mode = string
operations = optional(list(object({
api_types = list(object({
api_type_id = string
}))
})))
})) | `[]` | no |
| [config\_maps](#input\_config\_maps) | A map of code engine config maps to be created. | map(object({
data = map(string)
})) | `{}` | no |
| [domain\_mappings](#input\_domain\_mappings) | A map of code engine domain mappings to be created. | map(object({
tls_secret = string # pragma: allowlist secret
components = list(object({
name = string
resource_type = string
}))
})) | `{}` | no |
| [existing\_project\_id](#input\_existing\_project\_id) | The ID of the existing project to which code engine resources will be added. It is required if var.project\_name is null. | `string` | `null` | no |
diff --git a/modules/build/scripts/build-run.sh b/modules/build/scripts/build-run.sh
index 4c505be7..b5fc6ef7 100755
--- a/modules/build/scripts/build-run.sh
+++ b/modules/build/scripts/build-run.sh
@@ -45,7 +45,7 @@ fi
# ibm cloud login
ibmcloud_login
-# selecet the right code engine project
+# select the right code engine project
ibmcloud ce project select -n "${CE_PROJECT_NAME}"
# check the image build status
diff --git a/variables.tf b/variables.tf
index 3e54572b..1be6b049 100644
--- a/variables.tf
+++ b/variables.tf
@@ -200,6 +200,10 @@ variable "cbr_rules" {
}))
})))
}))
- description = "The list of context-based restrictions rules to create."
+ description = "The context-based restrictions rule to create. Only one rule is allowed."
default = []
+ validation {
+ condition = length(var.cbr_rules) <= 1
+ error_message = "Only one CBR rule is allowed."
+ }
}