RDS generate_presigned_url does not support the DestinationRegion parameter
See original GitHub issueCopying encrypted RDS snapshots between different regions requires additional parameters in the PreSignedUrl. However, the boto3 implementation of generate_presigned_url for the RDS client does not support all of them, including DestinationRegion.
PreSignedUrl1=destination_client.generate_presigned_url('copy_db_snapshot', Params={'KmsKeyId':'mykeyid','SourceDBSnapshotIdentifier':'arn:aws:rds:us-west-2:<Account>:snapshot:rds:dbname-2017-01-12-11-40','TargetDBSnapshotIdentifier':'my-test','DestinationRegion':'us-east-1'}, ExpiresIn=1000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/botocore/signers.py", line 504, in generate_presigned_url
params, operation_model)
File "/usr/local/lib/python2.7/dist-packages/botocore/validate.py", line 270, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in input: "DestinationRegion", must be one of: SourceDBSnapshotIdentifier, TargetDBSnapshotIdentifier, KmsKeyId, Tags, CopyTags, PreSignedUrl, SourceRegion
This is the AWS CLI tools copy command:
aws --region us-east-1 rds copy-db-snapshot --source-db-snapshot-identifier 'arn:aws:rds:us-west-2:<Account>:snapshot:rds:dbname-2017-01-12-11-40' --target-db-snapshot-identifier 'my-test' --source-region us-west-2 --kms-key-id 'mykeyid'
Boto3 documentation includes this requirement as shown in [http://boto3.readthedocs.io/en/latest/reference/services/rds.html#RDS.Client.copy_db_snapshot].
Running:
Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2
boto3 (1.4.3) botocore (1.4.93)
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
Yeah I think that version of botocore will not have the parameter available. We released that feature about a month ago and that version: 1.4.81 is about two months old. So if you want to get it working in lambda, you will probably have to deploy with your function the latest version of botocore.
Hi,
This issue was related to DestinationRegion parameter but @mohankodali and @kmart1234 verified that SourceRegion works. DestinationRegion still does not work with generate_presigned_url method.
boto3 (1.4.7) botocore (1.7.10)
This is needed to set up read replicas in different regions. link
Thanks!