-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnullstone.tf
More file actions
33 lines (30 loc) · 829 Bytes
/
nullstone.tf
File metadata and controls
33 lines (30 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
terraform {
required_providers {
google = {
version = "~>6.12.0"
}
ns = {
source = "nullstone-io/ns"
}
}
}
data "ns_workspace" "this" {}
// Generate a random suffix to ensure uniqueness of resources
resource "random_string" "resource_suffix" {
length = 5
lower = true
upper = false
numeric = false
special = false
}
locals {
tags = { for k, v in data.ns_workspace.this.tags : lower(k) => v }
block_name = data.ns_workspace.this.block_name
resource_name = "${data.ns_workspace.this.block_ref}-${random_string.resource_suffix.result}"
labels = {
"stack" = data.ns_workspace.this.stack_name
"block-ref" = data.ns_workspace.this.block_ref
"block-name" = data.ns_workspace.this.block_name
"env" = data.ns_workspace.this.env_name
}
}