Skip to content

RDS Terrafrom

Terraform
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.16"
    }
  }

  required_version = ">= 1.2.0"
}

provider "aws" {
  profile = "default"
  region = "us-east-2"
}


resource "aws_db_instance" "rds_instance" {
allocated_storage = 20
identifier = "rds-terraform"
storage_type = "gp2"
engine = "mysql"
engine_version = "8.0.27"
instance_class = "db.t2.micro"
db_name = "db_name"
username = "db_username"
password = "db_password"
publicly_accessible    = false
skip_final_snapshot    = true


  tags = {
    Name = "ExampleRDSServerInstance"
  }
}
Back to top