Answers: <p>You can achieve the clone of the repo and the execution of docker-compose in several ways.</p>
  
  <p>You are right when you think that cloud-init could do that. Check <a href="https://devops.stackexchange.com/questions/10/how-to-use-cloud-init-with-terraform">this link</a> for more information</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-08-10T18:23:03.643Z
Answers: 2017-08-21T11:29:49.983Z
Answers: 2017-08-21T11:29:49.983Z
Answers: RuBiCK
Body: <p>I have a very simple terraform configuration. I boot up an aws instance of Ubuntu trusty and assign a security group. </p>
  
  <p>My question is who is responsible of getting the latest code from my code repo? is it a bash script in terraform <code>user_data</code> argument or should I make a modified AMI that has a bash script to pull the code repo.</p>
  
  <p>Basically my repo has docker configuration in it and all i need is to clone and do <code>docker-compose -f env.yml up</code></p>
  
Tags: <docker><amazon-web-services><terraform>
Title: terraform - how should I clone my code repo?
UserDisplayName: Hakim
ThreadText: # terraform - how should I clone my code repo?
  
  (Asked by: username_0 on 2017-08-10)
  
  I have a very simple terraform configuration. I boot up an aws instance of Ubuntu trusty and assign a security group.
  
  My question is who is responsible of getting the latest code from my code repo? is it a bash script in terraform `user_data` argument or should I make a modified AMI that has a bash script to pull the code repo.
  
  Basically my repo has docker configuration in it and all i need is to clone and do `docker-compose -f env.yml up`
  
  **Tags:** docker, amazon-web-services, terraform
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-08-10. Score: 1
  
  You can achieve the clone of the repo and the execution of docker-compose in several ways.
  
  You are right when you think that cloud-init could do that. Check [this link](https://devops.stackexchange.com/questions/10/how-to-use-cloud-init-with-terraform) for more information
  
  
  ---
  
  