Debarshi DasGupta
Debarshi DasGupta

Reputation: 351

Cannot back up RDS instance

My intention is to export an RDS database and load its data into a local MS-SQL database. I am getting the errors when trying to back-up the RDS instance.

The SQL statement used to initiate the backup is:

USE [msdb]
GO
DECLARE   @return_value int
EXEC  @return_value = [dbo].[rds_backup_database]
      @source_db_name = 'abcd',
      @S3_arn_to_backup_to = 'arn:aws:s3:::abcd/test_09_May.bak',
      @KMS_master_key_arn = NULL,
      @overwrite_S3_backup_file = NULL
SELECT    'Return Value' = @return_value
GO

The query to check the task status is:

exec msdb.dbo.rds_task_status
EXEC msdb.dbo.rds_task_status 
    @db_name = 'abcd', -- sysname
    @task_id = 7 -- int
exec msdb.dbo.rds_task_status @task_id = 7
exec msdb.dbo.rds_task_status @db_name='abcd'

The failure reasons from the taskinfo column are:

1. Aborted the task because of a task failure or an overlap with your preferred backup window for RDS automated backup.
A WebException with status ConnectFailure was thrown.

2. Aborted the task because of a task failure or an overlap with your preferred backup window for RDS automated backup.
Access Denied

Upvotes: 5

Views: 11284

Answers (3)

Stifa
Stifa

Reputation: 1

Adding an S3 policy in my bucket solved the issue for me

{
    "Version": "2012-10-17",
    "Id": "123",
    "Statement": [
        {
            "Sid": "",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:*",
            "Resource": "arn:aws:s3:::mybucket/*"
        }
    ]
}

Upvotes: 0

hakuna
hakuna

Reputation: 6701

Both the issue are with respect to the S3 bucket:

For the first issue , the s3 bucket you are backing up is not in the same region as your RDS instance

For the second issue, the role that's being used in the Option group doesnt have permissions on the respective bucket. Go to Security Credentials -> Roles -> select the policy and then edit.

Upvotes: 12

Armand
Armand

Reputation: 61

I recommend you to use the DB export instead, RDS does not permit to export outside AWS environment.

Upvotes: 0

Related Questions