question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

generate_presigned_url for RDS expects different parameters then documented

See original GitHub issue

Describe the bug According to documentation under: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.copy_db_snapshot

Following method call should work:

    url = client_source.generate_presigned_url(
        ClientMethod="copy_db_snapshot",
        Params={
            "DestinationRegion": region,
            "KmsKeyId": key,
            "SourceDBSnapshotIdentifier": s,
            "TargetDBSnapshotIdentifier": t,
            "CopyTags": True
        },
        ExpiresIn=3600,
        HttpMethod=None
        )

But it triggers following error message:

  "errorMessage": "Parameter validation failed:\nUnknown parameter in input: \"DestinationRegion\", must be one of: SourceDBSnapshotIdentifier, TargetDBSnapshotIdentifier, KmsKeyId, Tags, CopyTags, PreSignedUrl, OptionGroupName, TargetCustomAvailabilityZone, SourceRegion",

Steps to reproduce Create AWS RDS DB snapshot that is encrypted and try to copy it over to another region within same AWS account.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
artur-fijalkowskicommented, Apr 27, 2021

@stobrien89 I confirm it works without it… Shame one can’t guess it’s not mandatory from this:

The URL that contains a Signature Version 4 signed request for the CopyDBSnapshot API action in the source AWS Region that contains the source DB snapshot to copy.

You must specify this parameter when you copy an encrypted DB snapshot from another AWS Region by using the Amazon RDS API. Don't specify PreSignedUrl when you are copying an encrypted DB snapshot in the same AWS Region.

The presigned URL must be a valid request for the CopyDBSnapshot API action that can be executed in the source AWS Region that contains the encrypted DB snapshot to be copied. The presigned URL request must contain the following parameter values:
0reactions
stobrien89commented, Apr 28, 2021

@artur-fijalkowski,

I agree the way the documentation is structured here isn’t ideal— the RDS team added this note in an attempt to clear up some confusion, although I think it may have been better to include this at the top of the description for the PreSignedUrl parameter:

If you are using an AWS SDK tool or the AWS CLI, you can specify SourceRegion (or --source-region for the AWS CLI) instead of specifying PreSignedUrl manually. Specifying SourceRegion autogenerates a pre-signed URL that is a valid request for the operation that can be executed in the source AWS Region.

Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sharing objects using presigned URLs - AWS Documentation
Describes how to set up your objects so that you can share them with others by creating a presigned URL to download the...
Read more >
AmazonS3Client (AWS Java SDK for Amazon S3 1.9.10 API)
Deletes multiple objects in a single bucket from S3. ... Pre-signs the specified request, using a signature query-string parameter.
Read more >
Import Postgres data into RDS using S3 and aws_s3
I have triple-checked the correctness of all the parameters. How do I make this work? UPDATE: I can confirm that I can do...
Read more >
Presigned URLs — Boto3 Docs 1.26.33 documentation - AWS
The generated URL is then given to the unauthorized user. ... The parameters to pass to the method are specified in the method_parameters...
Read more >
AWS Flashcards - Quizlet
What is RDS? ... No SQL databases are more flexible then relational databases ... By default data in Amazon S3 is stored redundantly...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found