2
votes

I am trying to create an EC2 instance from an image that I have in an S3 bucket. I have followed one of the AWS documents and I still get this error. The error I am getting is as follows:

"An error occurred (InvalidParameter) when calling the ImportSnapshot operation: The given S3 object is not local to the region"

This happens when I run the following command: "aws ec2 import-snapshot --description "My VMDK" --disk-container file://containers.json"

According to the AWS document this should work. I have double checked both locations and they are the same. I also tried setting up a new bucket in the same location and importing from there but just got the same issue.

Any help is greatly appreciated.

1
Have you tried specifying the region in the command? --region us-west-2. If that works then it means that aws cli is configured with the wrong default region (at least in this context). - Mathew Tinsley
Where are you running the AWS CLI? How is the credentials passed to the CLI? - helloV
I have tried adding in the region but it still isn't working. It is now telling me that the S3 key does not exist. Am I right in saying that this is the key associated with users? - arbo
In regards to where I am running the CLI it is on the terminal in MacOS, and the credentials were passed in during an initial configuration (aws configure) of the AWS CLI - arbo

1 Answers

1
votes

Check your s3 bucket. The instructions are not very clear. A VMware file should already be stored in the bucket. The command is used after the s3 bucket is loaded with the file. Try - aws s3 cp file.ova s3://s3-bucket/ or aws s3 cp file.vmdk s3://s3-bucket/