How to troubleshoot AWS CloudFormation

Alvaro Andres Pinzon Cortes
2 min readJul 13, 2019

--

EC2 instances

  1. I am having problems with the load balancer or with the EC2 instance. I don’t know how to verify that the commands in the UserData executed correctly and if the problems are in the EC2 instances.

There are 2 ways to troubleshoot the servers and the UserData:

  1. Test the UserData first by creating a EC2 instances with the same specifications in the LaunchConfiguration. Launch the instance in the EC2 dashboard, NOT in CloudFormation.
  2. Configure your UserData in your CloudFormation script so that you can see the logs of the invocation of the UserData in the System Log.

To troubleshoot issues on your EC2 instance bootstrap without having to access the instance through SSH, you can add code to your user-data bash script that redirects all the output both to the /var/log/user-data.log and to /dev/console. When the code is executed, you can see your user-data invocation logs in your console.

Please look at these tutorials:

--

--

No responses yet