PrerequisiteInstall and configure the AWS Command Line Interface (CLI) before completing this procedure. See Amazon User Guide for Linux Instances.
If you did not originally configure a Teradata® VantageCloud Enterprise on AWS (DIY) instance for EBS volume deletion on termination, you can enable this feature after deploying 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.
- Check whether EBS volumes are set to delete on termination.
- From the EC2 Console, select Instances.
- Select the instance you want to check.
- From the Description tab, select the EBS volume next to Block devices.
If Delete on termination is set to False, EBS volumes are not deleted on termination. To change this setting, continue with the next steps. - From the EC2 Console, select Instances.
- Note the Instance ID and Public IP of the instance you want to modify.
- From your SSH client console, log on to the instance using the public IP address you noted earlier.
- 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.
- Note the DeviceName on the volume that has DeleteOnTermination set to False.
- 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. - [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.