Resource
Represents a resource that can be hosted by an application.
type Resource interface{}Methods
A marker interface declares no methods of its own in Go. Its functions are declared on the concrete types they apply to.
CreateExecutionConfiguration() ExecutionConfigurationBuilderReturns
ExecutionConfigurationBuilder The execution configuration builder.
Returns a handle; failures surface later via Err().
ExcludeFromManifest() ResourceReturns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
ExcludeFromMcp() ResourceReturns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
GetResourceName GetResourceName() (string, error)Returns
(string, error) The resource name.
Returns (string, error).
GetSerializedAnnotation GetSerializedAnnotation(annotationId string) (string, error)Parameters
annotationId stringThe stable annotation identifier.Returns
(string, error) The serialized JSON payload.
Returns (string, error).
HasSerializedAnnotation HasSerializedAnnotation(annotationId string) (bool, error)Parameters
annotationId stringThe stable annotation identifier.Returns
(bool, error) true if the annotation exists; otherwise, false.
Returns (bool, error).
OnBeforeResourceStarted(callback func(arg BeforeResourceStartedEvent)) ResourceParameters
callbackfunc(arg BeforeResourceStartedEvent) callbackThe callback to invoke when the event fires.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
OnInitializeResource(callback func(arg InitializeResourceEvent)) ResourceParameters
callbackfunc(arg InitializeResourceEvent) callbackThe callback to invoke when the event fires.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
OnResourceReady(callback func(arg ResourceReadyEvent)) ResourceParameters
callbackfunc(arg ResourceReadyEvent) callbackThe callback to invoke when the event fires.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
OnResourceStopped(callback func(arg ResourceStoppedEvent)) ResourceParameters
callbackfunc(arg ResourceStoppedEvent) callbackThe callback to invoke when the event fires.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
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 func(obj HttpsEndpointUpdateCallbackContext)) ResourceParameters
callbackfunc(obj HttpsEndpointUpdateCallbackContext) callbackThe callback to invoke when HTTPS is enabled. Receives an HttpsEndpointUpdateCallbackContext providing access to the service provider, resource, and application model.Returns
ResourceThe updated resource builder.
Returns a handle; failures surface later via Err().
WithChildRelationship(child Resource) ResourceParameters
childResourceThe child of builder.Returns
ResourceA resource builder.
Returns a handle; failures surface later via Err().
WithCommand( name string, displayName string, executeCommand func(arg ExecuteCommandContext) *ExecuteCommandResult, options ...*WithCommandOptions,) ResourceParameters
namestringThe name of the command. The name uniquely identifies the command.displayName stringThe display name visible in UI.executeCommand func(arg ExecuteCommandContext) *ExecuteCommandResult callbackA callback that is executed when the command is executed. The callback is run inside the Aspire host. The callback result is used to indicate success or failure in the UI.options...*WithCommandOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithCommandOptions argument.
CommandOptions *CommandOptions Optional configuration for the command.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithContainerBuildOptions(callback func(arg ContainerBuildOptionsCallbackContext)) ResourceParameters
callbackfunc(arg ContainerBuildOptionsCallbackContext) callbackAn async callback to configure container build options.Returns
ResourceA reference to the I.
Returns a handle; failures surface later via Err().
WithContainerRegistry(registry Resource) ResourceParameters
registryResourceThe container registry resource builder.Returns
ResourceThe resource builder for chaining.
Returns a handle; failures surface later via Err().
WithDisplayOrder(order float64) ResourceParameters
orderfloat64A relative sort key. Higher values appear first, consistent with DisplayOrder . Resources without a display order are treated as having an order of 0, so a negative value moves a resource after them.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithDockerfileBaseImage(options ...*WithDockerfileBaseImageOptions) ResourceParameters
options...*WithDockerfileBaseImageOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithDockerfileBaseImageOptions argument.
BuildImage *stringThe base image to use for the build stage. If null, uses the default build image.RuntimeImage *stringThe base image to use for the runtime stage. If null, uses the default runtime image.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithExplicitStart() ResourceReturns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithHealthCheck(key string) ResourceParameters
keystringThe key for the health check.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithIconName( iconName string, options ...*WithIconNameOptions,) ResourceParameters
iconName stringThe name of the FluentUI icon to use. See https://aka.ms/fluentui-system-icons for available icons.options...*WithIconNameOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithIconNameOptions argument.
IconVariant *IconVariant The variant of the icon (Regular or Filled). Defaults to Filled.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithLifetimeOf(sourceBuilder Resource) ResourceParameters
sourceBuilder ResourceThe resource builder whose lifetime should be used.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithParentProcessLifetime(parentProcessId float64) ResourceParameters
parentProcessId float64The ID of the parent process to monitor.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithParentRelationship(parent Resource) ResourceParameters
parentResourceThe parent of builder.Returns
ResourceA resource builder.
Returns a handle; failures surface later via Err().
WithPersistentLifetime() ResourceReturns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithPipelineConfiguration(callback func(obj PipelineConfigurationContext)) ResourceParameters
callbackfunc(obj PipelineConfigurationContext) callbackThe callback function to execute during the configuration phase.Returns
ResourceThe resource builder for chaining.
Returns a handle; failures surface later via Err().
WithPipelineStepFactory( stepName string, callback func(arg PipelineStepContext), options ...*WithPipelineStepFactoryOptions,) ResourceParameters
stepName stringThe unique name of the pipeline step.callbackfunc(arg PipelineStepContext) callbackThe callback to execute when the step runs.options...*WithPipelineStepFactoryOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithPipelineStepFactoryOptions argument.
DependsOn []string Optional step names that this step depends on.RequiredBy []string Optional step names that require this step.Tags[]string Optional tags that categorize this step.Description*stringAn optional human-readable description of the step.Returns
ResourceThe resource builder for chaining.
Returns a handle; failures surface later via Err().
WithProcessCommand( commandName string, displayName string, options *ProcessCommandExportOptions,) ResourceParameters
commandName stringdisplayName stringoptions*ProcessCommandExportOptions Returns
ResourceReturns a handle; failures surface later via Err().
WithProcessCommandFactory( commandName string, displayName string, createProcessSpec func(arg ExecuteCommandContext) *ProcessCommandSpecExportData, options ...*ProcessCommandResultExportOptions,) ResourceParameters
commandName stringdisplayName stringcreateProcessSpec func(arg ExecuteCommandContext) *ProcessCommandSpecExportData callbackoptions...*ProcessCommandResultExportOptions Optional settings, described under Options.Options
Optional parameters are passed as the existing *ProcessCommandResultExportOptions struct.
Returns
ResourceReturns a handle; failures surface later via Err().
WithRelationship( resourceBuilder Resource, type_ string,) ResourceParameters
resourceBuilder ResourceThe resource builder that the relationship is to.type_stringThe relationship type.Returns
ResourceA resource builder.
Returns a handle; failures surface later via Err().
WithRequiredCommand( command string, options ...*WithRequiredCommandOptions,) ResourceParameters
commandstringThe command string (file name or path) that should be validated.options...*WithRequiredCommandOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithRequiredCommandOptions argument.
HelpLink *stringAn optional help link URL to guide users when the command is missing.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithRequiredCommandValidation( command string, validationCallback func(arg RequiredCommandValidationContext) RequiredCommandValidationResult, options ...*WithRequiredCommandValidationOptions,) ResourceParameters
commandstringThe command string (file name or path) that should be validated.validationCallback func(arg RequiredCommandValidationContext) RequiredCommandValidationResult callbackA callback that validates the resolved command path. Receives a RequiredCommandValidationContext and returns a RequiredCommandValidationResult .options...*WithRequiredCommandValidationOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithRequiredCommandValidationOptions argument.
HelpLink *stringAn optional help link URL to guide users when the command is missing or fails validation.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithResourceTypeDisplayName(resourceTypeDisplayName string) ResourceParameters
resourceTypeDisplayName stringThe type label, such as Redis or PostgreSQL Server.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithSerializedAnnotation WithSerializedAnnotation( annotationId string, json string,) ResourceParameters
annotationId stringThe stable annotation identifier.jsonstringThe serialized JSON payload.Returns
ResourceThe resource.
Returns a handle; failures surface later via Err().
WithSessionLifetime() ResourceReturns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithTerminal(options ...*WithTerminalOptions) ResourceParameters
options...*WithTerminalOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithTerminalOptions argument.
Configurefunc(obj *TerminalOptions) callbackAn optional callback to configure the terminal options.Returns
ResourceA reference to the I for chaining additional configuration.
Returns a handle; failures surface later via Err().
WithTrait( name string, value string,) ResourceParameters
namestringThe case-sensitive trait name.valuestringThe trait value. Do not include secrets.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithUrl( url any, options ...*WithUrlOptions,) ResourceParameters
urlanyoptions...*WithUrlOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithUrlOptions argument.
DisplayText *stringReturns
ResourceReturns a handle; failures surface later via Err().
WithUrlForEndpoint( endpointName string, callback func(obj *ResourceUrlAnnotation),) ResourceParameters
endpointName stringThe name of the endpoint to customize the URL for.callbackfunc(obj *ResourceUrlAnnotation) callbackThe callback that will customize the URL.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
WithUrls(callback func(obj ResourceUrlsCallbackContext)) ResourceParameters
callbackfunc(obj ResourceUrlsCallbackContext) callbackThe callback that will customize URLs for the resource.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
Applies to
This interface applies to the following types: