I have created an EC2 Instance with "Delete on Termination" set to False at EBS Root storage. Now, I want to set it to True using AWS CLI.
To enable delete on termination for EBS:
aws ec2 modify-instance-attribute \
--instance-id <...> \
--block-device-mappings "[{\"DeviceName\": \"/dev/sdf\",\"Ebs\":{\"DeleteOnTermination\":true}}]"
To enable delete on termination for an instance:
aws ec2 modify-instance-attribute \
--instance-id <...> \
--instance-initiated-shutdown-behavior terminate