Deploying Code and Managing configuration with Terraform

0 votes

I am using Terraform to bring up new separate environments with ec2 machines, elb etc. and then maintaining configuration as well. Doing that with terraform and using AWS provider sounds fairly simple.

While launching those instances I want to install few packages etc. so that when Terraform launches the instances (servers) things/ apps should be up and running. And how do I deploy new code on the servers in this environment launched by Terraform? Should I use for eg. ansible playbooks/chef recipes/puppet manifests for that? or Terraform gives some other options/ways?

Jul 23, 2018 in DevOps on Cloud by Hannah
• 18,520 points
2,437 views

1 answer to this question.

0 votes

Try one of these for your first problem

  1. Create an AMI of your instance with the installed packages and specify that in the resource.
  2. Use the user data script to install the packages that you need when the instance starts.
  3. Use ansible playbooks/chef recipes/puppet to install packages once the instance is running (e.g. creating an opsworks stack with terraform)

For the second problem

Not the intended use case for terraform, use other tools like jenkins or aws services like codepipeline or codedeploy. Ansible/chef/puppet can also help (e.g. with opsworks)

answered Jul 23, 2018 by Kalgi
• 52,350 points

Related Questions In DevOps on Cloud

0 votes
1 answer
0 votes
2 answers

Configure Subdomains, Nginx-proxy and Docker-compose

If you are already using docker-compose I ...READ MORE

answered Aug 3, 2018 in DevOps on Cloud by Nilesh
• 7,060 points
8,644 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 views
+2 votes
1 answer
+2 votes
3 answers

can't make nginx try_files to work with default_index.html

Here's another convenient use of try_files, as ...READ MORE

answered Oct 18, 2018 in DevOps on Cloud by Hannah
• 18,520 points
5,241 views
0 votes
1 answer

High availability (HA) website load balanced across both Azure and AWS?

DNS load balancing is the practice of ...READ MORE

answered Jul 6, 2018 in DevOps on Cloud by Kalgi
• 52,350 points
667 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP