From 99ecf7547b5154c64c2eb87cc4abe4746c710382 Mon Sep 17 00:00:00 2001 From: Manuwai Korber Date: Wed, 17 Jan 2024 06:26:28 +0000 Subject: [PATCH] update setup CLI for private website --- cli/magic-create.ts | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/cli/magic-create.ts b/cli/magic-create.ts index cd0f82360..749810d44 100644 --- a/cli/magic-create.ts +++ b/cli/magic-create.ts @@ -57,6 +57,9 @@ const embeddingModels = [ fs.readFileSync("./bin/config.json").toString("utf8") ); options.prefix = config.prefix; + options.privateWebsite = config.privateWebsite; + options.certificate = config.certificate; + options.domain = config.domain; options.bedrockEnable = config.bedrock?.enabled; options.bedrockRegion = config.bedrock?.region; options.bedrockRoleArn = config.bedrock?.roleArn; @@ -113,6 +116,34 @@ async function processCreateOptions(options: any): Promise { initial: options.prefix, askAnswered: false, }, + { + type: "confirm", + name: "privateWebsite", + message: "Do you want to deploy a private website? I.e only accessible in VPC", + initial: + options.privateWebsite || + false, + }, + { + type: "input", + name: "certificate", + message: "ACM certificate ARN", + initial: + options.certificate, + skip(): boolean { + return !(this as any).state.answers.privateWebsite; + }, + }, + { + type: "input", + name: "domain", + message: "Domain for private website", + initial: + options.domain, + skip(): boolean { + return !(this as any).state.answers.privateWebsite; + }, + }, { type: "confirm", name: "bedrockEnable", @@ -312,6 +343,9 @@ async function processCreateOptions(options: any): Promise { // Create the config object const config = { prefix: answers.prefix, + privateWebsite: answers.privateWebsite, + certificate: answers.certificate, + domain: answers.domain, bedrock: answers.bedrockEnable ? { enabled: answers.bedrockEnable,