We now have all of the information that we need to start designing our application. We need to coordinate four different API calls per CloudFormation stack, as follows:
- describeStacks: To list all available stacks
- describeStackResources: To retrieve the details of all resources contained in a stack
- describeInstances: To retrieve the details of all EC2 instances in a stack
- describeDBInstances: To retrieve the details of all DB2 instances in a stack
Next, I would like you to step back for a moment and think about how you would design code like this. Go ahead; I'll wait.
Now that you're back, let's take a look at one possible approach.
If you recall the screenshot of what the dashboard will look like, you will realize that, for the purposes of our application, the differences between EC2 and RDS resources can be completely ignored as long as...