Do any of you have a way to get the latest CentOS image when building packer images?
I’m trying to do this with CentOS images, this is what I get:
aws ec2 describe-images — owners aws-marketplace — filters “Name=name,Values=*b7ee8a69-ee97–4a49–9e68-afaee216db2e*” | jq -r ‘.Images[] | “\(.OwnerId)\t\(.Name)”’
679593333241 CentOS Linux 7 x86_64 HVM EBS 1708_11.01-b7ee8a69-ee97–4a49–9e68-afaee216db2e-ami-95096eef.4
679593333241 CentOS Linux 7 x86_64 HVM EBS ENA 1901_01-b7ee8a69-ee97–4a49–9e68-afaee216db2e-ami-05713873c6794f575.4
679593333241 CentOS Linux 7 x86_64 HVM EBS 1801_01-b7ee8a69-ee97–4a49–9e68-afaee216db2e-ami-0a537770.4
679593333241 CentOS Linux 7 x86_64 HVM EBS ENA 1805_01-b7ee8a69-ee97–4a49–9e68-afaee216db2e-ami-77ec9308.4
679593333241 CentOS Linux 7 x86_64 HVM EBS ENA 1803_01-b7ee8a69-ee97–4a49–9e68-afaee216db2e-ami-8274d6ff.4
679593333241 CentOS Linux 7 x86_64 HVM EBS ENA 1804_2-b7ee8a69-ee97–4a49–9e68-afaee216db2e-ami-55a2322a.4
Relevant parts of the Packer file:
"variables": {
"aws_profile": "personal",
"aws_region": "us-east-1"
},
"builders": [
{
"type": "amazon-ebs",
"name": "CentOS",
"ssh_username": "ec2-user",
"instance_type": "t3.micro",
"region": "{{user `aws_region`}}",
"profile": "{{user `aws_profile`}}",
"ami_name": "centos",
"ami_description": "CentOS image",
"force_deregister": "true",
"force_delete_snapshot": "true",
"encrypt_boot": true,
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "CentOS Linux 7 x86_64 HVM EBS ENA*",
"root-device-type": "ebs"
},
"owners": [
"679593333241"
],
"most_recent": true
}
}
]
As well as the CentOS image owner 679593333241
And when I run packer build I get:
Error launching source instance: OptInRequired: In order to use this AWS Marketplace product you need to accept terms and subscribe. To do so please visit https://aws.amazon.com/marketplace/pp?sku=67xglex2rdpaymxh17620nfoy
That link takes me to the page of a vendor I don’t trust which is “Supported Images”, any clue on why I’m not getting to the CentOS image?