GithubHelp home page GithubHelp logo

ari-hacks / terraform-aws-automation Goto Github PK

View Code? Open in Web Editor NEW
2.0 0.0 2.0 7 KB

⚙️ Examples of provisioning AWS resources with Terraform

License: MIT License

HCL 100.00%
aws terraform aws-cli hcl ec2 s3-bucket terraform-aws terraform-cli iam iam-policies

terraform-aws-automation's Introduction

Automating AWS with Terraform

External Resources

Amazon EC2 AMI Locator

Pre-requisite Setup

AWS Account - Free Tier

  • Sign up for AWS Free Tier account if you do not already have one

Create an IAM user

  1. Log into your root AWS account
  2. Select Services > IAM
  3. On the left nav bar select 'Users'
  4. Select 'Add user'
  5. Create a username 'terraform-admin'
  6. Select AWS access type as Programmatic access (and AWS management console access to view resources on the dashboard)
  7. Select Next: Permissions
  8. Select Create group
  9. Add a group name 'admins'
  10. Check AdministratorsAccess and Create group, check group
  11. Select Next: Tags
  12. Select Next: Review
  13. Select Create User
  14. You will need the generated access key Id, and the secret access key (Download the csv provided or store these values)

AWS CLI installation

  1. mac: brew install awscli | aws --version
  2. windows: instructions
  3. linux: instructions

AWS CLI configuration

aws credentials configured locally these credentials are stored in ~/.aws/credentials

        aws configure   
        AWS Access Key ID [None]: <access key>
        AWS Secret Access Key [None]: <secret key>
        Default region name [None]: us-east-1
        Default output format [None]: json

Terraform installation

  1. mac: brew install terraform | terraform -help
  2. windows: choco install terraform | terraform -help
  3. linux: download | echo $PATH | mv ~/Downloads/terraform /usr/local/bin/ | terraform -help

Local Setup

clone the repo and navigate to the directory

git clone https://github.com/ari-hacks/terraform-aws-automation.git
cd terraform-aws-automation

In the terminal cd into one of the directories from the list above

Run these commands to provision with Terraform

#Initialize Terraform
terraform init
#Check the plan to make sure the configuration will do what we expect it to do
terraform plan
#Apply the execution plan and build the stack
terraform apply
#Check the resource is up
terraform state list
terraform state show 'type.name'
#Tear down all provisions
terraform destroy

terraform-aws-automation's People

Contributors

ari-hacks avatar

Stargazers

 avatar  avatar

Forkers

syllogy gabmen567

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.