From 213a2523b919013b10d84ab13621ddf677c4344f Mon Sep 17 00:00:00 2001 From: Bryan Phelps Date: Mon, 21 Feb 2022 18:58:59 +0000 Subject: [PATCH] refactor: Add example of project with resource --- examples/project-with-resource/main.tf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 examples/project-with-resource/main.tf diff --git a/examples/project-with-resource/main.tf b/examples/project-with-resource/main.tf new file mode 100644 index 0000000000000..bd45f798a191b --- /dev/null +++ b/examples/project-with-resource/main.tf @@ -0,0 +1,17 @@ +# 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 +} + +# We can use a "null_resource" to test resources without a cloud provider: +# https://www.terraform.io/language/resources/provisioners/null_resource +resource "null_resource" "minimal_resource" { + + # Note that Terraform's `provisioner` concept is generally an anti-pattern - + # more info here: https://www.terraform.io/language/resources/provisioners/syntax + # But it's helpful here for testing a resource. + provisioner "local-exec" { + command = "echo ${var.message}" + } +}