SHARE
TWEET

Untitled

a guest Aug 19th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. provider "aws" {
  2.   region = "eu-west-1"
  3. }
  4.  
  5. # Get latest snapshot from production DB
  6. data "aws_db_snapshot" "backup" {
  7.   most_recent             = true
  8.   db_instance_identifier  = "db-prd"
  9. }
  10.  
  11. # Create new staging DB
  12. resource "aws_db_instance" "db_stg" {
  13.   instance_class          = "db.t2.micro"
  14.   identifier              = "db-stg"
  15.   username                = "XXXXX"
  16.   password                = "XXXXX"
  17.   db_subnet_group_name    = "XXXXX"
  18.   vpc_security_group_ids  = ["XXXXX"]
  19.   snapshot_identifier     = "${data.aws_db_snapshot.backup.id}"
  20.   skip_final_snapshot     = true
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top