amazon-ami

Is it possible to get or generate event for AMI availability (without polling)?

ぃ、小莉子 提交于 2021-01-29 11:17:07
问题 I'm doing large number of AMI copying to different regions, and calling describe image from image waiter at the end of copying to make sure successful copying, the large number of describe image calls are being heavily rate limited. I know there are EC2 instance state change events, I wonder if it is possible to generate AMI available/ready event, if yes I can use the event to trigger a message to my SQS, from which I can get notification and avoid making the describe image calls. My search

Way to run aws cli across multiple accounts

时光怂恿深爱的人放手 提交于 2021-01-28 07:13:35
问题 I am trying to find out all EC2 instances in 10 different accounts which are running non-amazon AMI images. Following CLI command gives me the list of all AMI's: aws ec2 describe-instances --output text --query 'Reservations[*].Instances[*].[ImageId]' | sort | uniq -c I think I can modify this further to get all non-amazon AMI's but is there a way to run this across 10 different accounts in one call? 回答1: is there a way to run this across 10 different accounts in one call? No, that's not

CloudFormation - always use latest AMI

試著忘記壹切 提交于 2020-03-18 12:06:51
问题 The blog post Query for the latest Amazon Linux AMI IDs using AWS Systems Manager Parameter Store | AWS Compute Blog describes how to always reference the latest version of an distribution in a CloudFormation template. # Use public Systems Manager Parameter Parameters: LatestAmiId: Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>' Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2' Resources: Instance: Type: 'AWS::EC2::Instance' Properties: ImageId: !Ref LatestAmiId

How Can I get details of an AMI or Snapshot if It is encrypted and with which key AWS Managed CMK or Customer Manager CMK in AWS

你说的曾经没有我的故事 提交于 2020-01-26 04:42:27
问题 Issue : ➜ I want to get information about my AMI to know if it is Encrypted or not and If yes, then with which key it is encrypted with (AWS Managed CMK or Customer Manager CMK) so that I can utilize this information while sharing my AMI with another account without any issues. 回答1: Solution :➜ ****We can get this information using AWS Console as well as AWS CLI which could be useful while troubleshooting Encrypted AMI/Snapshots and KMS co-relation**** How can I check using AWS CLI Commands:

How to speed up creation of AMI (Amazon Machine Image)?

那年仲夏 提交于 2020-01-23 04:26:07
问题 AMI creation takes a long time. Are there ways to make it happen faster? E.g. perhaps by changing some of the AMI creation settings, perhaps regarding IOPS, volume type, device, etc. I don't know how to change these or if it could help. So I am not sure of any ways speed up the AMI creation process at this stage. 回答1: An AMI uses the same 'backup' mechanism as a snapshot . Any blocks that are modified from the original AMI/snapshot need to be copied to Amazon S3. So, in theory, if you

How to Query Images AMI's from AWS Console based on their status : Available using Python boto3?

霸气de小男生 提交于 2020-01-14 05:44:08
问题 I need to get the Details of Images AMI's from AWS Console based on their State: Available. When I tried it is getting stuck and not printing any line. Python code 1: conn = boto3.resource('ec2') image = conn.describe_images() print(image) # prints nothing for img in image: image_count.append(img) print("img count ->" + str(len(image_count))) #prints nothing Is there any exact keywords for this Image AMI's Please correct me 回答1: An important thing to realize about AMIs is that every AMI is

How to make EC2 user-data work on freshly built AMI, made with Packer

对着背影说爱祢 提交于 2020-01-13 01:54:06
问题 I can build AMI images just fine. But they've stopped working with EC2 User Data: There is user data: $ cat /tmp/user_data.sh #!/bin/bash touch /tmp/i_have_user_data /root/i_have_user_data And I can launch a plain Ubuntu image: aws ec2 run-instances --instance-type m3.medium --image-id ami-eed10e86 --user-data file:///tmp/user_data.sh And it works: ubuntu@ip-10-165-90-180:~$ ls /tmp/i_have_user_data /tmp/i_have_user_data But if I build an AMI based on that one, with Packer: "builders": [ {