- Read this answer to my question. https://serverfault.com/a/977813/4131
- Create a Packer Template that defines a builder of type
amazon-ebs
- Based it on a
source_ami_filter
that selects themost_recent
image ofCentOS Linux 7*
- Add a
provisioner
that updates all the installed packages so that you have a Centos AMI that has the latest everything at startup - Add any other commands to the provisioner that is needed to fix the issue "sudo commands in cloud-init are SLOW"
- Based it on a
- Create a Terraform Config that defines 2 resources of type
aws_instance
- One should use your new AMI. One instance should use the original CentOS 7 AMI by
owner
aws-marketplace
- Include (the same in each)
user_data
that performs severalsudo -Hu centos <cmd>
and times them in a way you can retrieve for comparison - Use
terrafrom apply
to prove that the issue is present in the original AMI and fixed in yours
- One should use your new AMI. One instance should use the original CentOS 7 AMI by
- Create a gist with the Packer Template, Terraform Config, and a README.md that includes:
- Instructions on how to use it
- A transcript (Abridged) that exhibits the proof
- Use the AWS US-East-1 region (N. Virginia)
- This is a good general rule for sharing any kind of POC because not all features are available in all regions, AMIs are region specific, etc.
- The latest AMI at the time was [¿is?] CreationDate: 2019-01-30T23:40:58.000Z
- It is possible [¿expected?] that later AMIs will have a fix incorporated into them.
- If you can't recreate the issue, this may be the reason.
- If you can't recreate the issue, you may not be using "cloud-init" (AWS calls it "user data")
- In otherwords, this issue will not happen for an SSH'ed in user.