Explanation: AWS CloudFormation enables you to create and delete related AWS resources together as a unit called a stack. You define the characteristics of a stack parameters, mappings, resource properties, and output values using a template (a JSON-compliant text file). You can write your template from scratch, or start with one of the example templates we provide. You can use a number of AWS products with AWS CloudFormation, such as Amazon EC2, AWS Elastic Beanstalk, and Amazon RDS
Stacks
A stack is a collection of AWS resources. With AWS CloudFormation you can do the following with your stacks:
Create an AWS CloudFormation stack using aws cloudformation create-stack, providing a name, and specifying a template that defines the stack.
Track the progress of the create operation using aws cloudformation describe-stack-events. AWS CloudFormation optimizes the order of member resource creation during stack creation, taking into account resource dependencies, so it's not possible to predict the order in which each resource will be created. The aws cloudformation describe-stack-events command enables you to monitor the progress.
List your running stacks using aws cloudformation describe-stacks or aws cloudformation list-stacks, filtering by a specific stack name or stack status. Only running stacks and stacks in the process of being created or deleted are listed with aws cloudformation describe-stacks. You can use aws cloudformation list-stacks to list stacks that have any status (even if they have been deleted within the past 90 days), filtering on the status if you need to.
Itemize the contents of a stack using aws cloudformation describe-stack-resources. You can do this even when a stack is being created or deleted, enabling you to see the state of individual member resources.
View the history of the events produced by a stack using aws cloudformation describe-stack-events, optionally filtering by a specific stack name. You can see events for a deleted stack for up to 90 days.
Delete a stack using aws cloudformation delete-stack. When you delete a stack, each of its member resources is deleted as well. As with the stack creation, AWS CloudFormation optimizes the deletion sequence, so the order isn't predictable. You can track the progress of the deletion using aws cloudformation describe-stack-events and list deleted stacks using aws cloudformation list-stacks.
AWS CloudFormation makes sure all member resources are created or deleted as appropriate. Because AWS CloudFormation treats the members of a stack as a single unit, they must all be created successfully for the stack to be created. If for any reason a member resource cannot be created, AWS CloudFormation rolls the stack back and automatically deletes the member resources that were created.
Note You are charged for the stack resources for the time they were operating (even if you deleted the stack right away).
Question : If for any reason a half of the member resource cannot be created, AWS CloudFormation keeps the half of the member resources that were created.
Explanation: AWS CloudFormation makes sure all member resources are created or deleted as appropriate. Because AWS CloudFormation treats the members of a stack as a single unit, they must all be created successfully for the stack to be created. If for any reason a member resource cannot be created, AWS CloudFormation rolls the stack back and automatically deletes the member resources that were created.
Question : Explain what the following resource in a CloudFormation template does. Choose the best possible answer. "SNSTopic" : { "Type" : "AWS::SNS::Topic", "Properties" : { "Subscription" : [ { "Protocol" : "sqs", "Endpoint" : { "Fn::GetAtt" : [ "SQSQueue", "Arn" ] } }] } 1. Creates an SNS topic that allow SQS subscription endpoints 2. Creates an SNS topic and then invokes the call to create an SQS queue with a logical resource name of SQSQueue 3. Access Mostly Uused Products by 50000+ Subscribers 4. Creates an SNS topic and adds a subscription ARN endpoint for the SQS resource created under the logical name SQSQueue
Before you subscribe your HTTP or HTTPS endpoint to a topic, you must make sure that the HTTP or HTTPS endpoint has the capability to handle the HTTP POST requests that Amazon SNS uses to send the subscription confirmation and notification messages. Usually, this means creating and deploying a web application (for example, a Java servlet if your endpoint host is running Linux with Apache and Tomcat) that processes the HTTP requests from Amazon SNS. When you subscribe an HTTP endpoint, Amazon SNS sends it a subscription confirmation request. Your endpoint must be prepared to receive and process this request when you create the subscription because Amazon SNS sends this request at that time. Amazon SNS will not send notifications to the endpoint until you confirm the subscription. Once you confirm the subscription, Amazon SNS will send notifications to the endpoint when a publish action is performed on the subscribed topic. Step 2: Subscribe the HTTP/HTTPS endpoint to the Amazon SNS topic
To send messages to an HTTP or HTTPS endpoint through a topic, you must subscribe the endpoint to the Amazon SNS topic. You specify the endpoint using its URL. To subscribe to a topic, you can use the Amazon SNS console, the sns-subscribe command, or the Subscribe API action. Before you start, make sure you have the URL for the endpoint that you want to subscribe and that your endpoint is prepared to receive the confirmation and notification messages as described in Step 1.
Step 3: Confirm the subscription After you subscribe your endpoint, Amazon SNS will send a subscription confirmation message to the endpoint. You should already have code that performs the actions described in Step 1 deployed to your endpoint. Specifically, the code at the endpoint must retrieve the SubscribeURL value from the subscription confirmation message and either visit the location specified by SubscribeURL itself or make it available to you so that you can manually visit the SubscribeURL, for example, using a web browser. Amazon SNS will not send messages to the endpoint until the subscription has been confirmed. When you visit the SubscribeURL, the response will contain an XML document containing an element SubscriptionArn that specifies the ARN for the subscription. You can also use the Amazon SNS console to verify that the subscription is confirmed: The Subscription ID will display the ARN for the subscription instead of the PendingConfirmation value that you saw when you first added the subscription.
1. 2nd level read replicas configuration is wrong 2. 2nd level read replica's Harware configuration will always be lower grade then master. 3. Access Mostly Uused Products by 50000+ Subscribers 4. Because of additional replication latency introduced as transactions are replicated from the master to the first level replica and then to the second-level replica. 5. Any of the above could be correct