Create RDS using Terraform
Create simple database in AWS and using Terraform
To create an Amazon RDS database using Terraform, you will need to follow these steps:
Install and configure Terraform on your local machine.
Create a Terraform configuration file for your RDS instance. This will include specifying the AWS provider, providing your access credentials, and creating an “aws_rds_instance” resource to configure the RDS instance.
Configure RDS instance settings such as database type, storage size, security settings, and more.
Run the “terraform init” command to initialize the Terraform working directory.
Run the “terraform apply” command to create an RDS instance.
Here’s a basic example of what your Terraform configuration file might look like:
provider "aws" {
region = "us-east-1"
}
resource "aws_rds_instance" "example" {
engine = "mysql"
instance_class = "db.t2.micro"
name = "example"
username = "root"
password = "password"
storage_type = "gp2"
storage_size = 20
}
Ok Guys, that’s it for today.