# WithExistingDatabase

- Module: [CommunityToolkit.Aspire.Hosting.Zitadel](/reference/api/go/communitytoolkit.aspire.hosting.zitadel.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: [`ZitadelResource`](/reference/api/go/communitytoolkit.aspire.hosting.zitadel/zitadelresource.md)
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Adds database support to the Zitadel resource.

## Definition

```go
func (ZitadelResource) WithExistingDatabase(database PostgresDatabaseResource) ZitadelResource
```

## Parameters

- `database` ([`PostgresDatabaseResource`](/reference/api/go/communitytoolkit.aspire.hosting.zitadel/postgresdatabaseresource.md)) -- The Postgres database resource to use for the database.

## Returns

[`ZitadelResource`](/reference/api/go/communitytoolkit.aspire.hosting.zitadel/zitadelresource.md)

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

## Applies to

- [`ZitadelResource`](/reference/api/go/communitytoolkit.aspire.hosting.zitadel/zitadelresource.md)
