Cloud Formation — Helper Scripts

usually : cfn-init → cfn-signal → cfn-hup
cfn init will go ahead and configure the instance
cfn-signal will let CF template that configuration has been completed

Configured by specifying “config” in metadata section
And triggered at the “user data” section
multiple configs → configsets

** Tips on “commands”
- commands need “test” to run (inside nested scope)
- depending on test pass or fail → determines if they will run command or not
- USE linux test command
- ex. test ! -e /home/petclinic → Petclinic files does not exists
- ex. test 10 = 10 → is 10 equal 10 ?
- → type in >> echo $? >> to get the boolean value (to get the result, or nothing will pop up )
- concatenated : test 10 = 10; echo $?

after cfn-init finishes it’s job → notifies the cloudformation template
Used with creation Policy

Means it will wait for 5 minutes for the health check !

: looks for metadata change every 15 minutes
need to configure via files1. /etc/cfn/cfn-hup.conf 2. /etc/cfn/hooks.d/cfn-auto-reloader.conf



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store