All Projects → resotto → aws-terraform

resotto / aws-terraform

Licence: GPL-3.0 License
AWS & Terraform Rocket Start Guide

Programming Languages

HCL
1544 projects

Projects that are alternatives of or similar to aws-terraform

Terraform Multienv
A template for maintaining a multiple environments infrastructure with Terraform. This template includes a CI/CD process, that applies the infrastructure in an AWS account.
Stars: ✭ 107 (+101.89%)
Mutual labels:  infrastructure, terraform
Terraform Aws Landing Zone
Terraform Module for AWS Landing Zone
Stars: ✭ 142 (+167.92%)
Mutual labels:  infrastructure, terraform
Toc
A Table of Contents of all Gruntwork Code
Stars: ✭ 111 (+109.43%)
Mutual labels:  infrastructure, terraform
Infra Personal
Terraform for setting up my personal infrastructure
Stars: ✭ 45 (-15.09%)
Mutual labels:  infrastructure, terraform
e9-cloudformation-docker-ecs
Docker on Amazon ECS with AWS Fargate using CloudFormation. https://devteds.com/episodes/9-docker-on-amazon-ecs-using-cloudformation
Stars: ✭ 78 (+47.17%)
Mutual labels:  aws-cli, aws-vpc
Mikado
🤖💨Mikado helps managing your AWS infrastructure for WordPress sites by defining an out-of-box, highly available, easy-to-deploy setup
Stars: ✭ 80 (+50.94%)
Mutual labels:  infrastructure, terraform
Terraform With Circleci Example
This is an example of automatic deployments of your infrastructure using terraform and CircleCI 2.0 workflows
Stars: ✭ 142 (+167.92%)
Mutual labels:  infrastructure, terraform
Aws Labs
step by step guide for aws mini labs. Currently maintained on : https://github.com/Cloud-Yeti/aws-labs Youtube playlist for labs:
Stars: ✭ 153 (+188.68%)
Mutual labels:  terraform, aws-ec2
Fogg
Manage Infrastructure as Code with less pain.
Stars: ✭ 181 (+241.51%)
Mutual labels:  infrastructure, terraform
Terrible
An Ansible playbook that apply the principle of the Infrastructure as Code on a QEMU/KVM environment.
Stars: ✭ 161 (+203.77%)
Mutual labels:  infrastructure, terraform
Cli
a lightweight, security focused, BDD test framework against terraform.
Stars: ✭ 918 (+1632.08%)
Mutual labels:  infrastructure, terraform
polynimbus
Multi-cloud infrastructure inventory and management tool, supporting AWS, Google Cloud, Azure, Oracle Cloud, Rackspace Cloud, Hetzner Cloud, Alibaba Cloud, e24cloud.com, Linode, Cloudflare, GoDaddy and Backblaze B2.
Stars: ✭ 70 (+32.08%)
Mutual labels:  aws-cli, aws-ec2
Udacity Data Engineering Projects
Few projects related to Data Engineering including Data Modeling, Infrastructure setup on cloud, Data Warehousing and Data Lake development.
Stars: ✭ 458 (+764.15%)
Mutual labels:  infrastructure, aws-ec2
Buildpipeline
AWS-powered serverless build, test and deploy pipeline ft. multiple environments
Stars: ✭ 105 (+98.11%)
Mutual labels:  infrastructure, terraform
Pipe
Continuous Delivery for Declarative Kubernetes, Serverless and Infrastructure Applications
Stars: ✭ 341 (+543.4%)
Mutual labels:  infrastructure, terraform
Terrascan
Detect compliance and security violations across Infrastructure as Code to mitigate risk before provisioning cloud native infrastructure.
Stars: ✭ 2,687 (+4969.81%)
Mutual labels:  infrastructure, terraform
Terraform Aws Spotgpu
Fully automated provisioning of AWS EC2 Spot Instances for Deep Learning workloads using Terraform.
Stars: ✭ 127 (+139.62%)
Mutual labels:  terraform, aws-ec2
Multi Env Deploy
Complete example of deploying complex web apps to AWS using Terraform, Ansible, and Packer
Stars: ✭ 132 (+149.06%)
Mutual labels:  terraform, aws-ec2
Terrahub
Terraform Automation and Orchestration Tool (Open Source)
Stars: ✭ 148 (+179.25%)
Mutual labels:  infrastructure, terraform
Infra
Infrastructure to set up the public Compiler Explorer instances and compilers
Stars: ✭ 184 (+247.17%)
Mutual labels:  infrastructure, terraform

