AmazonLinux

AmazonLinuxのイメージ一覧

  • AmazonLinux2
  • リージョンがap-northeast-1
  • アーキテクチャがx86_64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ aws ec2 describe-images --owners amazon --filters "Name=name,Values=amzn2-ami-hvm-*" "Name=architecture,Values=x86_64" --query 'reverse(sort_by(Images, &CreationDate))[].[Name,ImageId,Architecture]' --output table --region ap-northeast-1
-------------------------------------------------------------------------------------------------------------
| DescribeImages |
+-----------------------------------------------------------------------+------------------------+----------+
| amzn2-ami-hvm-2.0.20200406.0-x86_64-gp2 | ami-0f310fced6141e627 | x86_64 |
| amzn2-ami-hvm-2.0.20200406.0-x86_64-ebs | ami-06aa6ba9dc39dc071 | x86_64 |
| amzn2-ami-hvm-2.0.20200304.0-x86_64-gp2 | ami-052652af12b58691f | x86_64 |
| amzn2-ami-hvm-2.0.20200304.0-x86_64-ebs | ami-0c6f9336767cd9243 | x86_64 |
~略~
| amzn2-ami-hvm-2017.12.0.20180109-x86_64-gp2 | ami-6be57d0d | x86_64 |
| amzn2-ami-hvm-2017.12.0.20180109-x86_64-ebs | ami-39e37b5f | x86_64 |
| amzn2-ami-hvm-2017.12.0.20171212.2-x86_64-gp2 | ami-2a34b64c | x86_64 |
| amzn2-ami-hvm-2017.12.0.20171212.2-x86_64-ebs | ami-1d37b57b | x86_64 |
+-----------------------------------------------------------------------+------------------------+----------+

AmazonLinuxの最新イメージを取得する

  • バージョン: 2
  • リージョンが: ap-northeast-1
  • アーキテクチャ: x86_64
  • ボリューム: gp2

ボリュームタイプでイメージが異なるので、以下はgp2(現行の汎用SSD)のボリュームで検索している。

1
2
3
4
5
6
7
8
$ aws ec2 describe-images --owners amazon --filters "Name=name,Values=amzn2-ami-hvm-*-gp2" "Name=architecture,Values=x86_64" --query 'reverse(sort_by(Images, &CreationDate))[1].[Name,ImageId,Architecture]' --output table --region ap-northeast-1
---------------------------------------------
| DescribeImages |
+-------------------------------------------+
| amzn2-ami-hvm-2.0.20200406.0-x86_64-ebs |
| ami-06aa6ba9dc39dc071 |
| x86_64 |
+-------------------------------------------+

AmazonLinuxのボリュームタイプ

amzn2-ami-hvm-*-x86_64-ebsはVolumeType: standardで旧世代のボリュームタイプを使用している。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
$ aws ec2 describe-images --owners amazon --filters "Name=name,Values=amzn2-ami-hvm-*-gp2" "Name=architecture,Values=x86_64" --query 'reverse(sort_by(Images, &CreationDate))[0]' --region ap-northeast-1
{
"Architecture": "x86_64",
"CreationDate": "2020-04-07T17:30:34.000Z",
"ImageId": "ami-0f310fced6141e627",
"ImageLocation": "amazon/amzn2-ami-hvm-2.0.20200406.0-x86_64-gp2",
"ImageType": "machine",
"Public": true,
"OwnerId": "137112412989",
"PlatformDetails": "Linux/UNIX",
"UsageOperation": "RunInstances",
"State": "available",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/xvda",
"Ebs": {
"DeleteOnTermination": true,
"SnapshotId": "snap-06688593da98411ef",
"VolumeSize": 8,
"VolumeType": "gp2",
"Encrypted": false
}
}
],
"Description": "Amazon Linux 2 AMI 2.0.20200406.0 x86_64 HVM gp2",
"EnaSupport": true,
"Hypervisor": "xen",
"ImageOwnerAlias": "amazon",
"Name": "amzn2-ami-hvm-2.0.20200406.0-x86_64-gp2",
"RootDeviceName": "/dev/xvda",
"RootDeviceType": "ebs",
"SriovNetSupport": "simple",
"VirtualizationType": "hvm"
}
$ aws ec2 describe-images --owners amazon --filters "Name=name,Values=amzn2-ami-hvm-*-ebs" "Name=architecture,Values=x86_64" --query 'reverse(sort_by(Images, &CreationDate))[0]' --region ap-northeast-1
{
"Architecture": "x86_64",
"CreationDate": "2020-04-07T17:14:50.000Z",
"ImageId": "ami-06aa6ba9dc39dc071",
"ImageLocation": "amazon/amzn2-ami-hvm-2.0.20200406.0-x86_64-ebs",
"ImageType": "machine",
"Public": true,
"OwnerId": "137112412989",
"PlatformDetails": "Linux/UNIX",
"UsageOperation": "RunInstances",
"State": "available",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/xvda",
"Ebs": {
"DeleteOnTermination": true,
"SnapshotId": "snap-06688593da98411ef",
"VolumeSize": 8,
"VolumeType": "standard",
"Encrypted": false
}
}
],
"Description": "Amazon Linux 2 AMI 2.0.20200406.0 x86_64 HVM ebs",
"EnaSupport": true,
"Hypervisor": "xen",
"ImageOwnerAlias": "amazon",
"Name": "amzn2-ami-hvm-2.0.20200406.0-x86_64-ebs",
"RootDeviceName": "/dev/xvda",
"RootDeviceType": "ebs",
"SriovNetSupport": "simple",
"VirtualizationType": "hvm"
}

UbuntuLinux

