Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rahulkrishnanfs/e0ee79a31d64beb31ab6967b6bceeee8 to your computer and use it in GitHub Desktop.
Save rahulkrishnanfs/e0ee79a31d64beb31ab6967b6bceeee8 to your computer and use it in GitHub Desktop.
AWS CLI : aws ec2 describe-images --filters Name=name,Values=ubuntu*
Output:
{
"Images": [
{
"EnaSupport": true,
"Architecture": "x86_64",
"VirtualizationType": "hvm",
"ImageType": "machine",
"OwnerId": "099720109477",
"ImageId": "ami-0000fa2aab9835382",
"Name": "ubuntu-minimal/images-testing/hvm-ssd/ubuntu-disco-daily-amd64-minimal-20181216",
"CreationDate": "2018-12-16T07:45:06.000Z",
"State": "available",
"Hypervisor": "xen",
"Public": true,
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"VolumeType": "gp2",
"DeleteOnTermination": true,
"SnapshotId": "snap-028e0d907e19233e9",
"VolumeSize": 8,
"Encrypted": false
}
},
{
"DeviceName": "/dev/sdb",
"VirtualName": "ephemeral0"
},
{
"DeviceName": "/dev/sdc",
"VirtualName": "ephemeral1"
}
],
"RootDeviceName": "/dev/sda1",
"Description": "Canonical, Ubuntu Minimal, 19.04, UNSUPPORTED daily amd64 disco image build on 2018-12-16",
"RootDeviceType": "ebs",
"ImageLocation": "099720109477/ubuntu-minimal/images-testing/hvm-ssd/ubuntu-disco-daily-amd64-minimal-20181216",
"SriovNetSupport": "simple"
},
{
},
{
}
]
Terrafrom Data Source "aws_ami:
provider "aws" {
access_key = "xxxxx"
secret_key = "xxxxx"
region = "us-east-2"
}
data "aws_ami" "ubuntu_ami" {
most_recent = true
owners = ["099720109477"]
filter {
name = "name"
values = ["ubuntu/*"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment