본문 바로가기
728x90

Terrform4

Terraform VPC 생성 VPC란? 참조 : https://monta010.tistory.com/30 1. Custom VPC 생성 provider "aws"{ region = "ap-northeast-2" } resource "aws_vpc" "vpc-0-0-0-0" { cidr_block = "10.0.0.0/16" instance_tenancy = "default" enable_dns_hostnames = true tags = { Name = "vpc-0-0-0-0" } } 2. Public Subnet 및 Private Subnet 생성 resource "aws_vpc" "vpc-10-0-0-0" { cidr_block = "10.0.0.0/16" instance_tenancy = "default" enable_dns_h.. 2021. 8. 3.
Terraform Application Load Balancer(ALB)생성 ALB 생성 1. Provider 작성 provider "aws" { region = "ap-northeast-2" } 2. ALB 전용 Security_Group 적용 resource "aws_security_group" "allow_alb" { name = "allow_alb" description = "Allow alb inbound traffic" vpc_id = var.vpc_id ingress { description = "alb from VPC" from_port = 0 to_port = 0 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } egress { from_port = 0 to_port = 0 protocol = "-1" cidr_blocks = [.. 2021. 8. 2.
Terraform EC2 생성 Terraform EC2 생성 1) Provider 설정 provider "aws" { region = "ap-northeast-2" } 2) EC2 AMI Instacne 및 type 설정 - AMI 설정 - Type 설정 resource "aws_instance" "web-2a"{ ami = "ami-0a0de518b1fc4524c" instance_type = "t2.micro" } 3) Terraform AWS 적용 1.1 terraform Project 초기화 # terraform init 1.2 terraform Project 계획 확인 - 작성한 코드를 실제 AWS에 생성이 가능한지 확인하는 작업 # terraform plan 1.3 terraform Project 리소스 적용 - 작성한 코.. 2021. 8. 2.
Terraform 정의 Terraform Hashicorp에서 오픈소스로 개발중인 Infrastructure as Code(IaC) 관리 도구 입니다. AWS,GCP,Azure Cloud 서비스에 대해 인프라 자동화 툴 중 하나이며, 이는 단순 구문을 사용하여 여러 클라우드 및 온프레미스 데이터센터에서 인프라를 프로비져닝하고 구성 변경에 대한 대응으로 인프라를 안전하고 효율적으로 다시 프로비져닝 할 수 있습니다. Terraform 기본 명령어 및 프로세스 Terraform 기본 문법 - Document : https://registry.terraform.io/providers/hashicorp/aws/latest/docs - provider : 테라폼과 외부 서비스(AWS,GCP,Azure) 연결해주는 기능을 하는 모듈 > P.. 2021. 7. 28.
728x90