Wpis z mikrobloga

resource "aws_db_instance" "bazadanych" {
instance_class = "db.t2.micro"
identifier = "bazadancyh"
username = "postgres"
password = "dupa.8"
db_subnet_group_name = "db-subnet"
snapshot_identifier = "moj snapszot"
vpc_security_group_ids = ["sg-77777"]
skip_final_snapshot = true
}
@dedronek: jak masz dużą bazę, to polecam AWS Aurora - dzięki czemu postawienie nowej bazy to kwestia minut a nie godzin.

Ale zasada jest jedna, tworzysz nową bazę danych z snapshota, i podmieniasz starą bazę z nową, i starą usuwasz.
@dedronek: lub bez terrafroma dwoma poleceniami:

Kasowanie starej:

aws rds delete-db-instance \
--db-instance-identifier BAZA1 \
--skip-final-snapshot > /dev/null

Przywracanie ze snapa:

aws rds restore-db-instance-from-db-snapshot \
--db-instance-identifier BAZA1 \
--db-snapshot-identifier=snapshot_id \
--db-instance-class db.t2.micro \
--storage-type standard gp2 \
--vpc-security-group-ids security_group \
--db-subnet-group-name subnet_group