> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec2-aws-19.md).

# Not all EIP addresses allocated to a VPC are attached to EC2 instances misconfiguration detected in

## Rule Details

|                        |                                |
| ---------------------- | ------------------------------ |
| Cortex AppSec Rule ID  | APPSEC2\_AWS\_19               |
| Category - Subcategory | Public Exposure - VPC VCN VNet |
| Provider               | AWS                            |
| Severity               | LOW                            |
| Framework              | Terraform, Terraform Plan      |

## Impact

Ensure that an Elastic IP (EIP) is allocated for each NAT gateway that you want to deploy within your AWS account. An EIP address is a static, public IP address designed for dynamic cloud computing. You can associate an AWS EIP address with any EC2 instance, VPC ENI or NAT gateway. A Network Address Translation (NAT) gateway is a device that helps enabling EC2 instances in a private subnet to connect to the Internet and prevent the Internet from initiating a connection with those instances. With Elastic IPs, you can mask the failure of an EC2 instance by rapidly remapping the address to another instance launched in your VPC

## How to Fix

*Resource:* aws\_eip, aws\_instance

* *Arguments:* *instance* and *vpc* of aws\_eip \[source,go]

***

{ "resource "aws\_eip" "ok\_eip" { instance = aws\_instance.ec2.id vpc = true }

resource "aws\_instance" "ec2" { ami = "ami-21f78e11" availability\_zone = "us-west-2a" instance\_type = "t2.micro"

tags = { Name = "HelloWorld" }

## } ", }


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec2-aws-19.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
