Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement