Created
June 5, 2019 20:54
-
-
Save claydanford/425b0df108663679d93a876e618a2f78 to your computer and use it in GitHub Desktop.
How to generate external user-data and pass it into the terrform module.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "jenkins_ha_agents" { | |
source = "neiman-marcus/jenkins-ha-agents/aws" | |
snipped for brevity… | |
extra_agent_userdata = "${data.template_file.extra_agent_userdata.rendered}" | |
extra_agent_userdata_merge = "list(append)+dict(recurse_array)+str()" | |
extra_master_userdata = "${data.template_file.extra_master_userdata.rendered}" | |
extra_master_userdata_merge = "list(append)+dict(recurse_array)+str()" | |
} | |
data "template_file" "extra_agent_userdata" { | |
vars { | |
foo = "bar" | |
} | |
template = <<EOF | |
--- | |
runcmd: | |
- echo 'foo = ${foo}' | |
EOF | |
} | |
data "template_file" "extra_master_userdata" { | |
vars { | |
foo = "bar" | |
} | |
template = <<EOF | |
--- | |
runcmd: | |
- echo 'foo = ${foo}' | |
EOF | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment