Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to export ec2 instance to S3

I am trying to export an EC2 instance (instance created with AMI which was imported earlier using VM import export service) to S3 bucket which is constantly failing . I also tried changing the bucket access to public still the error continues . I used both python SDK and CLI commands where both returns the same error

CLI used:

aws ec2 create-instance-export-task --instance-id i-***** --target-environment vmware --export-to-s3-task file://C:\file.json

json file containing bucket and VM image details

Error :An error occurred (AuthFailure) when calling the CreateInstanceExportTask operation: [email protected] must have WRITE and READ_ACL permission on the S3 bucket.

I'm not able to add [email protected] as a grantee .

Any help would be highly appreciated

like image 993
Nishad guru Avatar asked Sep 05 '25 03:09

Nishad guru


1 Answers

aws s3api put-bucket-acl --bucket bucket_name --grant-read id="alphanumeric-id-string"

aws s3api put-bucket-acl --bucket bucket_name --grant-write id="alphanumeric-id-string"

You can use the alphanumeric-id-string from this link https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html

Choose by your region: i.e for All other Regions

aws s3api put-bucket-acl --bucket bucket_name --grant-read id="c4d8eabf8db69dbe46bfe0e517100c554f01200b104d59cd408e777ba442a322"
like image 123
Kelvin Spencer Avatar answered Sep 09 '25 03:09

Kelvin Spencer