記事:
EC2にAMIを指定する場合「resolve:ssm:<ami alias>」
aws ec2 run-instances \ --image-id "resolve:ssm:/aws/service/marketplace/prod-owmexvyxh5isg/9.7.20251118" \ --instance-type t4g.micro \ --subnet-id "subnet-123456" \ --key-name example \ --profile example
AMI aliasを探す場合
PROFILE=example AMI_PATH=/aws/service/marketplace/prod-owmexvyxh5isg aws ssm get-parameters-by-path \ --path $AMI_PATH \ --query 'reverse(sort_by(Parameters,&LastModifiedDate))[:5].Name' \ --profile $PROFILE [ "/aws/service/marketplace/prod-owmexvyxh5isg/latest", "/aws/service/marketplace/prod-owmexvyxh5isg/9.7.20251118", "/aws/service/marketplace/prod-owmexvyxh5isg/9.6.20251113", "/aws/service/marketplace/prod-owmexvyxh5isg/9.6.20250522", "/aws/service/marketplace/prod-owmexvyxh5isg/9.5.20241122" ]
cat /etc/image-id cat /etc/system-release cat /etc/os-release
記事:
Q: M6i インスタンスでサポートされているオペレーティングシステムや AMI はどれですか?
M6i インスタンスは、以下の AMI をサポートします。
Amazon Linux 2 以降
Ubuntu 16.04 以降
SUSE Linux Enterprise Server 12 以降
Red Hat Enterprise Linux (RHEL) 7 以降
CentOS 7 以降
Windows Server 2008 R2 以降
Debian 8 以降、FreeBSD 10-RELEASE 以降
他の Nitro インスタンスと同様に、M6i インスタンスで起動する EBS バックの HVM AMI にも、インスタンス起動時に NVMe 1.0e と ENA ドライバーのインストールが必要です。
記事:
デフォルトポリシーとして、役職毎の権限を選択できるようになった。
AMIを消しても、AMIが使っていたEBS snapshotは残るで、個別に消す必要がある。
放置するとかなりコストがかかる。
AWS_PROFILE=example AWS_REGION=ap-northeast-1 aws ec2 describe-images \ --owners amazon \ --filters "Name=name,Values=Windows_Server*2022*Japanese*" \ --query 'reverse(sort_by(Images, &CreationDate))[].[ImageId, CreationDate, Description]' \ --profile $AWS_PROFILE \ --region $AWS_REGION \ --output table | grep -v SQL
AWS_PROFILE=default AWS_REGION=ap-northeast-1 AMI_PRODUCT_CODE=cvugziknvmxgqna9noibqnnsy aws ec2 describe-images \ --owners aws-marketplace \ --filters Name=product-code,Values=$AMI_PRODUCT_CODE \ --query 'reverse(sort_by(Images, &CreationDate))[:2].[CreationDate, Description, ImageId]' \ --profile $AWS_PROFILE \ --region $AWS_REGION \ --output text 2020-10-09T15:54:06.000Z CentOS 7 with Updates HVM 20200923 ami-08c8b8667ebcacaa6