# ResourceNotificationService.WaitForResourceStates

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Defined on: [ResourceNotificationService](/reference/api/go/aspire.hosting/resourcenotificationservice.md)
- Version: `17.0.0`
- Kind: `method`

Waits for a resource to reach one of the specified states.

## Definition

```go
type ResourceNotificationService interface {
    // ... omitted for brevity
    WaitForResourceStates(
        resourceName string,
        targetStates []string,
    ) (string, error)
}
```

## Signature

```go
WaitForResourceStates(
    resourceName string,
    targetStates []string,
) (string, error)
```

## Parameters

- `resourceName` (`string`)
- `targetStates` (`[]string`)

## Returns

`(string, error)`

Returns `(string, error)`.

## Defined on

- [ResourceNotificationService](/reference/api/go/aspire.hosting/resourcenotificationservice.md) -- `handle`
