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; subscribeHttpsEndpointsUpdate(callback: (obj: HttpsEndpointUpdateCallbackContext) => Promise<void>): IResource; withChildRelationship(child: IResource): IResource; withCommand(name: string, displayName: string, executeCommand: (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult>, commandOptions?: CommandOptions): IResource; withContainerBuildOptions(callback: (arg: ContainerBuildOptionsCallbackContext) => Promise<void>): 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; withRequiredCommandValidation(command: string, validationCallback: (arg: RequiredCommandValidationContext) => Promise<RequiredCommandValidationResult>, helpLink?: string): IResource; withSessionLifetime(): IResource; withTerminal(): IResource; withUrl( url: string | ReferenceExpression, displayText?: string): IResource; withUrlForEndpoint(endpointName: string, callback: (obj: ResourceUrlAnnotation) => Promise<void>): IResource; withUrls(callback: (obj: ResourceUrlsCallbackContext) => Promise<void>): IResource;}35 members
Methods
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
stringSubscribes 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 Subscribes to the `BeforeStartEvent` and invokes the specified callback when an HTTPS certificate is determined to be available for the resource. This is used to conditionally update endpoint URI schemes or perform other HTTPS-related configuration at startup.
subscribeHttpsEndpointsUpdate(callback: (obj: HttpsEndpointUpdateCallbackContext) => Promise<void>): IResourceParameters
callback(obj: HttpsEndpointUpdateCallbackContext) => Promise<void> Returns
IResource Sets a child relationship
withChildRelationship(child: IResource): IResourceParameters
childIResource Returns
IResource Adds a resource command
withCommand(name: string, displayName: string, executeCommand: (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult>, commandOptions?: CommandOptions): IResourceParameters
namestringdisplayName stringexecuteCommand (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult> commandOptions CommandOptions optionalReturns
IResource Configures container build options for a compute resource using an async callback.
withContainerBuildOptions(callback: (arg: ContainerBuildOptionsCallbackContext) => Promise<void>): IResourceParameters
callback(arg: ContainerBuildOptionsCallbackContext) => Promise<void> Returns
IResource Configures the resource to use the specified container registry for container image operations.
withContainerRegistry(registry: IResource): IResourceParameters
registryIResource Returns
IResource Configures custom base images for generated Dockerfiles.
withDockerfileBaseImage( buildImage?: string, runtimeImage?: string): IResourceParameters
buildImage stringoptionalruntimeImage stringoptionalReturns
IResource Prevents resource from starting automatically
withExplicitStart(): IResourceReturns
IResource Adds a health check by key
withHealthCheck(key: string): IResourceParameters
keystringReturns
IResource Specifies the icon to use when displaying the resource in the dashboard.
withIconName( iconName: string, iconVariant?: IconVariant): IResourceParameters
iconName stringiconVariant IconVariant optional= FilledReturns
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 numberReturns
IResource Sets the parent relationship
withParentRelationship(parent: IResource): IResourceParameters
parentIResource 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 stringcallback(arg: PipelineStepContext) => Promise<void> dependsOn string[]optionalrequiredBy string[]optionaltagsstring[]optionaldescriptionstringoptionalReturns
IResource Adds a command to the resource that starts a local process when invoked.
withProcessCommand( commandName: string, displayName: string, options: ProcessCommandExportOptions): IResourceParameters
commandName stringdisplayName stringoptionsProcessCommandExportOptions 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 stringdisplayName stringcreateProcessSpec (arg: ExecuteCommandContext) => Promise<ProcessCommandSpecExportData> optionsProcessCommandResultExportOptions optionalReturns
IResource Adds a relationship to another resource using its builder.
withRelationship( resourceBuilder: IResource, type: string): IResourceParameters
resourceBuilder IResource typestringReturns
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
commandstringhelpLink stringoptionalReturns
IResource Declares that a resource requires a specific command/executable to be available on the local machine PATH before it can start, with custom validation logic.
withRequiredCommandValidation(command: string, validationCallback: (arg: RequiredCommandValidationContext) => Promise<RequiredCommandValidationResult>, helpLink?: string): IResourceParameters
commandstringvalidationCallback (arg: RequiredCommandValidationContext) => Promise<RequiredCommandValidationResult> helpLink stringoptionalReturns
IResource Configures a resource to use a session lifetime.
withSessionLifetime(): IResourceReturns
IResource Adds an interactive terminal session to a resource using the default terminal options.
withTerminal(): IResourceReturns
IResource Adds or modifies displayed URLs
withUrl( url: string | ReferenceExpression, displayText?: string): IResourceParameters
urlstring | ReferenceExpression displayText stringoptionalReturns
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 stringcallback(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