# AddNatGateway

- Module: [Aspire.Hosting.Azure.Network](/reference/api/go/aspire.hosting.azure.network.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: `DistributedApplicationBuilder`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Adds an Azure NAT Gateway resource to the application model.

## Remarks

The NAT Gateway is created with Standard SKU. If no Public IP Address is explicitly associated
via `WithPublicIPAddress`, a Public IP Address is automatically created in the
NAT Gateway's bicep module with Standard SKU and Static allocation.

## Definition

```go
func (DistributedApplicationBuilder) AddNatGateway(name string) AzureNatGatewayResource
```

## Parameters

- `name` (`string`) -- The name of the Azure NAT Gateway resource.

## Returns

[`AzureNatGatewayResource`](/reference/api/go/aspire.hosting.azure.network/azurenatgatewayresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- `DistributedApplicationBuilder`
