0
0
AWScloud~10 mins

RDS backup and snapshots in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable automated backups for an RDS instance.

AWS
resource "aws_db_instance" "example" {
  allocated_storage    = 20
  engine               = "mysql"
  instance_class       = "db.t3.micro"
  name                 = "mydb"
  username             = "admin"
  password             = "password"
  backup_retention_period = [1]
}
Drag options to blanks, or click blank then click option'
A7
B14
C0
D30
Attempts:
3 left
💡 Hint
Common Mistakes
Setting backup_retention_period to 0 disables automated backups.
Using a negative number causes errors.
2fill in blank
medium

Complete the code to create a manual snapshot of an RDS instance.

AWS
resource "aws_db_snapshot" "manual_snapshot" {
  db_instance_identifier = "mydb-instance"
  db_snapshot_identifier = [1]
}
Drag options to blanks, or click blank then click option'
Asnapshot001
Bmydb-snapshot
C"snapshot-001"
D"mydb-snapshot-001"
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes causes syntax errors.
Using an identifier that is not unique.
3fill in blank
hard

Fix the error in the code to enable point-in-time recovery for an RDS instance.

AWS
resource "aws_db_instance" "example" {
  allocated_storage       = 20
  engine                  = "postgres"
  instance_class          = "db.t3.micro"
  name                    = "mydb"
  username                = "admin"
  password                = "password"
  backup_retention_period = 7
  [1] = true
}
Drag options to blanks, or click blank then click option'
Apoint_in_time_recovery_enabled
Benable_point_in_time_recovery
Cenable_pitr
Denable_backup
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect attribute names causes deployment errors.
Confusing backup enabling with point-in-time recovery.
4fill in blank
hard

Fill both blanks to configure a lifecycle policy that deletes automated backups after 14 days and enables backup window at 03:00.

AWS
resource "aws_db_instance" "example" {
  allocated_storage       = 20
  engine                  = "mysql"
  instance_class          = "db.t3.micro"
  name                    = "mydb"
  username                = "admin"
  password                = "password"
  backup_retention_period = [1]
  preferred_backup_window = [2]
}
Drag options to blanks, or click blank then click option'
A14
B"01:00-02:00"
C"03:00-04:00"
D7
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong time format for backup window.
Setting retention period to zero disables backups.
5fill in blank
hard

Fill all three blanks to create a snapshot resource with identifier 'prod-snapshot-01', linked to instance 'prod-db', and with a tag 'Environment' set to 'Production'.

AWS
resource "aws_db_snapshot" "prod_snapshot" {
  db_instance_identifier = [1]
  db_snapshot_identifier = [2]
  tags = {
    Environment = [3]
  }
}
Drag options to blanks, or click blank then click option'
A"prod-db"
B"prod-snapshot-01"
C"Production"
D"prod_snapshot"
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around string values.
Mixing up instance and snapshot identifiers.