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

copy_snapshot does not copy snapshot from region A to region B #3827

Closed
th3b3ginn3r opened this issue Aug 16, 2023 · 1 comment
Closed

copy_snapshot does not copy snapshot from region A to region B #3827

th3b3ginn3r opened this issue Aug 16, 2023 · 1 comment
Assignees
Labels
documentation This is a problem with documentation. ec2 p3 This is a minor priority issue response-requested Waiting on additional information or feedback.

Comments

@th3b3ginn3r
Copy link

Describe the issue

The example section of the Boto3 document shows that it is possible to copy a snapshot from one region to another using the copy_snapshot API.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2/client/copy_snapshot.html

However, when I try to copy a snapshot from the region ap-northeast-1 to us-west-2, it still copies the snapshot in the source region.

Request

session = boto3.Session(profile_name="xxxxxx")
client = session.client("ec2", region_name="ap-northeast-1")
response = client.copy_snapshot(
    Description="This is my copied snapshot.",
    DestinationRegion="us-west-2",
    SourceRegion="ap-northeast-1",
    SourceSnapshotId="snap-025fedd32e88507f3",
)

Response

{'SnapshotId': 'snap-02b6c46a14a7b4eda', 'ResponseMetadata': {'RequestId': 'cc0490e8-3692-4905-9935-36a1bd725eb6', 'HTTPStatusCode': 200, 'HTTPHeaders':.......}

Links

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2/client/copy_snapshot.html

@th3b3ginn3r th3b3ginn3r added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Aug 16, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Aug 16, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK added ec2 p2 This is a standard priority issue investigating This issue is being investigated and/or work is in progress to resolve the issue. bug This issue is a confirmed bug. and removed needs-triage This issue or PR still needs to be triaged. documentation This is a problem with documentation. labels Aug 16, 2023
@RyanFitzSimmonsAK
Copy link
Contributor

Hi @th3b3ginn3r, thanks for reaching out. There is actually a section in the docs that addresses this behavior.

The destination Region to use in the PresignedUrl parameter of a snapshot copy operation. This parameter is only valid for specifying the destination Region in a PresignedUrl parameter, where it is required.

The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example, ec2.us-east-1.amazonaws.com). With the CLI, this is specified using the --region parameter or the default Region in your Amazon Web Services configuration file.

So, in order to make this copy work, you need to run your script from the DestinationRegion, us-west-2 in the example you provided.

Hope that helps, please let me know if you have any follow-up questions.

@RyanFitzSimmonsAK RyanFitzSimmonsAK added response-requested Waiting on additional information or feedback. p3 This is a minor priority issue and removed bug This issue is a confirmed bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 This is a standard priority issue labels Aug 17, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK added the documentation This is a problem with documentation. label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. ec2 p3 This is a minor priority issue response-requested Waiting on additional information or feedback.
Projects
None yet
Development

No branches or pull requests

2 participants