# ParameterResource

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

Represents a parameter resource.

## Definition

```go
type ParameterResource interface {
    ExpressionValue
    Resource
}
```

## Embeds

- [`ExpressionValue`](/reference/api/go/aspire.hosting/expressionvalue.md)
- [`Resource`](/reference/api/go/aspire.hosting/resource.md)

## Methods

- [AsOptional](/reference/api/go/aspire.hosting/parameterresource/asoptional.md) -- `method` -- Marks the parameter resource as optional.
  ```go
  AsOptional() ParameterResource
  ```
- [AsRequired](/reference/api/go/aspire.hosting/parameterresource/asrequired.md) -- `method` -- Marks the parameter resource as required.
  ```go
  AsRequired() ParameterResource
  ```
- [SetValueAsync](/reference/api/go/aspire.hosting/parameterresource/setvalueasync.md) -- `method` -- Sets or replaces the value for this parameter.
  ```go
  SetValueAsync(options ...*SetValueAsyncOptions) error
  ```
- [TryGetCurrentValue](/reference/api/go/aspire.hosting/parameterresource/trygetcurrentvalue.md) -- `method` -- Gets the current value for this parameter without waiting for unresolved input.
  ```go
  TryGetCurrentValue() (*string, error)
  ```
- [WithCustomInput](/reference/api/go/aspire.hosting/parameterresource/withcustominput.md) -- `method` -- Sets a custom input for the parameter resource from a polyglot AppHost.
  ```go
  WithCustomInput(options *ParameterCustomInputOptions) ParameterResource
  ```
- [WithDescription](/reference/api/go/aspire.hosting/parameterresource/withdescription.md) -- `method` -- Sets the description of the parameter resource.
  ```go
  WithDescription(description string, options ...*WithDescriptionOptions) ParameterResource
  ```
