terraform
2019-01-21 (Mon) · 80 words

Terraform Install

$ brew install terraform
$ terraform version
Terraform v0.11.11

AWS Network Create

Credentials Create

terraform.tfvars

access_key = "AWS_ACCESS_KEY"
secret_key = "AWS_SECRET_KEY"
region     = "ap-northeast-1"
key_name   = "KEY_PAIR_NAME"

VPC Create

main.tf

variable "access_key" {}
variable "secret_key" {}
variable "region" {}

provider "aws" {
  access_key = "${var.access_key}"
  secret_key = "${var.secret_key}"
  region     = "${var.region}"
}

resource "aws_vpc" "vpc-1" {
  cidr_block = "10.0.0.0/16"
  tags {
    Name = "vpc-tf-sample"
  }
}
// AWS Plugin Install
$ terraform init
// Run
$ terraform apply

Top     back     Posts     Tags     About Me