# ResourceWithConnectionString.WithConnectionProperty

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

Adds a connection property annotation to the resource being built.

## Definition

```go
type ResourceWithConnectionString interface {
    // ... omitted for brevity
    WithConnectionProperty(
        name string,
        value any,
    ) ResourceWithConnectionString
}
```

## Signature

```go
WithConnectionProperty(
    name string,
    value any,
) ResourceWithConnectionString
```

## Parameters

- `name` (`string`) -- The name of the connection property to add.
- `value` (`any`) -- The value to assign to the connection property, specified as a string or reference expression.

## Returns

[`ResourceWithConnectionString`](/reference/api/go/aspire.hosting/resourcewithconnectionstring.md) -- The same resource builder instance with the specified connection property annotation applied.

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

## Defined on

- [ResourceWithConnectionString](/reference/api/go/aspire.hosting/resourcewithconnectionstring.md) -- `interface`
