Skip to content
Closed
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
6 changes: 0 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
locals {
# Check only resource group was given or existing group was given but not both
# (approach based on https://stackoverflow.com/a/66682419)

### Check if both groups were given
exist_both_resource_group_cdn = !(var.resource_group_name != null && var.existing_resource_group_name != null)
exist_both_resource_group_msg = "only 'resource_group_name' or 'existing_resource_group_name' can be given, but both have been given"
# tflint-ignore: terraform_unused_declarations
exist_both_resource_group_check = regex("^${local.exist_both_resource_group_msg}$", (local.exist_both_resource_group_cdn ? local.exist_both_resource_group_msg : ""))
}

data "ibm_resource_group" "existing_resource_group" {
Expand Down
4 changes: 4 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ variable "resource_group_name" {
type = string
description = "Name of the resource group to create. Required if not using existing resource group"
default = null
validation {
condition = var.resource_group_name != null ? var.existing_resource_group_name == null : true
error_message = "only 'resource_group_name' or 'existing_resource_group_name' can be given, but both have been given"
}
}

variable "existing_resource_group_name" {
Expand Down
2 changes: 1 addition & 1 deletion version.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.0.0"
required_version = ">= 1.9.0"

# Each required provider's version should be a flexible range to future proof the module's usage with upcoming minor and patch versions.
required_providers {
Expand Down