> 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 dynamically by asking a question.

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
