# HostedAgentOptions

- Module: [Aspire.Hosting.Foundry](/reference/api/go/aspire.hosting.foundry.md)
- Version: `17.0.0-preview.1.26565.2`
- Kind: `struct`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Options that control how a compute resource is deployed as a Microsoft Foundry hosted agent. All properties are optional; unset properties fall back to the Foundry hosted agent defaults.

## Definition

```go
type HostedAgentOptions struct {
    Description          *string           `json:"Description"`
    Cpu                  *float64          `json:"Cpu"`
    Memory               *float64          `json:"Memory"`
    Metadata             map[string]string `json:"Metadata"`
    EnvironmentVariables map[string]string `json:"EnvironmentVariables"`
}
```

## Fields

- `Description`: `*string` -- Human-readable description of the hosted agent surfaced in the Microsoft Foundry portal. When not set, the hosted agent default description is used.
- `Cpu`: `*float64` `optional` -- CPU allocation for each hosted agent instance, in vCPU cores. Must be between 0.5 and 3.5 in increments of 0.25. When not set, the hosted agent default CPU allocation is used.
- `Memory`: `*float64` `optional` -- Memory allocation for each hosted agent instance, in GiB. Must be between 1 and 7 in increments of 0.5 and equal to twice the CPU value. When not set, the hosted agent default memory allocation is used.
- `Metadata`: `map[string]string` `optional` -- Additional metadata key/value pairs to attach to the hosted agent definition. Entries with the same key as an existing metadata entry overwrite it.
- `EnvironmentVariables`: `map[string]string` `optional` -- Environment variables to set on the hosted agent container at runtime. Entries with the same key as an existing environment variable overwrite it.
