Skip to content
DocsTry Aspire
DocsTry

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

propertyconnectionStringExpressionReferenceExpressionget
Gets the connection string expression for the PostgreSQL server.
propertydatabasesDict<string,string>get
A dictionary where the key is the resource name and the value is the database name.
propertyhostEndpointReferenceExpressionget
Gets the host endpoint reference for this service.
propertyjdbcConnectionStringReferenceExpressionget
Gets the JDBC connection string for the PostgreSQL server.
propertypasswordParameterParameterResourceget · set
Gets or sets the parameter that contains the PostgreSQL server password.
propertyportEndpointReferenceExpressionget
Gets the endpoint reference expression that identifies the port for this endpoint.
propertyprimaryEndpointEndpointReferenceget
Gets the primary endpoint for the PostgreSQL server.
propertyuriExpressionReferenceExpressionget
Gets the connection URI expression for the PostgreSQL server.
propertyuserNameParameterParameterResourceget · set
Gets or sets the parameter that contains the PostgreSQL server user name.
propertyuserNameReferenceReferenceExpressionget
Gets a reference to the user name for the PostgreSQL server.

Methods

methodaddDatabasebuilder
Adds a PostgreSQL database to the application model.
addDatabase(
name: string,
databaseName?: string): PostgresDatabaseResource
namestring
databaseNamestringoptional
PostgresDatabaseResource
methodwithDataBindMountbuilder
Adds a bind mount for the data folder to a PostgreSQL container resource.
withDataBindMount(
source: string,
isReadOnly?: boolean): PostgresServerResource
sourcestring
isReadOnlybooleanoptional= False
PostgresServerResource
methodwithDataVolumebuilder
Adds a named volume for the data folder to a PostgreSQL container resource.
withDataVolume(
name?: string,
isReadOnly?: boolean): PostgresServerResource
namestringoptional
isReadOnlybooleanoptional= False
PostgresServerResource
methodwithHostPortbuilder
Configures the host port that the PostgreSQL resource is exposed on instead of using randomly assigned port.
withHostPort(port: number): PostgresServerResource
portnumber
PostgresServerResource
methodwithInitFilesbuilder
Copies init files to a PostgreSQL container resource.
withInitFiles(source: string): PostgresServerResource
sourcestring
PostgresServerResource
methodwithPasswordbuilder
Configures the password that the PostgreSQL resource is used.
withPassword(password: ParameterResource): PostgresServerResource
passwordParameterResource
PostgresServerResource
methodwithPgAdminbuilder
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
containerNamestringoptional
PostgresServerResource
methodwithPgWebbuilder
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
containerNamestringoptional
PostgresServerResource
methodwithUserNamebuilder
Configures the user name that the PostgreSQL resource is used.
withUserName(userName: ParameterResource): PostgresServerResource
userNameParameterResource
PostgresServerResource