cloud-foundation-fabric/tests/modules/naming_convention/fixture/main.tf

66 lines
1.5 KiB
HCL

/**
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module "test" {
source = "../../../../modules/naming-convention"
prefix = var.prefix
suffix = var.suffix
use_resource_prefixes = var.use_resource_prefixes
environment = "dev"
team = "cloud"
resources = {
bucket = ["tf-org", "tf-sec", "tf-log"]
dataset = ["foobar", "frobniz"]
project = ["tf", "sec", "log"]
}
labels = {
project = {
tf = { scope = "global" }
}
}
separator_override = {
dataset = "_"
}
}
output "labels" {
value = module.test.labels
}
output "names" {
value = module.test.names
}
variable "prefix" {
type = string
default = null
}
variable "separator_override" {
type = map(string)
default = {}
}
variable "suffix" {
type = string
default = null
}
variable "use_resource_prefixes" {
type = bool
default = false
}