Which should be prefereble between user_data and provisioner to bootstrap a resource in Terraform?

0 votes
I can use user_data with a template file or a "remote-exec" provisioner with inline commands to bootstrap. Which one would be more ideal to use?

Can anyone help me with this?

Thanks
May 31, 2018 in Other DevOps Questions by Atul
• 10,240 points
961 views

1 answer to this question.

0 votes

user_data should be used as it is ideal and  user data is native to AWS, and the remote-exec provisioner is specific only to Terraform, which is just a way to call the AWS API.

You can view user_data on 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. Terraform's remote-exec provisioner can not do that.

I hope that above information will be helpful to you.

answered Jun 1, 2018 by Damon Salvatore
• 5,550 points

Related Questions In Other DevOps Questions

+2 votes
1 answer

Error: Reference to undeclared resource in terraform code

Check the vpc declaration in subnets, internet ...READ MORE

answered Nov 17, 2019 in Other DevOps Questions by ahmed
9,353 views
0 votes
1 answer

How to get issues count based on rules in a sonar project?

There are API docs in the footer ...READ MORE

answered May 4, 2018 in Other DevOps Questions by DareDev
• 6,870 points
1,111 views
+1 vote
2 answers

When do we use Chef or Azure SDK to create VM and deploy in automation

The solution to the automated deployment in ...READ MORE

answered Aug 21, 2018 in Other DevOps Questions by Priyaj
• 57,700 points
260 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
728 views
+2 votes
1 answer
0 votes
1 answer