how to copy AMI from one aws account to other aws account?

末鹿安然 提交于 2019-12-11 07:39:16

问题


Am trying to copy the custom built ami using packer from one AWS account to another AWS account; however, i was able to copy ami across regions within one account.

"builders": [{ "account_id": "12345678910", "s3_bucket": "xyz/xqas/asd", "x509_cert_path": "/Users/txyz/packer/certificate.pem", "x509_key_path": "/Users/txyz/packer/private-key.pem", "type": "amazon-instance", "access_key": "{{useraccess_key}}", "secret_key": "{{usersecret_key}}", "region": "us-east-1", "source_ami": "ami-452bd728", "instance_type": "r3.xlarge", "ssh_username": "ubuntu", "ami_name": "packer-test-hvm {{timestamp}}", "ami_virtualization_type": "hvm", "force_deregister": true, "ami_regions": ["us-east-1", "us-west-2"] }],


回答1:


Use AWS ClI and run the following command in the AMI that needs to be transferred

ec2-modify-image-attribute ami-2bb65342 -l -a 111122223333 

For other options that are available please refer this guide

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharingamis-explicit.html



来源:https://stackoverflow.com/questions/37734683/how-to-copy-ami-from-one-aws-account-to-other-aws-account

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!