# Configuring Automatic Backups

To configure automatic backups using AWS Data Lifecycle Manager,

1. In the EC2 menu, under "Elastic Block Store", select "Lifecycle Manager"
2. Select "Create Lifecycle Policy"
3. In the main (i.e first) section,
   1. Under "Policy type", leave the default: EBS snapshot policy
   2. Under "Select resource type", select "Instance"
   3. Description (Example): Backup PostgreSQL server
   4. Under "Target with these tags", select the tag you created during your Launch Template Setup. EX. PostgreSQL (Key), Database (Value
4. In "IAM Role" section,
   1. Leave as defaults
5. In "Policy Schedule 1" section,
   1. Schedule name (Example): Server Daily Backup
   2. Frequency (Example): Daily
   3. Every (Example): 24 hours
   4. Starting at (Example): 9:00 UTC (4 AM EST)
   5. Retention type (Example): Count
   6. Interval (Example): 5
6. Leave the other sections as their defaults
7. Select "Create Policy"

Now every resource that has our PostgreSQL tag, including our instance, will be backed up daily at 4AM EST, and we will only keep five of our backups at a time.

{% embed url="<https://youtu.be/RWpdmPQJAvw>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aws-postgresql-docs.beliciarodriguez.com/backup-server/automatic-backups-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
