Skip to content
Docs Try Aspire
Docs Try

PostgresServerResource

Handle
📦 Aspire.Hosting.PostgreSQL v13.4.0
interface PostgresServerResource
extends IComputeResource,
IExpressionValue,
IManifestExpressionProvider,
IResource,
IResourceWithArgs,
IResourceWithConnectionString,
IResourceWithEndpoints,
IResourceWithEnvironment,
IResourceWithProbes,
IResourceWithWaitSupport,
IValueProvider,
IValueWithReferences {
readonly connectionStringExpression: ReferenceExpression;
readonly databases: Dict<string,string>;
readonly host: EndpointReferenceExpression;
readonly jdbcConnectionString: ReferenceExpression;
passwordParameter: ParameterResource;
readonly port: EndpointReferenceExpression;
readonly primaryEndpoint: EndpointReference;
readonly uriExpression: ReferenceExpression;
userNameParameter: ParameterResource;
readonly userNameReference: ReferenceExpression;
addDatabase(
name: string,
databaseName?: string): PostgresDatabaseResource;
withDataBindMount(
source: string,
isReadOnly?: boolean): PostgresServerResource;
withDataVolume(
name?: string,
isReadOnly?: boolean): PostgresServerResource;
withHostPort(port: number): PostgresServerResource;
withInitFiles(source: string): PostgresServerResource;
withPassword(password: ParameterResource): PostgresServerResource;
withPgAdmin(configureContainer?: (obj: PgAdminContainerResource) => Promise<void>, containerName?: string): PostgresServerResource;
withPgWeb(configureContainer?: (obj: PgWebContainerResource) => Promise<void>, containerName?: string): PostgresServerResource;
withUserName(userName: ParameterResource): PostgresServerResource;
}

Properties

property connectionStringExpression ReferenceExpression get
Gets the connection string expression for the PostgreSQL server.
property databases Dict<string,string> get
A dictionary where the key is the resource name and the value is the database name.
property host EndpointReferenceExpression get
Gets the host endpoint reference for this service.
property jdbcConnectionString ReferenceExpression get
Gets the JDBC connection string for the PostgreSQL server.
property passwordParameter ParameterResource get · set
Gets or sets the parameter that contains the PostgreSQL server password.
property port EndpointReferenceExpression get
Gets the endpoint reference expression that identifies the port for this endpoint.
property primaryEndpoint EndpointReference get
Gets the primary endpoint for the PostgreSQL server.
property uriExpression ReferenceExpression get
Gets the connection URI expression for the PostgreSQL server.
property userNameParameter ParameterResource get · set
Gets or sets the parameter that contains the PostgreSQL server user name.
property userNameReference ReferenceExpression get
Gets a reference to the user name for the PostgreSQL server.

Methods

method addDatabase builder
Adds a PostgreSQL database to the application model.
addDatabase(
name: string,
databaseName?: string): PostgresDatabaseResource
name string
databaseName string optional
PostgresDatabaseResource
method withDataBindMount builder
Adds a bind mount for the data folder to a PostgreSQL container resource.
withDataBindMount(
source: string,
isReadOnly?: boolean): PostgresServerResource
source string
isReadOnly boolean optional = False
PostgresServerResource
method withDataVolume builder
Adds a named volume for the data folder to a PostgreSQL container resource.
withDataVolume(
name?: string,
isReadOnly?: boolean): PostgresServerResource
name string optional
isReadOnly boolean optional = False
PostgresServerResource
method withHostPort builder
Configures the host port that the PostgreSQL resource is exposed on instead of using randomly assigned port.
withHostPort(port: number): PostgresServerResource
port number
PostgresServerResource
method withInitFiles builder
Copies init files to a PostgreSQL container resource.
withInitFiles(source: string): PostgresServerResource
source string
PostgresServerResource
method withPassword builder
Configures the password that the PostgreSQL resource is used.
withPassword(password: ParameterResource): PostgresServerResource
password ParameterResource
PostgresServerResource
method withPgAdmin builder
Adds a pgAdmin 4 administration and development platform for PostgreSQL to the application model.
withPgAdmin(configureContainer?: (obj: PgAdminContainerResource) => Promise<void>, containerName?: string): PostgresServerResource
configureContainer (obj: PgAdminContainerResource) => Promise<void> optional
containerName string optional
PostgresServerResource
method withPgWeb builder
Adds an administration and development platform for PostgreSQL to the application model using pgweb.
withPgWeb(configureContainer?: (obj: PgWebContainerResource) => Promise<void>, containerName?: string): PostgresServerResource
configureContainer (obj: PgWebContainerResource) => Promise<void> optional
containerName string optional
PostgresServerResource
method withUserName builder
Configures the user name that the PostgreSQL resource is used.
withUserName(userName: ParameterResource): PostgresServerResource
userName ParameterResource
PostgresServerResource