Forked from mig5/gist:b0e1b2192c9e3bae1a60191dd7eba132
Created
December 1, 2016 02:18
-
-
Save lordnynex/cd8ec9aa5f9bd798038acc4413cef2e3 to your computer and use it in GitHub Desktop.
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
### autoscale.tf | |
data "template_file" "userdata" { | |
template = "${file("templates/userdata.tpl")}" | |
vars { | |
region = "${var.region}" | |
file_system_id = "${aws_efs_file_system.prod-efs.id}" | |
} | |
} | |
resource "aws_launch_configuration" "mig5-prod-lc" { | |
# <snip..> | |
user_data = "${data.template_file.userdata.rendered}" | |
} | |
### templates/userdata.tpl | |
#cloud-config | |
package_upgrade: false | |
runcmd: | |
- echo "$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).${file_system_id}.efs.${region}.amazonaws.com:/ /var/www/shared nfs defaults,vers=4.1 0 0" >> /etc/fstab | |
- mount -a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment