AWS Security ChangesHomeSearch

AWS AWSEC2 documentation change

Service: AWSEC2 · 2025-04-16 · Documentation low

File: AWSEC2/latest/UserGuide/configure-root-volume-delete-on-termination.md

Summary

Updated documentation for configuring root volume persistence across multiple interfaces (CLI, PowerShell, Console). Changes include command syntax improvements, code sample formatting, added output examples, and section header simplifications.

Security assessment

Changes focus on improving clarity and consistency of existing documentation about data persistence configuration. While DeleteOnTermination is security-relevant, there's no evidence these changes address a specific vulnerability or security incident.

Diff

diff --git a/AWSEC2/latest/UserGuide/configure-root-volume-delete-on-termination.md b/AWSEC2/latest/UserGuide/configure-root-volume-delete-on-termination.md
index 95a8d395d..611be6f35 100644
--- a//AWSEC2/latest/UserGuide/configure-root-volume-delete-on-termination.md
+++ b//AWSEC2/latest/UserGuide/configure-root-volume-delete-on-termination.md
@@ -29 +29 @@ Console
-###### To configure the root volume to persist when you launch an instance using the console
+###### To configure the root volume to persist when you launch an instance
@@ -51 +51 @@ AWS CLI
-###### To configure the root volume to persist when you launch an instance using the AWS CLI
+###### To configure the root volume to persist when you launch an instance
@@ -53 +53 @@ AWS CLI
-Use the [run-instances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/run-instances.html) command and include a block device mapping that sets the `DeleteOnTermination` attribute to `false`.
+Use the [run-instances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/run-instances.html) command and include the following option.
@@ -56 +56 @@ Use the [run-instances](https://awscli.amazonaws.com/v2/documentation/api/latest
-    aws ec2 run-instances --block-device-mappings file://mapping.json ...other parameters...
+    --block-device-mappings file://mapping.json
@@ -58 +58 @@ Use the [run-instances](https://awscli.amazonaws.com/v2/documentation/api/latest
-Specify the following in `mapping.json`.
+In `mapping.json`, specify a block device mapping that sets the `DeleteOnTermination` attribute to `false`.
@@ -70 +70,6 @@ Specify the following in `mapping.json`.
-Tools for Windows PowerShell
+PowerShell
+    
+
+###### To configure the root volume to persist when you launch an instance
+
+Use the [New-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Instance.html) cmdlet and include the following parameter.
@@ -73 +78 @@ Tools for Windows PowerShell
-###### To configure the root volume to persist when you launch an instance using the Tools for Windows PowerShell
+    -BlockDeviceMapping $bdm
@@ -75 +80 @@ Tools for Windows PowerShell
-Use the [New-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Instance.html) command and include a block device mapping that sets the `DeleteOnTermination` attribute to `false`.
+Create a block device mapping that sets the `DeleteOnTermination` attribute to `$false`.
@@ -78,6 +83,5 @@ Use the [New-EC2Instance](https://docs.aws.amazon.com/powershell/latest/referenc
-    C:\> $ebs = New-Object Amazon.EC2.Model.EbsBlockDevice
-    C:\> $ebs.DeleteOnTermination = $false
-    C:\> $bdm = New-Object Amazon.EC2.Model.BlockDeviceMapping
-    C:\> $bdm.DeviceName = "dev/xvda"
-    C:\> $bdm.Ebs = $ebs
-    C:\> New-EC2Instance -ImageId ami-0abcdef1234567890 -BlockDeviceMapping $bdm ...other parameters...
+    $ebs = New-Object Amazon.EC2.Model.EbsBlockDevice
+    $ebs.DeleteOnTermination = $false
+    $bdm = New-Object Amazon.EC2.Model.BlockDeviceMapping
+    $bdm.DeviceName = "dev/xvda"
+    $bdm.Ebs = $ebs
@@ -92 +96 @@ AWS CLI
-###### To configure the root volume to persist for an existing instance using the AWS CLI
+###### To configure the root volume to persist for an existing instance
@@ -97 +101,3 @@ Use the [modify-instance-attribute](https://awscli.amazonaws.com/v2/documentatio
-    aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --block-device-mappings file://mapping.json
+    aws ec2 modify-instance-attribute \
+        --instance-id i-1234567890abcdef0 \
+        --block-device-mappings file://mapping.json
@@ -111 +117 @@ Specify the following in `mapping.json`.
-Tools for Windows PowerShell
+PowerShell
@@ -114 +120 @@ Tools for Windows PowerShell
-###### To configure the root volume to persist for an existing instance using the AWS Tools for Windows PowerShell
+###### To configure the root volume to persist for an existing instance
@@ -116 +122 @@ Tools for Windows PowerShell
-Use the [Edit-EC2InstanceAttribute](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2InstanceAttribute.html) command with a block device mapping that sets the `DeleteOnTermination` attribute to `false`.
+Use the [Edit-EC2InstanceAttribute](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2InstanceAttribute.html) cmdlet with a block device mapping that sets the `DeleteOnTermination` attribute to `$false`.
@@ -119,6 +125,8 @@ Use the [Edit-EC2InstanceAttribute](https://docs.aws.amazon.com/powershell/lates
-    C:\> $ebs = New-Object Amazon.EC2.Model.EbsInstanceBlockDeviceSpecification
-    C:\> $ebs.DeleteOnTermination = $false
-    C:\> $bdm = New-Object Amazon.EC2.Model.InstanceBlockDeviceMappingSpecification
-    C:\> $bdm.DeviceName = "/dev/xvda"
-    C:\> $bdm.Ebs = $ebs
-    C:\> Edit-EC2InstanceAttribute -InstanceId i-1234567890abcdef0 -BlockDeviceMapping $bdm
+    $ebs = New-Object Amazon.EC2.Model.EbsInstanceBlockDeviceSpecification
+    $ebs.DeleteOnTermination = $false
+    $bdm = New-Object Amazon.EC2.Model.InstanceBlockDeviceMappingSpecification
+    $bdm.DeviceName = "/dev/xvda"
+    $bdm.Ebs = $ebs
+    Edit-EC2InstanceAttribute `
+        -InstanceId i-1234567890abcdef0 `
+        -BlockDeviceMapping $bdm
@@ -133 +141 @@ Console
-###### To confirm that a root volume is configured to persist using the Amazon EC2 console
+###### To confirm that a root volume is configured to persist
@@ -147 +155 @@ AWS CLI
-###### To confirm that a root volume is configured to persist using the AWS CLI
+###### To confirm that a root volume is configured to persist
@@ -149 +157 @@ AWS CLI
-Use the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-instances.html) command and verify that the `DeleteOnTermination` attribute in the `BlockDeviceMappings` response element is set to `false`.
+Use the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-instances.html) command and verify that the `DeleteOnTermination` attribute is set to `false`.
@@ -152 +160,3 @@ Use the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/l
-    aws ec2 describe-instances --instance-id i-1234567890abcdef0
+    aws ec2 describe-instances \
+        --instance-id i-1234567890abcdef0 \
+        --query "Reservations[].Instances[].BlockDeviceMappings"
@@ -153,0 +164 @@ Use the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/l
+The following is example output.
@@ -155,2 +166,3 @@ Use the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/l
-    ...
-        "BlockDeviceMappings": [
+    
+    [
+        [
@@ -158 +170 @@ Use the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/l
-            "DeviceName": "/dev/sda1",
+                "DeviceName": "/dev/xvda",
@@ -159,0 +172,2 @@ Use the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/l
+                    "AttachTime": "2024-07-12T04:05:33.000Z",
+                    "DeleteOnTermination": false,
@@ -161,4 +175,2 @@ Use the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/l
-                **"DeleteOnTermination": false** ,
-                "VolumeId": "vol-1234567890abcdef0",
-                "AttachTime": "2013-07-19T02:42:39.000Z"
-            }
+                    "VolumeId": "vol-1234567890abcdef0"
+                    
@@ -166 +178,7 @@ Use the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/l
-    ...
+        ]              
+    ]
+
+PowerShell
+    
+
+###### To confirm that a root volume is configured to persist
@@ -168 +186 @@ Use the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/l
-Tools for Windows PowerShell
+Use the [ Get-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html) cmdlet and verify that the `DeleteOnTermination` attribute is set to `False`.
@@ -171 +189 @@ Tools for Windows PowerShell
-###### To confirm that a root volume is configured to persist using the AWS Tools for Windows PowerShell
+    (Get-EC2Instance -InstanceId i-i-1234567890abcdef0).Instances.BlockDeviceMappings.Ebs
@@ -173 +191 @@ Tools for Windows PowerShell
-Use the [ Get-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html) and verify that the `DeleteOnTermination` attribute in the `BlockDeviceMappings` response element is set to `false`.
+The following is example output.
@@ -176 +194,6 @@ Use the [ Get-EC2Instance](https://docs.aws.amazon.com/powershell/latest/referen
-    C:\> (Get-EC2Instance -InstanceId i-i-1234567890abcdef0).Instances.BlockDeviceMappings.Ebs
+    AssociatedResource  : 
+    AttachTime          : 7/12/2024 4:05:33 AM
+    DeleteOnTermination : False
+    Operator            : 
+    Status              : attached
+    VolumeId            : vol-1234567890abcdef0