import React from "react";
import { defineExtension } from "@webiny/project/defineExtension/index.js";
import { postgresParamsSchema } from "@webiny/project-extensions-aws/extensions/index.js";
import { CoreBeforeDeploy } from "@webiny/project-extensions-aws/extensions/index.js";
import { createPathResolver } from "@webiny/project";
import {
ApiAfterBuild,
DatabaseSetup,
ProjectDecorator
} from "@webiny/project/extensions/index.js";
import { CorePulumi } from "~/pulumi/extensions/CorePulumi.js";
const p = createPathResolver(import.meta.dirname, "Postgres");
/**
* `` in an AWS project: the API runs on an Aurora PostgreSQL Serverless v2
* database the core app creates (`AddCorePostgres`), which reads these params through
* `getPostgresConfigFromExtension`.
*/
export const Postgres = defineExtension({
type: "Infra/Postgres",
tags: { runtimeContext: "project", hosting: "aws" },
description: "Run the API on an Aurora PostgreSQL Serverless v2 database the core app creates.",
paramsSchema: postgresParamsSchema,
render: () => {
return (
<>
{/* Every API function runs the one api bundle: its Postgres entry, with knex + pg. */}
>
);
}
});