How best does one organize a project for AWS that makes use of peering connections. At present my folder structure looks like this


I'm also curious what are some strategies for handling provisioning. Right now I'm using Ansible and found that using the provisioning feature of Terraform meant duplicated code (but perhaps I was doing it wrong and there's a way around this).

  • Welcome to DevOps SE. Can you give an example of the duplicated code you are referencing? – chicks Aug 21 '18 at 17:46
  • For example, I have a playbook that installs docker on an instance. I had the same file in both provisioning and production. It didn't seem like Terraform exposes a variable the references the current director of the file that is being run. – redwoolf Aug 21 '18 at 18:31
  • Some code samples would be great to see where you’re hitting problems with defining your peering at the moment (although I suspect you might want to take a look at the remote_state data resource in the Terraform provider). Also, maybe this is two different questions? Re playbooks, you can reference them from anywhere - they don’t have to be in the same folder. Alternatively, you could use a Terraform module. – Tim Malone Aug 22 '18 at 20:21
  • @TimMalone Thanks for your comment. I'm not hitting problems, I'm asking for good practices on project organization for handling peering connections and provisioning? Basically, what do some other folks more experienced than myself do and why. – redwoolf Aug 22 '18 at 21:22
  • It’d be nice to see what you have at the moment ;) No point me taking time to write out what I do and then finding you already do the same thing! – Tim Malone Aug 22 '18 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.