# IResource.withParentProcessLifetime

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Defined on: [IResource](/reference/api/typescript/aspire.hosting/iresource.md)
- Version: `13.4.0`
- Kind: `method`

Configures a resource to use a persistent lifetime that ends when a parent process exits.

## Definition

```typescript
interface IResource {
  // ... omitted for brevity
  withParentProcessLifetime(parentProcessId: number): IResource;
}
```

## Signature

```typescript
withParentProcessLifetime(parentProcessId: number): IResource
```

## Parameters

- `parentProcessId` (`number`)

## Returns

[IResource](/reference/api/typescript/aspire.hosting/iresource.md) `builder`

## Defined on

- [IResource](/reference/api/typescript/aspire.hosting/iresource.md) -- `interface`
