# withPublicIPAddress

- Module: [Aspire.Hosting.Azure.Network](/reference/api/typescript/aspire.hosting.azure.network.md)
- Version: `13.4.0`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire)

Associates an explicit Public IP Address resource with the NAT Gateway.

## Definition

```typescript
interface AzureNatGatewayResource {
  // ... omitted for brevity
  withPublicIPAddress(publicIPAddress: AzurePublicIPAddressResource): AzureNatGatewayResource
}
```

## Parameters

- `publicIPAddress` ([AzurePublicIPAddressResource](/reference/api/typescript/aspire.hosting.azure.network/azurepublicipaddressresource.md))

## Returns

[AzureNatGatewayResource](/reference/api/typescript/aspire.hosting.azure.network/azurenatgatewayresource.md) `builder`

## Applies to

- [AzureNatGatewayResource](/reference/api/typescript/aspire.hosting.azure.network/azurenatgatewayresource.md)
