본문 바로가기

IaC/Terraform

(5)
5. Terraform : (AWS)Internet Gateway 생성 인터넷 게이트웨이를 생성하고, 생성 시 지난 번 생성했던 vpc와 연결해보자 resource "aws_internet_gateway" "mhan_ig" { vpc_id = aws_vpc.mhan_vpc.id tags = { "NAME" = "mhan_IG" } } 생성 확인 Reference. https://virtualtech.tistory.com/89?category=1064658 Terraform : 4. Internet Gateway Create 자 오늘은 아주 간단한 작업입니다. VPC의 외부 통신이 가능하게 위한 인터넷 게이트웨이 생성 및 VPC 연결 작업입니다. 1. 구성도 2. Terrafor Code VPC_ID은 이전에 작업한 VPC의 ID를 참조하는 코드로 작 virtualtech.t..
4. Terraform : Subnet 생성 ap-northeast-2a Public Subnet (mhan_PUB-A) : 10.0.0.0/24 Private Subnet (mhan_WAS-A) : 10.0.2.0./24 Private Subnet (mhan_DB-A) : 10.0.4.0/24 ap-northeast-2c Public Subnet (mhan_PUB-C) : 10.0.1.0/24 Private Subnet (mhan_WAS-C) : 10.0.3.0./24 Private Subnet (mhan_DB-C) : 10.0.5.0/24 위와 같이 서브넷을 생성한다. # 가용 영역 a의 public subnet resource "aws_subnet" "mhan_puba" { vpc_id = aws_vpc.mhan_vpc.id cidr_bloc..
3. Terraform : VPC 생성 provider "aws" { region = "ap-northeast-2" } resource "aws_vpc" "mhan_vpc" { cidr_block ="10.0.0.0/16" enable_dns_hostnames = true enable_dns_support = true tags = { "Name" = "mhan-vpc" } } resource 지시자는 aws 상에 Terraform을 이용하여 생성할 자원을 의미한다. https://registry.terraform.io/providers/hashicorp/aws/latest/docs Terraform Registry registry.terraform.io 위 사이트 참고 "aws_vpc"는 생성할 리소스로서 상기 문서에 지정된 대로만 사용해야 ..
2. Terraform : Key Upload C:\Users\MH> ssh-keygen -m PEM -f .ssh\mhan2.key -q -N "" C:\Users\MH> notepad .ssh\mhan2.key C:\Users\MH>notepad .ssh\mhan2.key.pub > aws ec2 import-key-pair --key-name "mhan2.key" --public-key-material fileb://.ssh/mhan2.key.pub upload한 키 확인 resource "aws_key_pair" "mhan_key" { key_name = "mhan2-key" public_key = file("../.ssh/mhan2.key.pub") } resource "aws_key_pair" "mhan_key2" { key_name = ..
1. Terraform : Chocolatey/Terraform/VSCode 설치 및 실습 환경 구축 1. Chocolatey 설치 Chocolatey Windows용 무료 오픈 소스 패키지 관리 시스템 Chocolatey Software Docs | Setup / Install Chocolatey Software Docs | Setup / Install Chocolatey is software management automation for Windows that wraps installers, executables, zips, and scripts into compiled packages. Chocolatey integrates w/SCCM, Puppet, Chef, etc. Chocolatey is trusted by businesses to manage software deployments. doc..