In order to have persistence, we must have an EBS backed instance, with one (or many) EBS volume attached to it. Use the desired format and mount the filesytems. These EBS volumes are available as Network Attached Storage (NAS); their life cycles are independent of the instance.
To demonstrate the use of this service, let's provision an EBS volume and then attach it to the instance. EBS volumes have AZ scope, and they are automatically replicated inside of the data center to achieve high durability out of the box. Let's go through the following steps:
- To properly associate the volume, let's query the AZ in which this instance is currently running, as follows:
aws ec2 describe-instances --instance-ids $CURRENT_INSTANCE --output json --query 'Reservations[0].Instances[0].Placement'
The result is as follows:
{
"Tenancy": "...