aws-terraform

AWS with Terraform rocket start guide.


This guide is for who is new to Terraform.
Following this guide, you can learn how to operate Terraform commands.

NOTE

  • This guide doesn't cost at all now (2019/8/6), but in the future, that might just be the case. Even if that happens, it wouldn't cost 1 sandwich.

Infrastructure

On this guide, you can build following infrastructure with AWS and Terraform:

Requirements

AWS, AWS CLI, and Terraform

At first, please sign up AWS, and install AWS CLI and Terraform:

Then, please create your IAM user according to this guide.

After creating IAM user, please set your aws credentials and config with following command:

aws configure

You need to specify your IAM user's key info, your region, and output format.

AWS Access Key ID [None]: XXXXXXXXXXXXXXXXX
AWS Secret Access Key [None]: XXXXXXXXXXXXXXXXXXXX
Default region name [None]: us-west-1
Default output format [None]: json

If you change your IAM user, please run aws configure again, and set your new credentials.

Key Pair

If you don't have key pair like id_rsa and id_rsa.pub on your local machine, please run ssh-keygen command:

ssh-keygen -t rsa

This command will ask you some questions about where to save and passphrase, but on this guide you don't have to specify them.

Enter file in which to save the key (/Users/USERNAME/.ssh/id_rsa): [enter]
Enter passphrase (empty for no passphrase): [enter]
Enter same passphrase again: [enter]

Please confirm key pair created.

Your identification has been saved in /Users/USERNAME/.ssh/id_rsa.
Your public key has been saved in /Users/USERNAME/.ssh/id_rsa.pub.

Getting Started

Preparation

git clone [email protected]:resotto/aws-terraform.git
cd aws-terraform

First of all, if your public key is not located at ~/.ssh/id_rsa.pub, you need to fix path in ./modules/key_pair/key_pair.tf:

public_key = "${file("~/.ssh/id_rsa.pub")}"

Please move to env/prod or env/dev.

cd env/prod [env/dev]

Actually, there are no differences between prod and dev except for naming on this guide. In business, you can adopt different configuration between them.

Please fix region and AMI based on the region in ./variables.tf:

variable "region" {
  default = "ap-northeast-1" // fix this
}

variable "amis" {
  type = "map"
  default = {
    "ap-northeast-1" = "ami-0c3fd0f5d33134a76" // fix this
  }
}

Running Terraform

Please run following commands:

terraform init
terraform get -update
terraform plan
terraform apply

Let's check Elastic IP of the instance with terraform show:

terraform show | grep public_ip

Finally, please access to the instance with your private key. If your private key is not id_rsa, you need to fix this path specified with -i option.

ssh -i ~/.ssh/id_rsa -l ec2-user PUBLIC_IP

Terraform Commands

terraform init                    # source module copy, backend initialization, child module installation, and plugin installation
terraform console                 # interactive REPL
terraform fmt --recursive         # format indents in ./*/*.tf
terraform get -update             # download and update modules mentioned in the root module
terraform plan [-destroy]         # dry run
terraform apply                   # apply configuration
terraform show                    # check state
terraform destroy [-auto-approve] # destroy the Terraform-managed infrastructure

Detail

  • Separating environment directory
    • For separating terraform.tfstate, which stores state about infrastructure and configuration.

Feedback

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].