Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-2556

Building Infrastructure with Terraform and Ansible on AWS

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:

      Description

      The project is to automate the process of provisioning AWS services, configuring the software setup required, and deploying the service. Terraform is used to create and manage the infrastructure services in AWS. It will be used to create ec2 instance, RDS, security groups, S3 bucket, etc. Terraform will call an Ansible playbook that will deploy the Django application on ec2 instance.

      The advantage of using terraform over Ansible for building the infrastructure would be the elimination of the control node, and we can destroy all the infrastructure created by terraform using one command line if something goes wrong.

      We can also use AWS Cloud Formation, which is a similar tool as terraform but, the only disadvantage of cloud formation is that it is not an open-source tool and Cloud formation is only for AWS services. Terraform can be used with AWS, Google Cloud Platform, OpenStack, and Microsoft Azure.

      References:
      https://www.hashicorp.com/resources/ansible-terraform-better-together
      https://selleo.com/blog/why-choose-terraform-over-chef-puppet-ansible-saltstack-and-cloudformation
      https://medium.com/faun/building-repeatable-infrastructure-with-terraform-and-ansible-on-aws-3f082cd398ad

        Attachments

          Activity

          Hide
          aloraine Ann Loraine added a comment -

          request for Chirag Chandrahas Shetty:
          Please make note of where the image (Figure 1) came from.

          Show
          aloraine Ann Loraine added a comment - request for Chirag Chandrahas Shetty : Please make note of where the image (Figure 1) came from.
          Show
          chirag24 Chirag Chandrahas Shetty added a comment - Image is from the following blog: https://medium.com/faun/building-repeatable-infrastructure-with-terraform-and-ansible-on-aws-3f082cd398ad
          Hide
          aloraine Ann Loraine added a comment -

          During the demo you gave some time ago, you showed some proof-of-concept code. Do you mind sharing that code - maybe as a link to a github repo or something like that?
          (In the upcoming spring I am hoping we will have time to look into this more.)

          attn: Chirag Chandrahas Shetty

          Show
          aloraine Ann Loraine added a comment - During the demo you gave some time ago, you showed some proof-of-concept code. Do you mind sharing that code - maybe as a link to a github repo or something like that? (In the upcoming spring I am hoping we will have time to look into this more.) attn: Chirag Chandrahas Shetty
          Hide
          chirag24 Chirag Chandrahas Shetty added a comment - - edited

          I changed the code so that it can create the following resources instead of only one ec2 instance:

          1) EC2 instance
          2) RDS
          3) S3 bucket

          I have commented out the part of uploading and running an ansible playbook but the code is working and tested.

          link: https://github.com/chirag06/aws-terraform

          cc: Ann Loraine

          Show
          chirag24 Chirag Chandrahas Shetty added a comment - - edited I changed the code so that it can create the following resources instead of only one ec2 instance: 1) EC2 instance 2) RDS 3) S3 bucket I have commented out the part of uploading and running an ansible playbook but the code is working and tested. link: https://github.com/chirag06/aws-terraform cc: Ann Loraine
          Hide
          aloraine Ann Loraine added a comment - - edited

          What I like best about this is that you can easily destroy resources declared in the terraform script by running `terraform destroy`.
          Moving to closed.

          Show
          aloraine Ann Loraine added a comment - - edited What I like best about this is that you can easily destroy resources declared in the terraform script by running `terraform destroy`. Moving to closed.

            People

            • Assignee:
              chirag24 Chirag Chandrahas Shetty
              Reporter:
              chirag24 Chirag Chandrahas Shetty
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: