[root@ip-172-31-61-209 mysql]# ls main.tf outputs.tf README.md variables.tf [root@ip-172-31-61-209 mysql]# more main.tf terraform { required_version = ">= 1.0.0, < 2.0.0" required_providers { aws = { source = "hashicorp/aws" version = "~> 4.0" } } backend "s3" { # This backend configuration is filled in automatically at test time by Terratest. If you wish to run this example # manually, uncomment and fill in the config below. bucket = "masterseo-t101-tfstate" key = "stage/data-stores/mysql/terraform.tfstate" region = "us-east-2" dynamodb_table = "masterseo-t101-locks" # encrypt = true } } provider "aws" { region = "us-east-2" } resource "aws_db_instance" "example" { identifier_prefix = "terraform-up-and-running" engine = "mysql" allocated_storage = 10 instance_class = "db.t2.micro" db_name = var.db_name username = var.db_username password = var.db_password skip_final_snapshot = true } [root@ip-172-31-61-209 mysql]# more variables.tf # --------------------------------------------------------------------------------------------------------------------- # REQUIRED PARAMETERS # You must provide a value for each of these parameters. # --------------------------------------------------------------------------------------------------------------------- variable "db_username" { description = "The username for the database" type = string sensitive = true } variable "db_password" { description = "The password for the database" type = string sensitive = true } # --------------------------------------------------------------------------------------------------------------------- # OPTIONAL PARAMETERS # These parameters have reasonable defaults. # --------------------------------------------------------------------------------------------------------------------- variable "db_name" { description = "The name to use for the database" type = string default = "example_database_stage" } [root@ip-172-31-61-209 mysql]#