Hello,
For some reason, our packer build is not pulling the latest AWS image. We are using packer version 1.7.1, setting the “*” at the end of the image name, and specifying most_recent as true, as shown below. Despite this, we continue to get the Windows_Server-2016-English-Full-Base-2021.02.10 image rather than the Windows_Server-2016-English-Full-Base-2021.03.10. Both are showing as available in AWS console. Only by hard coding this newer image were we able to get the most recent one pulled.
Looking for any help on how we can get the latest image pulled automatically.
“builders”: [
{
“type”: “amazon-ebs”,
“iam_instance_profile”: “InfraGoldenAmi-windows2016-CodeBuildInstanceRole”,
“ena_support”: true,
“region”: “{{user aws_region
}}”,
“instance_type”: “t3.large”,
“launch_block_device_mappings”: [
{
“device_name”: “/dev/sda1”,
“volume_size”: 50,
“volume_type”: “gp3”,
“delete_on_termination”: true
}
],
“communicator”: “winrm”,
“winrm_username”: “administrator”,
“winrm_use_ssl”: true,
“winrm_insecure”: true,
“user_data_file”: “./scripts/cp_set-winrm.ps1”,
“vpc_id”: “{{user vpc_id
}}”,
“subnet_id”: “{{user vpc_subnet_id
}}”,
“security_group_id”: “{{user vpc_security_group_id
}}”,
“ami_name”: “{{user ami_name
| clean_resource_name}}”,
“source_ami”: “{{user source_ami_id
}}”,
“source_ami_filter”: {
“filters”: {
“name”: “Windows_Server-2016-English-Full-Base-*”,
“root-device-type”: “ebs”,
“virtualization-type”: “hvm”
},
“most_recent”: true,
“owners”: [“amazon”]
},