AWS Certified Developer Associate · Free Practice Question Medium
Question 46
A development team has noticed that one of the EC2 instances has been wrongly configured with the 'DeleteOnTermination' attribute set to True for its root EBS volume.
As a developer associate, can you suggest a way to disable this flag while the instance is still running?
-
A
Update the attribute using AWS management console. Select the EC2 instance and then uncheck the Delete On Termination check box for the root EBS volume
-
B
The attribute cannot be updated when the instance is running. Stop the instance from Amazon EC2 console and then update the flag
-
C
Set the
DisableApiTerminationattribute of the instance using the API -
D
Set the
DeleteOnTerminationattribute to False using the command line
Reveal correct answer
Correct answer: D
Explanation
Correct option:
When an instance terminates, the value of the DeleteOnTermination attribute for each attached EBS volume determines whether to preserve or delete the volume. By default, the DeleteOnTermination attribute is set to True for the root volume and is set to False for all other volume types.
Set the DeleteOnTermination attribute to False using the command line - If the instance is already running, you can set DeleteOnTermination to False using the command line.
Incorrect options:
Update the attribute using AWS management console. Select the EC2 instance and then uncheck the Delete On Termination check box for the root EBS volume - You can set the DeleteOnTermination attribute to False when you launch a new instance. It is not possible to update this attribute of a running instance from the AWS console.
Set the DisableApiTermination attribute of the instance using the API - By default, you can terminate your instance using the Amazon EC2 console, command-line interface, or API. To prevent your instance from being accidentally terminated using Amazon EC2, you can enable termination protection for the instance. The DisableApiTermination attribute controls whether the instance can be terminated using the console, CLI, or API. This option cannot be used to control the delete status for the EBS volume when the instance terminates.
The attribute cannot be updated when the instance is running. Stop the instance from Amazon EC2 console and then update the flag - This statement is wrong and given only as a distractor.
References:
https://aws.amazon.com/premiumsupport/knowledge-center/deleteontermination-ebs/
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
