# Attach Elastic IP Address

If our master instance is stopped, the instance will be assigned a new public IP address. This can be very inconvenient because we would constantly have to check what our new IP address is in order to access our server.&#x20;

To avoid this problem, we'll assign an elastic IP address to our master instance in the auto scale group.

To create an elastic IP address,

1. Navigate to your AWS EC2 dashboard.
2. Under "Network & Security", select "Elastic IPs".
3. Under "Elastic IP Address settings" and "Public IPv4 address pool", leave the default option "Amazon's pool of IPv4 addresses"
4. Tags (Optional): If you'd like, you can associate your PostgreSQL tag with your Elastic IP address.
5. Select "Allocate"

After being brought back to the "Elastic IPs" page,

1. In the green box that says "Elastic IP address allocated successfully", select "Associate this Elastic IP address"
2. Under "Resource type", leave the default option: "Instance"
3. Under "Instance", select the master instance of your auto scale group
4. Under "Private IP address", select an IP address
5. Under reassociation, leave the box unchecked

**Note about reassociation**: Having the elastic IP be reassociated means that if the instance with the elastic IP address in your auto group fails, the IP address would be reassociated with the  instance that replaces the failed one.&#x20;

For our case, if our master instance fails, it would be best if the elastic IP address is simply dissociated. Then, we can use a backup (discussed in a later chapter) to recreate our master instance and reattach the elastic IP address to the backup.

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


---

# 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/launching-instance/elastic-ip-address.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.
