Coder Social home page Coder Social logo

aws-meetup-group-terraform's Introduction

aws-meetup-group-terraform-and-pulumi

Configiration files for Terraform Meetup as well as Pulumi typescript stack converted from TF files

Getting started

  • Create an EC2 Key Pair in AWS console
  • Download and set privs on ssh pem file
  • Install Terraform and create first deployment
  • Create AWS CLI Account
  • Deploy IaaS Hosting Stack with EC2 and RDS
  • Install Pulumi and deploy IaaS hosting stack

Create Key Pair:

Create Key Pair

Download and set privs on ssh pem file:

  • mv ~/Downloads/aws-meetup-group-key.pem ~/.ssh/
  • chmod 400 ~/.ssh/aws-meetup-group-key.pem

Create AWS CLI Account

IAM > Users > New User

  • Name user
    • Name User
  • Add to group or role with admin privs
    • Add User To Group
  • Configure access credenitals
    • Configure Credentials

Install AWS CLI

  • Mac:
    • Homebrew: brew install awscli
    • Bundled installer: curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" unzip awscli-bundle.zip sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
  • Windows:

Configure AWS CLI Access Locally

  • aws configure
    • Configure Credentials
  • Configure by viewing contents of ~/.aws/credentials or %UserProfile%\.aws\credentials
    • Verify Credentials

Install Terraform

  • Homebrew (Mac): brew install terraform
  • Chocolatey (Windows): choco install terraform
  • Manual download: Terraform.IO

TF Hello World file

provider "aws" {
  version = "~> 2.0"
  region  = "us-east-1"
}
resource "aws_vpc" "main" {
  cidr_block = "192.168.225.0/24"
  enable_dns_support = true
  enable_dns_hostnames = true
  tags = {
    CostCenter = "tf-helloworld"
  }
}
resource "aws_subnet" "main-subnet" {
  vpc_id     = "${aws_vpc.main.id}"
  cidr_block = "192.168.225.0/25"
  availability_zone = "us-east-1a"
  tags = {
    CostCenter = "tf-helloworld"
  }
}

Plan, Apply, Show, And Destroy

  • terraform plan
  • terraform apply
  • terraform show
  • terraform destroy

Create Pulumi Account and create Access Key

Install Pulumi and Install AWS plugin

  • Mac: brew install pulumi
  • Windows
    • choco install pulumi
    • @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex ((New-Object System.Net.WebClient).DownloadString('https://get.pulumi.com/install.ps1'))" && SET "PATH=%PATH%;%USERPROFILE%\.pulumi\bin"
  • pulumi plugin install resource aws 1.18.0

Initialize Pulumi Stack and Deploy

  • cd pulumi-iaas-hosting-stack
  • pulumi stack init
    • You will need to enter access token created earlier in Pulumi portal
  • Install Pulumi npm install @pulumi/aws
  • pulumi up

Destroy Resrouces and Delete Stack

  • pulumi destroy
  • pulumi stack rm <account>/<stack>/<env> --force

aws-meetup-group-terraform's People

Contributors

kevasync avatar

Stargazers

 avatar Kefan You avatar Jaejun Lee avatar

Watchers

 avatar

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.