Skip to content

Commit

Permalink
Ensure that depedent APIs are enabled during Backend creation flow. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
taeold authored Dec 7, 2023
1 parent 2d03226 commit 2a453ae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/init/features/frameworks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { API_VERSION } from "../../../gcp/frameworks";
import { FirebaseError } from "../../../error";
import { promptOnce } from "../../../prompt";
import { DEFAULT_REGION, ALLOWED_REGIONS } from "./constants";
import { ensure } from "../../../ensureApiEnabled";

const frameworksPollerOptions: Omit<poller.OperationPollerOptions, "operationResourceName"> = {
apiOrigin: frameworksOrigin,
Expand All @@ -24,6 +25,13 @@ const frameworksPollerOptions: Omit<poller.OperationPollerOptions, "operationRes
export async function doSetup(setup: any, projectId: string): Promise<void> {
setup.frameworks = {};

await Promise.all([
ensure(projectId, "cloudbuild.googleapis.com", "frameworks", true),
ensure(projectId, "secretmanager.googleapis.com", "frameworks", true),
ensure(projectId, "run.googleapis.com", "frameworks", true),
ensure(projectId, "artifactregistry.googleapis.com", "frameworks", true),
]);

logBullet("First we need a few details to create your backend.");

const location = await promptOnce({
Expand Down

0 comments on commit 2a453ae

Please sign in to comment.