CLOUD/IaC

[Terraform/AWS] RDS 생성하기

alsruds 2023. 3. 30. 17:45

기본 설정

2023.03.30 - [분류 전체보기] - [Terraform] 시작하기

 

[Terraform] 시작하기

♡ 미리보기 ♡ 1. 테라폼 홈페이지에서 다운로드 2. 경로 설정 3. aws configure : key 등록 4. vs code 에서 hasicope terraform 다운로드 ● 윈도우 환경에 설치 https://www.terraform.io/downloads ● cmd 창에서 편리하

alsrudalsrudalsrud.tistory.com

 

VS code

# main.tf
provider "aws" {
  region = "ap-northeast-2"
}

resource "aws_db_instance" "terraform_db" {
  allocated_storage = 20
  identifier = "mydb"
  db_name = "DB01"
  engine = "mysql"
  engine_version = "8.0.32"
  instance_class = "db.t3.micro"
  username = "admin"
  password = "qwer1234"
  parameter_group_name = "default.mysql8.0"
  publicly_accessible = true
  skip_final_snapshot = true
}

 

● 실행

terraform init
terraform apply

 

확인

생성 짜잔~

 

 삭제

terraform destroy