It seems like I can use either user_data
with a template file or a "remote-exec" provisioner
with inline commands to bootstrap. So which one is considered more idiomatic?
相关问题
- What are the advantages ManageIQ has over OpenStac
- why does connect domain to “Shopify” ask for eithe
- How can my C# program behave differently depending
- Can group name variable be dynamic in azure pipeli
- Flask app cannot open server to Google Cloud Compu
相关文章
- iOS: What are DISTRIBUTION provisioning profiles u
- How to fix VM issue with minikube start ?
- Developing a Multitenant SaaS
- Rails/Capistrano tool to deploy static assets to R
- Android google cloud messaging sample not working
- Error creating AdHoc profile on iOS Provisioning P
- Docker Passing an argument Docker Entrypoint with
- Setting up slots or multiple environments for Azur
You should use
user_data
. The user data field is idiomatic because it's native to AWS, whereas the remote-exec provisioner is specific to Terraform, which is just one of many ways to call the AWS API.Also, the user-data is viewable in the AWS console, and often an important part of using Auto Scaling Groups in AWS, where you want each EC2 Instance to execute the same config code when it launches. It's not possible to do that with Terraform's remote-exec provisioner.
Though I do agree with Josh, if there are no run time changes to the instance you can use packer to build an ami and then use that in the launch config. That way you don't have to wait for user-data to run.
Packer is part of the Hashicorp family of tools
https://www.packer.io/docs/builders/amazon-ebs.html