Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transfer files from s3 bucket to amazon RDS database

I am trying to load data from the s3 bucket to amazon RDS database. I know this is not the programming question. But I really appreciate help. I have used the code below:

aws rds restore-db-instance-from-s3 ^
--allocated-storage 250 ^ 
--db-instance-identifier myidentifier ^
--db-instance-class db.m4.large ^
--engine mysql ^
--master-user-name masterawsuser ^
--master-user-password masteruserpassword ^
--s3-bucket-name mybucket ^
--s3-ingestion-role-arn arn:aws:iam::account-number:role/rolename ^
--s3-prefix bucketprefix ^
--source-engine mysql ^
--source-engine-version 5.6.27

But I am getting the below error, though I have given correct ARN number:

“An error occurred (InvalidParameterValue) when calling the   RestoreDBInstanceFrom S3 operation: IAM role ARN value is invalid or does not include the   required permissions for: S3_SNAPSHOT_INGESTION”

Any comments on this?

Thanks

like image 207
user15051990 Avatar asked Dec 07 '17 19:12

user15051990


People also ask

How do I transfer data from AWS to RDS?

When importing data into a MariaDB DB instance, you can use MariaDB tools such as mysqldump, mysql, and standard replication to import data to Amazon RDS. Importing Data into PostgreSQL on Amazon RDS – You can use PostgreSQL tools such as pg_dump, psql, and the copy command to import data to Amazon RDS.

What is the difference between RDS and S3?

While S3 is strongly consistent, its consistency is limited to single storage operations. On the other hand, RDS supports transactions that allow one to execute a series of operations while maintaining consistency and even providing an option to roll back the operations in case of the steps go wrong.


1 Answers

I'm late to the game, but this is the #1 hit on Google and I spent about an hour figuring this problem out.

That error message is a bit misleading. It has nothing to do with the role or policies that you have attached to RDS. In my case, the account I was logged in as did not use a role with the proper permissions. In AWS IAM, I added the policies AmazonS3FullAccess and AmazonRDSFullAccess to my user account (well, actually added them to my assumed role because I'm using a Federated Corporate Access).

Once I did that, the error message disappeared and I was able to restore from S3

like image 104
Shane Wilhelm Avatar answered Oct 11 '22 15:10

Shane Wilhelm