-
I made a couple changes to the dogfooding template. How do I test and validate locally using |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@johnstcn showed me his workflow:
Here's an example for some code that creates a script:
variable "dotfiles_uri" {
type = string
}
resource "local_file" "script" {
filename = "${path.module}/script.sh"
content = <<-EOF
#!/bin/sh
set -x
# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
code-server --auth none --port 13337 &
sudo service docker start
DOTFILES_URI=${var.dotfiles_uri}
if [ -n "$DOTFILES_URI" ]; then
coder dotfiles "$DOTFILES_URI" -y 2>&1 | tee ~/.personalize.log
fi
EOF
}
provider "local" {} How do I pass a value if the variable is optional? Like this: terraform apply -var dotfiles_uri="https://github.com/jsjoeio/dotfiles.git" |
Beta Was this translation helpful? Give feedback.
-
Valid template aws cloudformation validate-template --template-url s3.amazonaws.com/cloudformation-templates-us-east-1/S3_Bucket.template { Validation error The following example passes the --template-body parameter, to validate a template locally. aws cloudformation validate-template --template-body file:///home/local/test/sampletemplate.json { |
Beta Was this translation helpful? Give feedback.
@johnstcn showed me his workflow:
mkdir tmp/tf-template-test
touch main.tf
and add your Terraform codeterraform init
terraform apply
Here's an example for some code that creates a script:
main.tf