AWS CloudFormation for Load Testing: Automating Game Performance | DevOps Exam Prep

Automating Load Testing with AWS CloudFormation

Prev Question Next Question

Question

A gaming company adopted AWS CloudFormation to automate load-testing of their games.

They have created an AWS Cloud Formation template for each gaming environment and one for the load-testing stack.

The load-testing stack creates an Amazon Relational Database Service (RDS) Postgres database and two web servers running on Amazon Elastic Compute Cloud (EC2) that send HTTP requests, measure response times, and write the results into the database.

A test run usually takes between 15 and 30 minutes.

Once the tests are done, the AWS Cloud Formation stacks are torn down immediately.

The test results written to the Amazon RDS database must remain accessible for visualization and analysis.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

Answer - C and D.

With the DeletionPolicy attribute, you can preserve or (in some cases) backup a resource when its stack is deleted.

You specify a DeletionPolicy attribute for each resource that you want to control.

If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.

To keep a resource when its stack is deleted, specify Retain for that resource.

You can use retain for any resource.

For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.

Option A is incorrect because the RDS Read-Replica will also be deleted when the CloudFormation stack is deleted.

Option B is incorrect because the update policy cannot prevent deleting the RDS database.

The deletion policy should be used.

Option E is incorrect because the database is deleted when the CloudFormation stack is deleted.

You cannot configure the automated backups.

For more information on Deletion policy, please visit the below URL.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html

The requirement is to make sure that the test results written to the Amazon RDS database remain accessible for visualization and analysis, even after tearing down the AWS Cloud Formation stacks.

A. Defining an Amazon RDS Read-Replica in the load-testing AWS CloudFormation stack and defining a dependency relation between the master and replica via the Depends On attribute will ensure that the data written to the RDS database is replicated to the Read Replica. However, this does not ensure that the data will be retained after tearing down the CloudFormation stack.

B. Defining an update policy to prevent deleting the Amazon RDS database after the AWS CloudFormation stack is deleted is not a suitable option, as the requirement is to delete the stack after the tests are done.

C. Defining a deletion policy of type Retain for the Amazon RDS resource assures that the RDS database is not deleted with the AWS CloudFormation stack. This will meet the requirement of keeping the test results accessible for visualization and analysis. However, this will also keep the RDS database running and incurring costs, even when it is not needed.

D. Defining a deletion policy of type Snapshot for the Amazon RDS resource assures that the RDS database can be restored after the AWS CloudFormation stack is deleted. This meets the requirement of keeping the test results accessible, and it also provides the option to restore the RDS database when needed. However, this will also incur additional costs for storing the RDS snapshots.

E. Defining automated backups with a backup retention period of 30 days for the Amazon RDS database and performing point-in-time recovery of the database after the AWS CloudFormation stack is deleted is a suitable option. This will meet the requirement of keeping the test results accessible, and it also provides the option to recover the database to a specific point in time. The backups can be configured to be deleted automatically after the retention period is over, which will help to avoid unnecessary costs.

Therefore, option E is the best solution for this requirement.