mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
Thought it'd be helpful to show a bare-bones example of a project with a parameter, along with references to the Terraform docs so developers can learn about more interesting variable types (and ways to leverage them in expressions). With this project, we can go through the `projects create` flow of setting a parameter: <img width="677" alt="Screen Shot 2022-02-18 at 7 53 07 PM" src="https://user-images.githubusercontent.com/88213859/154785203-ab626268-0e51-48c3-b374-3d49d541042b.png">
12 lines
408 B
HCL
12 lines
408 B
HCL
# For interesting types of variables, check out the terraform docs:
|
|
# https://www.terraform.io/language/values/variables#declaring-an-input-variable
|
|
variable "message" {
|
|
type = string
|
|
}
|
|
|
|
# And refer to the docs on using expressions to make use of variables:
|
|
# https://www.terraform.io/language/expressions/strings#interpolation
|
|
output "hello_provisioner" {
|
|
value = "Hello, provisioner: ${var.message}"
|
|
}
|