IResource
Interface
interface IResource { createExecutionConfiguration(): IExecutionConfigurationBuilder; excludeFromManifest(): IResource; excludeFromMcp(): IResource; getResourceName(): string; onBeforeResourceStarted(callback: (arg: BeforeResourceStartedEvent) => Promise<void>): IResource; onInitializeResource(callback: (arg: InitializeResourceEvent) => Promise<void>): IResource; onResourceReady(callback: (arg: ResourceReadyEvent) => Promise<void>): IResource; onResourceStopped(callback: (arg: ResourceStoppedEvent) => Promise<void>): IResource; withChildRelationship(child: IResource): IResource; withCommand(name: string, displayName: string, executeCommand: (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult>, commandOptions?: CommandOptions): IResource; withContainerRegistry(registry: IResource): IResource; withDockerfileBaseImage( buildImage?: string, runtimeImage?: string): IResource; withExplicitStart(): IResource; withHealthCheck(key: string): IResource; withHidden(): IResource; withHiddenOnCompletion( exitCode?: number, exitCodes?: number[]): IResource; withIconName( iconName: string, iconVariant?: IconVariant): IResource; withLifetimeOf(sourceBuilder: IResource): IResource; withParentProcessLifetime(parentProcessId: number): IResource; withParentRelationship(parent: IResource): IResource; withPersistentLifetime(): IResource; withPipelineConfiguration(callback: (obj: PipelineConfigurationContext) => Promise<void>): IResource; withPipelineStepFactory(stepName: string, callback: (arg: PipelineStepContext) => Promise<void>, dependsOn?: string[], requiredBy?: string[], tags?: string[], description?: string): IResource; withProcessCommand( commandName: string, displayName: string, options: ProcessCommandExportOptions): IResource; withProcessCommandFactory(commandName: string, displayName: string, createProcessSpec: (arg: ExecuteCommandContext) => Promise<ProcessCommandSpecExportData>, options?: ProcessCommandResultExportOptions): IResource; withRelationship( resourceBuilder: IResource, type: string): IResource; withRequiredCommand( command: string, helpLink?: string): IResource; withSessionLifetime(): IResource; withUrl( url: ReferenceExpression, displayText?: string): IResource; withUrlForEndpoint(endpointName: string, callback: (obj: ResourceUrlAnnotation) => Promise<void>): IResource; withUrls(callback: (obj: ResourceUrlsCallbackContext) => Promise<void>): IResource;} 31 members
Methods
method
createExecutionConfiguration Creates an execution configuration builder for the specified resource.
createExecutionConfiguration(): IExecutionConfigurationBuilderReturns
IExecutionConfigurationBuilder Excludes a resource from being published to the manifest.
excludeFromManifest(): IResourceReturns
IResource Exclude the resource from MCP operations using the Aspire MCP server. The resource is excluded from results that return resources, console logs and telemetry.
excludeFromMcp(): IResourceReturns
IResource method
getResourceName Gets the name of the resource from a builder.
getResourceName(): stringReturns
string Subscribes to the BeforeResourceStarted event.
onBeforeResourceStarted(callback: (arg: BeforeResourceStartedEvent) => Promise<void>): IResourceParameters
callback (arg: BeforeResourceStartedEvent) => Promise<void> Returns
IResource Subscribes to the InitializeResource event.
onInitializeResource(callback: (arg: InitializeResourceEvent) => Promise<void>): IResourceParameters
callback (arg: InitializeResourceEvent) => Promise<void> Returns
IResource Subscribes to the ResourceReady event.
onResourceReady(callback: (arg: ResourceReadyEvent) => Promise<void>): IResourceParameters
callback (arg: ResourceReadyEvent) => Promise<void> Returns
IResource Subscribes to the ResourceStopped event.
onResourceStopped(callback: (arg: ResourceStoppedEvent) => Promise<void>): IResourceParameters
callback (arg: ResourceStoppedEvent) => Promise<void> Returns
IResource Sets a child relationship
withChildRelationship(child: IResource): IResourceParameters
child IResource Returns
IResource Adds a resource command
withCommand(name: string, displayName: string, executeCommand: (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult>, commandOptions?: CommandOptions): IResourceParameters
name string displayName string executeCommand (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult> commandOptions CommandOptions optional Returns
IResource Configures the resource to use the specified container registry for container image operations.
withContainerRegistry(registry: IResource): IResourceParameters
registry IResource Returns
IResource Configures custom base images for generated Dockerfiles.
withDockerfileBaseImage( buildImage?: string, runtimeImage?: string): IResourceParameters
buildImage string optional runtimeImage string optional Returns
IResource Prevents resource from starting automatically
withExplicitStart(): IResourceReturns
IResource Adds a health check by key
withHealthCheck(key: string): IResourceParameters
key string Returns
IResource Specifies the icon to use when displaying the resource in the dashboard.
withIconName( iconName: string, iconVariant?: IconVariant): IResourceParameters
iconName string iconVariant IconVariant optional = Filled Returns
IResource Configures a resource to match the lifetime of another resource.
withLifetimeOf(sourceBuilder: IResource): IResourceParameters
sourceBuilder IResource Returns
IResource Configures a resource to use a persistent lifetime that ends when a parent process exits.
withParentProcessLifetime(parentProcessId: number): IResourceParameters
parentProcessId number Returns
IResource Sets the parent relationship
withParentRelationship(parent: IResource): IResourceParameters
parent IResource Returns
IResource Configures a resource to use a persistent lifetime.
withPersistentLifetime(): IResourceReturns
IResource Registers a callback to be executed during the pipeline configuration phase, allowing modification of step dependencies and relationships.
withPipelineConfiguration(callback: (obj: PipelineConfigurationContext) => Promise<void>): IResourceParameters
callback (obj: PipelineConfigurationContext) => Promise<void> Returns
IResource Adds a pipeline step to the resource that will be executed during deployment.
withPipelineStepFactory(stepName: string, callback: (arg: PipelineStepContext) => Promise<void>, dependsOn?: string[], requiredBy?: string[], tags?: string[], description?: string): IResourceParameters
stepName string callback (arg: PipelineStepContext) => Promise<void> dependsOn string[] optional requiredBy string[] optional tags string[] optional description string optional Returns
IResource Adds a command to the resource that starts a local process when invoked.
withProcessCommand( commandName: string, displayName: string, options: ProcessCommandExportOptions): IResourceParameters
commandName string displayName string options ProcessCommandExportOptions Returns
IResource Adds a command to the resource that starts a local process created by a callback when invoked.
withProcessCommandFactory(commandName: string, displayName: string, createProcessSpec: (arg: ExecuteCommandContext) => Promise<ProcessCommandSpecExportData>, options?: ProcessCommandResultExportOptions): IResourceParameters
commandName string displayName string createProcessSpec (arg: ExecuteCommandContext) => Promise<ProcessCommandSpecExportData> options ProcessCommandResultExportOptions optional Returns
IResource Adds a relationship to another resource using its builder.
withRelationship( resourceBuilder: IResource, type: string): IResourceParameters
resourceBuilder IResource type string Returns
IResource Declares that a resource requires a specific command/executable to be available on the local machine PATH before it can start.
withRequiredCommand( command: string, helpLink?: string): IResourceParameters
command string helpLink string optional Returns
IResource Configures a resource to use a session lifetime.
withSessionLifetime(): IResourceReturns
IResource Adds or modifies displayed URLs
withUrl( url: ReferenceExpression, displayText?: string): IResourceParameters
url ReferenceExpression displayText string optional Returns
IResource Registers a callback to update the URL displayed for the endpoint with the specified name.
withUrlForEndpoint(endpointName: string, callback: (obj: ResourceUrlAnnotation) => Promise<void>): IResourceParameters
endpointName string callback (obj: ResourceUrlAnnotation) => Promise<void> Returns
IResource Registers a callback to customize the URLs displayed for the resource.
withUrls(callback: (obj: ResourceUrlsCallbackContext) => Promise<void>): IResourceParameters
callback (obj: ResourceUrlsCallbackContext) => Promise<void> Returns
IResource