Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ResourceWithEnvironment

Interfacemarker
📦 Aspire.Hosting v17.0.0

Represents a resource that is associated with an environment.

type ResourceWithEnvironment interface{}

Methods

A marker interface declares no methods of its own in Go. Its functions are declared on the concrete types they apply to.

Sets the certificate trust scope
WithCertificateTrustScope(scope CertificateTrustScope) ResourceWithEnvironment
scopeCertificateTrustScopeThe scope to apply to custom certificate authorities associated with the resource.
ResourceWithEnvironment

The resource builder.

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

Indicates whether developer certificates should be treated as trusted certificate authorities for the resource at run time. Currently this indicates trust for the ASP.NET Core developer certificate. The developer certificate will only be trusted when running in local development scenarios; in publish mode resources will use their default certificate trust.
WithDeveloperCertificateTrust(trust bool) ResourceWithEnvironment
trustboolIndicates whether the developer certificate should be treated as trusted.
ResourceWithEnvironment

The resource builder.

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

methodWithEnvironmentbuilder
Sets an environment variable
WithEnvironment(
name string,
value any,
) ResourceWithEnvironment
namestring
valueany
ResourceWithEnvironment

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

Allows for the population of environment variables on a resource.
WithEnvironmentCallback(callback func(arg EnvironmentCallbackContext)) ResourceWithEnvironment
callbackfunc(arg EnvironmentCallbackContext)callbackA callback that allows for deferred execution for computing many environment variables. This runs after resources have been allocated by the orchestrator and allows access to other resources to resolve computed data, e.g. connection strings, ports.
ResourceWithEnvironment

The resource builder.

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

Adds a callback that allows configuring the resource to use a specific HTTPS/TLS certificate key pair for server authentication.
WithHttpsCertificateConfiguration(callback func(arg HttpsCertificateConfigurationCallbackAnnotationContext)) ResourceWithEnvironment
callbackfunc(arg HttpsCertificateConfigurationCallbackAnnotationContext)callbackThe callback to configure the resource to use a certificate key pair.
ResourceWithEnvironment

The updated resource builder.

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

Indicates that a resource should use the developer certificate key pair for HTTPS endpoints at run time. Currently this indicates use of the ASP.NET Core developer certificate. The developer certificate will only be used when running in local development scenarios; in publish mode resources will use their default certificate configuration.
WithHttpsDeveloperCertificate(options ...*WithHttpsDeveloperCertificateOptions) ResourceWithEnvironment
options...*WithHttpsDeveloperCertificateOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithHttpsDeveloperCertificateOptions argument.

Password*ParameterResourceA parameter specifying the password used to encrypt the certificate private key.
ResourceWithEnvironment

The resource builder.

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

methodWithOtlpExporterbuilder
Configures OTLP telemetry export
WithOtlpExporter(options ...*WithOtlpExporterOptions) ResourceWithEnvironment
options...*WithOtlpExporterOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithOtlpExporterOptions argument.

Protocol*OtlpProtocol
ResourceWithEnvironment

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

Disable HTTPS/TLS server certificate configuration for the resource. No HTTPS/TLS termination configuration will be applied.
WithoutHttpsCertificate() ResourceWithEnvironment
ResourceWithEnvironment

The resource builder.

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

methodWithReferencebuilder
Adds a reference to another resource
WithReference(
source any,
options ...*WithReferenceOptions,
) ResourceWithEnvironment
sourceany
options...*WithReferenceOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithReferenceOptions argument.

ConnectionName*string
Optional*bool
Name*string
ResourceWithEnvironment

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

Configures how information is injected into environment variables when the resource references other resources.
WithReferenceEnvironment(options *ReferenceEnvironmentInjectionOptions) ResourceWithEnvironment
options*ReferenceEnvironmentInjectionOptionsOptions controlling which reference information is emitted.
ResourceWithEnvironment

The resource builder.

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

Applies to

This interface applies to the following types: