AWS Certified DevOps Engineer - Professional | Achieving Real-Time CloudFormation Stack Status Updates

Achieving Real-Time CloudFormation Stack Status Updates

Prev Question Next Question

Question

If I want CloudFormation stack status updates to show up in a continuous delivery system as close to real-time as possible, how should I achieve this?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - C.

You can monitor the progress of a stack update by viewing the stack's events.

The console's Events tab displays each major step in the creation and update of the stack sorted by the time of each event with the latest events on top.

The start of the stack update process is marked with an UPDATE_IN_PROGRESS event for the stack.

For more information on Monitoring your stack, please visit the below URL:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-monitor-stack.html

Note:

Use NotificationARNs.member and when making a CreateStack call to push stack events into SNS in nearly real-time.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-monitor-stack.html https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-basic-walkthrough.html

Sure, I'd be happy to explain the answer to this question in detail!

CloudFormation is an AWS service that helps you model and set up your Amazon Web Services resources so that you can spend less time managing those resources and more time focusing on your applications that run in AWS. When you create, update, or delete a stack, CloudFormation makes underlying AWS service calls to create, update, or delete the resources in the stack. These calls can take some time to complete, and CloudFormation provides stack status updates to help you track the progress of your stack.

In a continuous delivery system, it is important to have real-time visibility into the status of CloudFormation stacks so that you can monitor the progress of deployments and take corrective actions if necessary. Let's take a closer look at the answer options to see which one is the best solution for achieving this goal:

A. Use a long poll on the Resources object in your CloudFormation stack and display those state changes in the UI for the system.

This option suggests using a long poll on the Resources object in your CloudFormation stack to get real-time updates on the status of your stack. A long poll is a way of retrieving information from a server in a way that avoids constantly polling the server for updates. Instead, the client sends a request to the server, and the server waits to respond until there is new information to report. This approach can reduce the number of requests made to the server and improve the efficiency of the system.

However, using a long poll on the Resources object in your CloudFormation stack may not be the best approach for real-time status updates. The Resources object provides information about the resources that make up your stack, but it does not provide real-time updates on the status of the stack. You would need to constantly poll the Resources object to get updates, which could be inefficient and may not provide real-time status updates.

B. Use a long-poll on the ListStacksAPI call for your CloudFormation stack and display those state changes in the UI for the system.

This option suggests using a long poll on the ListStacks API call for your CloudFormation stack to get real-time updates on the status of your stack. The ListStacks API call provides information about the status of all the stacks in your AWS account, including their creation, update, and deletion status. Using a long poll on this API call can help you get real-time updates on the status of your CloudFormation stacks without the need for constant polling.

However, using a long poll on the ListStacks API call may not be the best approach for real-time status updates either. The ListStacks API call provides information about all the stacks in your AWS account, not just the ones you are interested in monitoring. This could result in a lot of unnecessary requests and could impact the performance of your system.

C. Subscribe your continuous delivery system to an SNS topic that you also tell your CloudFormation stack to publish events into.

This option suggests subscribing your continuous delivery system to an SNS topic and telling your CloudFormation stack to publish events to that topic. SNS is a highly available, durable, and scalable publish/subscribe messaging service that enables you to send messages to a large number of subscribers, including distributed systems, microservices, and serverless applications. By subscribing your continuous delivery system to an SNS topic, you can receive real-time updates on the status of your CloudFormation stacks as they happen.

This is the best option for achieving real-time status updates in a continuous delivery system. By subscribing your system to an SNS topic and telling your CloudFormation stack to publish events to that topic, you can receive real-time updates on the status of your stack without the need for constant polling. This approach is efficient, scalable, and can be customized to suit your specific