This simple update illustrates the process; however, you can make much more complex changes to the files and packages that are deployed to your Amazon EC2 instances.
For example, you might decide that you need to add My SQL to the instance, along with PHP support for My SQL.
Any package that supports versioning can have specific versions.
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.
When your stack is in the UPDATE_COMPLETE state, you can click the Website URL output value again to verify that the changes to your application have taken effect.
By default, the cfn-hup daemon runs every 15 minutes, so it may take up to 15 minutes for the application to change once the stack has been updated.
You can optionally specify a version string for a package.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.With AWS Cloud Formation, you can update the properties for resources in your existing stacks.These changes can range from simple configuration changes, such as updating the alarm threshold on a Cloud Watch alarm, to more complex changes, such as updating the Amazon Machine Image (AMI) running on an Amazon EC2 instance.For more information, see Updating Auto Scaling Groups.For the purposes of this example, we’ll use the AWS Management Console to create an initial stack from the sample template.If you change the version string in subsequent update stack calls, the new version of the package will be deployed.Here's an example of using version numbers for Ruby Gems packages.The template enables and configures the cfn-hup daemon to listen for changes to the configuration defined in the metadata for the Amazon EC2 instance.By using the cfn-hup daemon, you can update application software, such as the version of Apache or PHP, or you can update the PHP application file itself from AWS Cloud Formation.