<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>

CC BY-SA 3.0
2017-08-10T18:23:03.643Z
2017-08-21T11:29:49.983Z
2017-08-21T11:29:49.983Z
RuBiCK
<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>

<docker><amazon-web-services><terraform>
terraform - how should I clone my code repo?
Hakim
# 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


---