AMIでUbuntuLinuxの指定バージョンの最新イメージ

UbuntuLinuxの公式は099720109477なのでこれを基本に絞り込んでいく。

  • バージョン: 18.04
  • リージョンがap-northeast-1
  • アーキテクチャ: x86_64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$aws ec2 describe-images --owners 099720109477 --filters "Name=name,Values=*18.04*" "Name=architecture,Values=x86_64" --query 'reverse(sort_by(Images, &CreationDate))[].[Name,ImageId,Architecture]' --output table --region ap-northeast-1
---------------------------------------------------------------------------------------------------------------------------------
| DescribeImages |
+-------------------------------------------------------------------------------------------+------------------------+----------+
| ubuntu-minimal/images/hvm-ssd/ubuntu-bionic-18.04-amd64-minimal-20200430 | ami-0084e4332fdb227c6 | x86_64 |
| ubuntu/images/hvm-instance/ubuntu-bionic-18.04-amd64-server-20200408 | ami-0a8f568a6a14353b6 | x86_64 |
| ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200408 | ami-0278fe6949f6b1a06 | x86_64 |
| ubuntu-eks/k8s_1.15/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200406.1 | ami-0fd103c2168938a67 | x86_64 |
| ubuntu-minimal/images/hvm-ssd/ubuntu-bionic-18.04-amd64-minimal-20200406.1 | ami-0c1bb33d8c0bd2145 | x86_64 |
~略~
| ubuntu/images/hvm-instance/ubuntu-bionic-18.04-amd64-server-20180426.2 | ami-19d33266 | x86_64 |
| ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20180426.2 | ami-82c928fd | x86_64 |
| ubuntu-minimal/images-testing/hvm-ssd/ubuntu-bionic-18.04-daily-amd64-minimal-20180328.1 | ami-ddcec5a1 | x86_64 |
| ubuntu-minimal/images-testing/hvm-ssd/ubuntu-bionic-18.04-daily-amd64-minimal-20180329 | ami-54747f28 | x86_64 |
+-------------------------------------------------------------------------------------------+------------------------+----------+

複合条件で以下を条件として、18.04の最新イメージの情報を取得する。

  • Ubuntu 18.04
  • リージョンがap-northeast-1
  • アーキテクチャがx86_64
  • ボリューム: gp2
1
2
3
4
5
6
7
8
$aws ec2 describe-images --owners 099720109477 --filters "Name=name,Values=ubuntu/images/hvm-ssd/*18.04*" "Name=architecture,Values=x86_64" --query 'reverse(sort_by(Images, &CreationDate))[0].[Name,ImageId,Architecture]' --output table --region ap-northeast-1
---------------------------------------------------------------------
| DescribeImages |
+-------------------------------------------------------------------+
| ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200408 |
| ami-0278fe6949f6b1a06 |
| x86_64 |
+-------------------------------------------------------------------+

UbuntuLinuxのボリュームタイプ

  • ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*: 現行SSDボリューム
  • ubuntu/images/hvm-instance/ubuntu-bionic-18.04-amd64-server-*: ボリュームマウントなし
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
$ aws ec2 describe-images --owners 099720109477 --filters "Name=name,Values=ubuntu/images/hvm-ssd/*18.04*" "Name=architecture,Values=x86_64" --query 'reverse(sort_by(Images, &CreationDate))[0]' --region ap-northeast-1
{
"Architecture": "x86_64",
"CreationDate": "2020-04-09T16:44:23.000Z",
"ImageId": "ami-0278fe6949f6b1a06",
"ImageLocation": "099720109477/ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200408",
"ImageType": "machine",
"Public": true,
"OwnerId": "099720109477",
"PlatformDetails": "Linux/UNIX",
"UsageOperation": "RunInstances",
"State": "available",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"DeleteOnTermination": true,
"SnapshotId": "snap-0cb75af02a9254c11",
"VolumeSize": 8,
"VolumeType": "gp2",
"Encrypted": false
}
},
{
"DeviceName": "/dev/sdb",
"VirtualName": "ephemeral0"
},
{
"DeviceName": "/dev/sdc",
"VirtualName": "ephemeral1"
}
],
"Description": "Canonical, Ubuntu, 18.04 LTS, amd64 bionic image build on 2020-04-08",
"EnaSupport": true,
"Hypervisor": "xen",
"Name": "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200408",
"RootDeviceName": "/dev/sda1",
"RootDeviceType": "ebs",
"SriovNetSupport": "simple",
"VirtualizationType": "hvm"
}
$ aws ec2 describe-images --owners 099720109477 --filters "Name=name,Values=ubuntu/images/hvm-instance/*18.04*" "Name=architecture,Values=x86_64" --query 'reverse(sort_by(Images, &CreationDate))[1]' --region ap-northeast-1
{
"Architecture": "x86_64",
"CreationDate": "2020-03-24T21:03:50.000Z",
"ImageId": "ami-0dc413a5565744b02",
"ImageLocation": "ubuntu-images-ap-northeast-1-release/bionic/20200323/hvm/instance-store/image.img.manifest.xml",
"ImageType": "machine",
"Public": true,
"OwnerId": "099720109477",
"PlatformDetails": "Linux/UNIX",
"UsageOperation": "RunInstances",
"State": "available",
"BlockDeviceMappings": [],
"Description": "Canonical, Ubuntu, 18.04 LTS, amd64 bionic image build on 2020-03-23",
"EnaSupport": true,
"Hypervisor": "xen",
"Name": "ubuntu/images/hvm-instance/ubuntu-bionic-18.04-amd64-server-20200323",
"RootDeviceType": "instance-store",
"SriovNetSupport": "simple",
"VirtualizationType": "hvm"
}