In this chapter, you learned how to build your custom ECS container instance machine image, using the popular open source tool called Packer. You learned how to create a Packer template, and learned about the various sections that make up a template including variables, builders, provisioners, and post-processors. You were able to inject temporary session credentials required to authenticate access to AWS as part of the image build process, using a combination of Packer variables, environment variables, and a dash of Make automation.
You successfully introduced a number of build-time customizations into your ECS container instance image, including installing CloudFormation helper scripts and the CloudWatch logs agent, and ensured the system was configured to run the NTP service on startup with the correct time zone. You disabled automatic security updates in the cloud-init configuration, which can cause problems if you are using an HTTP proxy.
Finally, you created a first-run script...