Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- provider "aws" {
- region = "eu-west-1"
- }
- # Get latest snapshot from production DB
- data "aws_db_snapshot" "backup" {
- most_recent = true
- db_instance_identifier = "db-prd"
- }
- # Create new staging DB
- resource "aws_db_instance" "db_stg" {
- instance_class = "db.t2.micro"
- identifier = "db-stg"
- username = "XXXXX"
- password = "XXXXX"
- db_subnet_group_name = "XXXXX"
- vpc_security_group_ids = ["XXXXX"]
- snapshot_identifier = "${data.aws_db_snapshot.backup.id}"
- skip_final_snapshot = true
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement