Setting EBS Storage for Deletion on Instance Termination

Prerequisite
Install and configure the AWS Command Line Interface (CLI) before completing this procedure. For more information, see Amazon User Guide for Linux Instances.
If you did not originally configure a Teradata Database on AWS instance for EBS volume deletion on termination, you can enable this feature after launching the instance. By completing this procedure, you avoid incurring storage-specific charges on instance termination.

You can modify this setting only when the instance is running.

  1. Check whether EBS volumes are set to delete on termination.
    1. From the EC2 Console, click Instances.
    2. Click the instance you want to check.
    3. From the Description tab, click the EBS volume next to Block devices.
    If Delete on termination is set to False, EBS volumes will not be deleted on termination. To change this setting, continue with the next steps.
  2. From the EC2 Console, click Instances.
  3. Note the Instance ID and Public IP of the instance you want to modify.
  4. From your SSH client console, log on to the instance using the public IP address you noted earlier.
  5. Using AWS CLI, run the following commands to get the information on all the volumes associated with the instance.
    # sudo su -
    # aws ec2 describe-instance-attribute --instance-id [instance_id] --attribute blockDeviceMapping

    where the instance_id is the instance ID you noted earlier.

  6. Note the DeviceName on the volume that has DeleteOnTermination set to False.
  7. Run the following command to set the DeleteOnTermination to true.
    # aws ec2 modify-instance-attribute --instance-id [instance_id] --block-device-mappings "[{\"DeviceName\": \"[DeviceName]\",\"Ebs\":{\"DeleteOnTermination\":true}}]"
    where:
    • The instance_id is the instance ID you noted earlier.
    • The DeviceName is the device name you noted earlier.
    Your EBS volumes will be deleted on termination.
  8. [Optional] To verify that DeleteOnTermination is set to True, complete step 1 again or run the following command.
    # aws ec2 describe-instance-attribute --instance-id [instance_id] --attribute blockDeviceMapping

    where the instance_id is the instance ID you noted earlier.

    If the parameter value is True, EBS volumes will be deleted on instance termination.

results matching ""

    No results matching ""