Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destination region breaks auto pre-signed URL in snapshot_copy #928

Closed
rambler opened this issue Sep 18, 2015 · 3 comments
Closed

Destination region breaks auto pre-signed URL in snapshot_copy #928

rambler opened this issue Sep 18, 2015 · 3 comments
Labels
feature-request A feature should be added or improved.

Comments

@rambler
Copy link

rambler commented Sep 18, 2015

When you copy a snapshot from one region to another using #copy_snapshot, the EC2CopyEncryptedSnapshot plugin is automatically applied (this is awesome when it works).

However,

A) It's not clear from the documentation for #copy_snapshot that this plugin will be invoked or how to use it (i.e. the client needs to be one for the destination region).

B) The plugin doesn't work if the destination_region option is supplied. In the two code snippets below, the first one fails but the second one succeeds.

Fails:

            copy_snap_id = @ec2_alt.copy_snapshot(
                {
                    source_region: @default_region,
                    source_snapshot_id: snap_id,
                    destination_region: @alt_region,
                    description: "Copy of #{@default_region} snapshot #{snap_id} of volume #{vol_id}",
                    encrypted: true,
                }
            ).snapshot_id

Succeeds:

            copy_snap_id = @ec2_alt.copy_snapshot(
                {
                    source_region: @default_region,
                    source_snapshot_id: snap_id,
                    description: "Copy of #{@default_region} snapshot #{snap_id} of volume #{vol_id}",
                    encrypted: true,
                }
            ).snapshot_id
@trevorrowe
Copy link
Member

As a status update, I've added some actual examples to the API reference documentation showing how to copy encrypted snapshots. I have not yet addressed removing the :destination_region from the documentation, or the behavior swap.

@trevorrowe
Copy link
Member

I just pushed a commit which fixes how the SDK was disabling pre-signing the copy-snapshot operation when the :destination_region was set. It looks like it was using that parameter keep from applying the copy_snapshot URL in a recursive loop (it calls #copy_snapshot to generate a presigned url).

I believe the last step to improve this is to remove the :destination_region and :presigned_url parameters from the API reference documentation.

@trevorrowe
Copy link
Member

The updated documentation should go out with our next release, likely tomorrow.

awood45 added a commit that referenced this issue Oct 15, 2015
@diehlaws diehlaws added feature-request A feature should be added or improved. and removed enhancement labels Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants