Best Practice for applying updates and kernel patches

I have Packer config that is building an AWS Linux 2 AMI and during the Provisioning i’m doing a yum update -y

is this the best way to ensure the AMI has had both Kernel and OS updates?

@kneemaa That sound about right. I would also add a reboot in between (expect_disconnect, etc.) in case the kernel version updates. This ensures it boots into the new kernel, and then I can remove all older kernels.