For a real-world application, the files may be stored on Amazon S3, Git Hub, or another repository and referenced from the template.
AWS Cloud Formation can download packages (such as RPMs or Ruby Gems), as well as reference individual files and expand files to create the application artifacts on the Amazon EC2 instance.
In the Properties section of the Amazon EC2 instance definition, the User Data property contains the Cloud Init script that calls cfn-init to install the packages and files.
The application itself is a very simple two-line "Hello, World" example that is entirely defined within the template.
If you are using Auto Scaling groups in your template, as opposed to Amazon EC2 instance resources, updating the application will work in exactly the same way; however, AWS Cloud Formation does not provide any synchronization or serialization across the Amazon EC2 instances in an Auto Scaling group.
It shows how the use of templates makes it possible to use a version control system for the configuration of your AWS infrastructure, just as you use version control for the software you are running.
We will walk through the following steps: We'll begin by creating a stack that we can use throughout the rest of this section.
In the previous examples, the version property for each package is empty, indicating that cfn-init should install the latest version of the package.
You can optionally specify a version string for a package.