@quiltdata/benchling-webhook 0.8.7 → 0.8.9-20251130T212657Z
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +110 -0
- package/dist/bin/benchling-webhook.js +6 -0
- package/dist/bin/benchling-webhook.js.map +1 -1
- package/dist/bin/cli.js +37 -2
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/commands/deploy.d.ts +2 -0
- package/dist/bin/commands/deploy.d.ts.map +1 -1
- package/dist/bin/commands/deploy.js +122 -2
- package/dist/bin/commands/deploy.js.map +1 -1
- package/dist/bin/commands/destroy.d.ts +16 -0
- package/dist/bin/commands/destroy.d.ts.map +1 -0
- package/dist/bin/commands/destroy.js +258 -0
- package/dist/bin/commands/destroy.js.map +1 -0
- package/dist/bin/commands/infer-quilt-config.d.ts.map +1 -1
- package/dist/bin/commands/infer-quilt-config.js +13 -8
- package/dist/bin/commands/infer-quilt-config.js.map +1 -1
- package/dist/bin/commands/logs.d.ts.map +1 -1
- package/dist/bin/commands/logs.js +29 -6
- package/dist/bin/commands/logs.js.map +1 -1
- package/dist/bin/commands/setup-profile.d.ts +1 -1
- package/dist/bin/commands/setup-profile.d.ts.map +1 -1
- package/dist/bin/commands/setup-profile.js +46 -1
- package/dist/bin/commands/setup-profile.js.map +1 -1
- package/dist/bin/commands/status.d.ts +17 -0
- package/dist/bin/commands/status.d.ts.map +1 -1
- package/dist/bin/commands/status.js +186 -35
- package/dist/bin/commands/status.js.map +1 -1
- package/dist/bin/commands/sync-secrets.d.ts +1 -1
- package/dist/bin/commands/sync-secrets.js +1 -1
- package/dist/bin/xdg-launch.d.ts +1 -1
- package/dist/bin/xdg-launch.d.ts.map +1 -1
- package/dist/bin/xdg-launch.js +105 -26
- package/dist/bin/xdg-launch.js.map +1 -1
- package/dist/lib/benchling-webhook-stack.d.ts +1 -1
- package/dist/lib/benchling-webhook-stack.d.ts.map +1 -1
- package/dist/lib/benchling-webhook-stack.js +83 -17
- package/dist/lib/benchling-webhook-stack.js.map +1 -1
- package/dist/lib/configuration-saver.d.ts +1 -1
- package/dist/lib/configuration-saver.d.ts.map +1 -1
- package/dist/lib/configuration-saver.js +4 -5
- package/dist/lib/configuration-saver.js.map +1 -1
- package/dist/lib/constants.d.ts +5 -0
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +6 -1
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/fargate-service.d.ts +4 -5
- package/dist/lib/fargate-service.d.ts.map +1 -1
- package/dist/lib/fargate-service.js +14 -59
- package/dist/lib/fargate-service.js.map +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +3 -3
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/network-load-balancer.d.ts +27 -0
- package/dist/lib/network-load-balancer.d.ts.map +1 -0
- package/dist/lib/network-load-balancer.js +109 -0
- package/dist/lib/network-load-balancer.js.map +1 -0
- package/dist/lib/rest-api-gateway.d.ts +22 -0
- package/dist/lib/rest-api-gateway.d.ts.map +1 -0
- package/dist/lib/rest-api-gateway.js +221 -0
- package/dist/lib/rest-api-gateway.js.map +1 -0
- package/dist/lib/types/config.d.ts +53 -8
- package/dist/lib/types/config.d.ts.map +1 -1
- package/dist/lib/types/config.js +1 -1
- package/dist/lib/types/config.js.map +1 -1
- package/dist/lib/utils/service-resolver.d.ts +1 -1
- package/dist/lib/utils/service-resolver.js +1 -1
- package/dist/lib/wizard/phase2-stack-query.d.ts.map +1 -1
- package/dist/lib/wizard/phase2-stack-query.js +57 -14
- package/dist/lib/wizard/phase2-stack-query.js.map +1 -1
- package/dist/lib/wizard/phase3-parameter-collection.d.ts.map +1 -1
- package/dist/lib/wizard/phase3-parameter-collection.js +55 -1
- package/dist/lib/wizard/phase3-parameter-collection.js.map +1 -1
- package/dist/lib/wizard/phase6-integrated-mode.d.ts.map +1 -1
- package/dist/lib/wizard/phase6-integrated-mode.js +3 -1
- package/dist/lib/wizard/phase6-integrated-mode.js.map +1 -1
- package/dist/lib/wizard/phase7-standalone-mode.d.ts.map +1 -1
- package/dist/lib/wizard/phase7-standalone-mode.js +3 -1
- package/dist/lib/wizard/phase7-standalone-mode.js.map +1 -1
- package/dist/lib/wizard/types.d.ts +24 -0
- package/dist/lib/wizard/types.d.ts.map +1 -1
- package/dist/lib/xdg-base.d.ts +17 -1
- package/dist/lib/xdg-base.d.ts.map +1 -1
- package/dist/lib/xdg-base.js +30 -1
- package/dist/lib/xdg-base.js.map +1 -1
- package/dist/lib/xdg-config.d.ts +1 -1
- package/dist/lib/xdg-config.js +1 -1
- package/dist/package.json +7 -4
- package/dist/scripts/discover-vpc.d.ts +69 -0
- package/dist/scripts/discover-vpc.d.ts.map +1 -0
- package/dist/scripts/discover-vpc.js +196 -0
- package/dist/scripts/discover-vpc.js.map +1 -0
- package/package.json +7 -4
- package/dist/lib/alb-api-gateway.d.ts +0 -23
- package/dist/lib/alb-api-gateway.d.ts.map +0 -1
- package/dist/lib/alb-api-gateway.js +0 -211
- package/dist/lib/alb-api-gateway.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Setup Profile Command
|
|
3
|
+
* Setup Profile Command
|
|
4
4
|
*
|
|
5
5
|
* Creates a new profile for multi-environment deployment with support for
|
|
6
6
|
* profile inheritance. Profiles enable separate configurations for dev,
|
|
@@ -114,6 +114,12 @@ async function setupProfileCommand(profileName, options) {
|
|
|
114
114
|
message: "Use a different Secrets Manager ARN for this profile?",
|
|
115
115
|
default: false,
|
|
116
116
|
},
|
|
117
|
+
{
|
|
118
|
+
type: "confirm",
|
|
119
|
+
name: "customizeVpc",
|
|
120
|
+
message: "Specify an existing VPC (or auto-create)?",
|
|
121
|
+
default: false,
|
|
122
|
+
},
|
|
117
123
|
]);
|
|
118
124
|
// Optionally prompt for custom Quilt stack ARN
|
|
119
125
|
let quiltStackArn = baseConfig.quilt.stackArn;
|
|
@@ -157,6 +163,43 @@ async function setupProfileCommand(profileName, options) {
|
|
|
157
163
|
]);
|
|
158
164
|
secretArn = secretAnswer.secretArn;
|
|
159
165
|
}
|
|
166
|
+
// Optionally prompt for VPC ID
|
|
167
|
+
let vpcId;
|
|
168
|
+
if (answers.customizeVpc) {
|
|
169
|
+
const vpcAnswer = await inquirer_1.default.prompt([
|
|
170
|
+
{
|
|
171
|
+
type: "input",
|
|
172
|
+
name: "vpcId",
|
|
173
|
+
message: "VPC ID (leave empty to auto-create VPC with private subnets):",
|
|
174
|
+
default: baseConfig.deployment.vpc?.vpcId || "",
|
|
175
|
+
validate: (input) => {
|
|
176
|
+
if (!input || input.trim().length === 0) {
|
|
177
|
+
return true; // Empty is OK - will auto-create VPC
|
|
178
|
+
}
|
|
179
|
+
if (!/^vpc-[a-f0-9]{8,17}$/.test(input)) {
|
|
180
|
+
return "Invalid VPC ID format (expected vpc-xxxxxxxx)";
|
|
181
|
+
}
|
|
182
|
+
return true;
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
]);
|
|
186
|
+
vpcId = vpcAnswer.vpcId.trim() || undefined;
|
|
187
|
+
// If VPC ID was provided, show a warning about requirements
|
|
188
|
+
if (vpcId) {
|
|
189
|
+
console.log(chalk_1.default.yellow("\n⚠️ VPC Requirements:"));
|
|
190
|
+
console.log(chalk_1.default.dim(" - Must have private subnets in at least 2 availability zones"));
|
|
191
|
+
console.log(chalk_1.default.dim(" - Private subnets must have NAT Gateway for outbound internet"));
|
|
192
|
+
console.log(chalk_1.default.dim(" - VPC Link requires proper routing configuration"));
|
|
193
|
+
console.log(chalk_1.default.dim(" - Deployment will fail if VPC doesn't meet these requirements\n"));
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
console.log(chalk_1.default.green("\n✓ Will auto-create VPC with:"));
|
|
197
|
+
console.log(chalk_1.default.dim(" - 2 Availability Zones"));
|
|
198
|
+
console.log(chalk_1.default.dim(" - Public subnets (for NAT Gateways)"));
|
|
199
|
+
console.log(chalk_1.default.dim(" - Private subnets (for ECS tasks)"));
|
|
200
|
+
console.log(chalk_1.default.dim(" - 2 NAT Gateways (~$64/month)\n"));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
160
203
|
// Create profile config
|
|
161
204
|
const profileConfig = {
|
|
162
205
|
quilt: {
|
|
@@ -174,6 +217,7 @@ async function setupProfileCommand(profileName, options) {
|
|
|
174
217
|
deployment: {
|
|
175
218
|
...baseConfig.deployment,
|
|
176
219
|
imageTag: answers.imageTag,
|
|
220
|
+
vpc: vpcId ? { vpcId } : baseConfig.deployment.vpc,
|
|
177
221
|
},
|
|
178
222
|
logging: baseConfig.logging,
|
|
179
223
|
security: baseConfig.security,
|
|
@@ -209,6 +253,7 @@ async function setupProfileCommand(profileName, options) {
|
|
|
209
253
|
console.log(chalk_1.default.dim(` Image Tag: ${profileConfig.deployment.imageTag}`));
|
|
210
254
|
console.log(chalk_1.default.dim(` Secret ARN: ${profileConfig.benchling.secretArn}`));
|
|
211
255
|
console.log(chalk_1.default.dim(` Quilt Stack: ${profileConfig.quilt.stackArn}`));
|
|
256
|
+
console.log(chalk_1.default.dim(` VPC: ${profileConfig.deployment.vpc?.vpcId || "auto-create"}`));
|
|
212
257
|
console.log();
|
|
213
258
|
}
|
|
214
259
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-profile.js","sourceRoot":"","sources":["../../../bin/commands/setup-profile.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;AAqBH,
|
|
1
|
+
{"version":3,"file":"setup-profile.js","sourceRoot":"","sources":["../../../bin/commands/setup-profile.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;AAqBH,kDAyQC;AA5RD,kDAA0B;AAC1B,wDAAgC;AAChC,qDAAiD;AAGjD;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,mBAAmB,CACrC,WAAmB,EACnB,OAGC;IAED,OAAO,CAAC,GAAG,CA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,CAAC,CAAC,CAAC;QACzF,OAAO,CAAC,GAAG,EAAE,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,yCAA0C,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;AACL,CAAC"}
|
|
@@ -31,6 +31,7 @@ export interface StatusResult {
|
|
|
31
31
|
region?: string;
|
|
32
32
|
error?: string;
|
|
33
33
|
stackOutputs?: {
|
|
34
|
+
webhookEndpoint?: string;
|
|
34
35
|
benchlingUrl?: string;
|
|
35
36
|
secretArn?: string;
|
|
36
37
|
dockerImage?: string;
|
|
@@ -76,6 +77,22 @@ export interface StatusResult {
|
|
|
76
77
|
reason?: string;
|
|
77
78
|
}>;
|
|
78
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Stack identification result
|
|
82
|
+
* Determines which CloudFormation stack to query based on profile configuration
|
|
83
|
+
*/
|
|
84
|
+
export interface StackIdentification {
|
|
85
|
+
/** Full stack ARN if available (null for standalone until resolved) */
|
|
86
|
+
stackArn: string | null;
|
|
87
|
+
/** Stack name for CloudFormation queries */
|
|
88
|
+
stackName: string;
|
|
89
|
+
/** AWS region */
|
|
90
|
+
region: string;
|
|
91
|
+
/** Deployment mode */
|
|
92
|
+
mode: "integrated" | "standalone";
|
|
93
|
+
/** Whether deployment tracking exists */
|
|
94
|
+
hasDeployment: boolean;
|
|
95
|
+
}
|
|
79
96
|
/**
|
|
80
97
|
* Formats stack status with color coding
|
|
81
98
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../bin/commands/status.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAUH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACjC,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,UAAU,CAAC,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AE,EAAE,MAAM,CAAC;YACX,MAAM,EAAE,MAAM,CAAC;YACf,MAAM,CAAC,EAAE,MAAM,CAAC;SACnB,CAAC,CAAC;KACN,CAAC,CAAC;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;QAChB,SAAS,EAAE,IAAI,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;CACN;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,uEAAuE;IACvE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,IAAI,EAAE,YAAY,GAAG,YAAY,CAAC;IAClC,yCAAyC;IACzC,aAAa,EAAE,OAAO,CAAC;CAC1B;AA8MD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAYxD;AAstBD;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CA2H7F"}
|
|
@@ -22,38 +22,114 @@ const client_elastic_load_balancing_v2_1 = require("@aws-sdk/client-elastic-load
|
|
|
22
22
|
const client_secrets_manager_1 = require("@aws-sdk/client-secrets-manager");
|
|
23
23
|
const credential_providers_1 = require("@aws-sdk/credential-providers");
|
|
24
24
|
const xdg_config_1 = require("../../lib/xdg-config");
|
|
25
|
+
/**
|
|
26
|
+
* Identifies which stack to query based on profile configuration
|
|
27
|
+
*
|
|
28
|
+
* For integrated stacks: queries the Quilt stack (config.quilt.stackArn)
|
|
29
|
+
* For standalone stacks: queries the BenchlingWebhookStack from deployment tracking
|
|
30
|
+
*
|
|
31
|
+
* @param config - Profile configuration
|
|
32
|
+
* @param xdg - XDG configuration storage
|
|
33
|
+
* @param profile - Profile name
|
|
34
|
+
* @returns Stack identification with ARN, name, region, and mode
|
|
35
|
+
* @throws Error if configuration is incomplete or deployment is missing
|
|
36
|
+
*/
|
|
37
|
+
function identifyTargetStack(config, xdg, profile) {
|
|
38
|
+
// Handle undefined integratedStack (legacy configs)
|
|
39
|
+
let isIntegrated = config.integratedStack === true;
|
|
40
|
+
if (config.integratedStack === undefined) {
|
|
41
|
+
// Legacy config - default to integrated and warn
|
|
42
|
+
console.warn(chalk_1.default.yellow("⚠️ Configuration is missing 'integratedStack' field.\n" +
|
|
43
|
+
" Defaulting to integrated mode.\n" +
|
|
44
|
+
" Run 'npm run setup' to update configuration.\n"));
|
|
45
|
+
isIntegrated = true;
|
|
46
|
+
}
|
|
47
|
+
if (isIntegrated) {
|
|
48
|
+
// Integrated: Query Quilt stack
|
|
49
|
+
const stackArn = config.quilt.stackArn;
|
|
50
|
+
if (!stackArn) {
|
|
51
|
+
throw new Error("Integrated mode requires quilt.stackArn in configuration.\n\n" +
|
|
52
|
+
"Run setup to configure the Quilt stack ARN:\n" +
|
|
53
|
+
` npm run setup -- --profile ${profile}`);
|
|
54
|
+
}
|
|
55
|
+
const stackName = stackArn.match(/stack\/([^/]+)\//)?.[1] || stackArn;
|
|
56
|
+
const region = config.deployment.region || config.quilt.region;
|
|
57
|
+
return {
|
|
58
|
+
stackArn,
|
|
59
|
+
stackName,
|
|
60
|
+
region,
|
|
61
|
+
mode: "integrated",
|
|
62
|
+
hasDeployment: false,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// Standalone: Query BenchlingWebhookStack from deployments
|
|
67
|
+
const deployments = xdg.getDeployments(profile);
|
|
68
|
+
// Find any active deployment (prefer prod, then dev, then any)
|
|
69
|
+
const stages = ["prod", "dev", ...Object.keys(deployments.active)];
|
|
70
|
+
let activeDeployment = null;
|
|
71
|
+
for (const stage of stages) {
|
|
72
|
+
if (deployments.active[stage]) {
|
|
73
|
+
activeDeployment = deployments.active[stage];
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (!activeDeployment) {
|
|
78
|
+
throw new Error("No active deployments found for standalone stack.\n\n" +
|
|
79
|
+
"This profile is configured for standalone mode but has no deployed stack.\n" +
|
|
80
|
+
"Deploy the stack first with:\n" +
|
|
81
|
+
` npm run deploy -- --profile ${profile}`);
|
|
82
|
+
}
|
|
83
|
+
// Use deployment tracking info
|
|
84
|
+
const stackName = activeDeployment.stackName; // "BenchlingWebhookStack"
|
|
85
|
+
const region = activeDeployment.region;
|
|
86
|
+
return {
|
|
87
|
+
stackArn: null, // Will be resolved from CloudFormation query
|
|
88
|
+
stackName, // "BenchlingWebhookStack"
|
|
89
|
+
region,
|
|
90
|
+
mode: "standalone",
|
|
91
|
+
hasDeployment: true,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
25
95
|
/**
|
|
26
96
|
* Gets stack status from CloudFormation
|
|
97
|
+
*
|
|
98
|
+
* @param stackName - Stack name or ARN to query
|
|
99
|
+
* @param region - AWS region
|
|
100
|
+
* @param mode - Deployment mode (integrated or standalone)
|
|
101
|
+
* @param awsProfile - AWS profile to use
|
|
27
102
|
*/
|
|
28
|
-
async function getStackStatus(
|
|
103
|
+
async function getStackStatus(stackName, region, mode, awsProfile) {
|
|
29
104
|
try {
|
|
30
|
-
// Extract stack name from ARN
|
|
31
|
-
const stackNameMatch = stackArn.match(/stack\/([^/]+)\//);
|
|
32
|
-
if (!stackNameMatch) {
|
|
33
|
-
throw new Error(`Invalid stack ARN format: ${stackArn}`);
|
|
34
|
-
}
|
|
35
|
-
const stackName = stackNameMatch[1];
|
|
36
105
|
// Configure AWS SDK client
|
|
37
106
|
const clientConfig = { region };
|
|
38
107
|
if (awsProfile) {
|
|
39
108
|
clientConfig.credentials = (0, credential_providers_1.fromIni)({ profile: awsProfile });
|
|
40
109
|
}
|
|
41
110
|
const client = new client_cloudformation_1.CloudFormationClient(clientConfig);
|
|
42
|
-
// Describe stack
|
|
111
|
+
// Describe stack (works with both ARN and name)
|
|
43
112
|
const command = new client_cloudformation_1.DescribeStacksCommand({
|
|
44
113
|
StackName: stackName,
|
|
45
114
|
});
|
|
46
115
|
const response = await client.send(command);
|
|
47
116
|
const stack = response.Stacks?.[0];
|
|
48
117
|
if (!stack) {
|
|
49
|
-
|
|
118
|
+
const helpText = mode === "integrated"
|
|
119
|
+
? "Verify that the Quilt stack exists and is deployed."
|
|
120
|
+
: "Verify that the BenchlingWebhookStack has been deployed. Run: npm run deploy";
|
|
121
|
+
throw new Error(`Stack not found: ${stackName}\n\n${helpText}`);
|
|
122
|
+
}
|
|
123
|
+
// Extract BenchlingIntegration parameter (ONLY for integrated mode)
|
|
124
|
+
let benchlingIntegrationEnabled;
|
|
125
|
+
if (mode === "integrated") {
|
|
126
|
+
const param = stack.Parameters?.find((p) => p.ParameterKey === "BenchlingIntegration");
|
|
127
|
+
benchlingIntegrationEnabled = param?.ParameterValue === "Enabled";
|
|
50
128
|
}
|
|
51
|
-
// Extract BenchlingIntegration parameter
|
|
52
|
-
const param = stack.Parameters?.find((p) => p.ParameterKey === "BenchlingIntegration");
|
|
53
|
-
const benchlingIntegrationEnabled = param?.ParameterValue === "Enabled";
|
|
54
129
|
// Extract stack outputs
|
|
55
130
|
const outputs = stack.Outputs || [];
|
|
56
131
|
const stackOutputs = {
|
|
132
|
+
webhookEndpoint: outputs.find((o) => o.OutputKey === "WebhookEndpoint")?.OutputValue,
|
|
57
133
|
benchlingUrl: outputs.find((o) => o.OutputKey === "BenchlingUrl")?.OutputValue,
|
|
58
134
|
secretArn: outputs.find((o) => o.OutputKey === "BenchlingSecretArn" || o.OutputKey === "BenchlingClientSecretArn" || o.OutputKey === "SecretArn")?.OutputValue,
|
|
59
135
|
dockerImage: outputs.find((o) => o.OutputKey === "BenchlingDockerImage" || o.OutputKey === "DockerImage")?.OutputValue,
|
|
@@ -63,18 +139,54 @@ async function getStackStatus(stackArn, region, awsProfile) {
|
|
|
63
139
|
return {
|
|
64
140
|
success: true,
|
|
65
141
|
stackStatus: stack.StackStatus,
|
|
66
|
-
benchlingIntegrationEnabled,
|
|
142
|
+
benchlingIntegrationEnabled, // undefined for standalone
|
|
67
143
|
lastUpdateTime: stack.LastUpdatedTime?.toISOString() || stack.CreationTime?.toISOString(),
|
|
68
|
-
stackArn,
|
|
144
|
+
stackArn: stack.StackId, // Use actual ARN from response
|
|
69
145
|
region,
|
|
70
146
|
stackOutputs,
|
|
71
147
|
};
|
|
72
148
|
}
|
|
73
149
|
catch (error) {
|
|
150
|
+
const errorMessage = error.message;
|
|
151
|
+
// Check if stack was deleted (DELETE_COMPLETE status)
|
|
152
|
+
// DescribeStacksCommand throws "does not exist" for deleted stacks
|
|
153
|
+
// We need to check ListStacks to differentiate between never-existed and deleted
|
|
154
|
+
if (errorMessage.includes("does not exist")) {
|
|
155
|
+
try {
|
|
156
|
+
// Configure AWS SDK client for ListStacks
|
|
157
|
+
const clientConfig = { region };
|
|
158
|
+
if (awsProfile) {
|
|
159
|
+
clientConfig.credentials = (0, credential_providers_1.fromIni)({ profile: awsProfile });
|
|
160
|
+
}
|
|
161
|
+
const listClient = new client_cloudformation_1.CloudFormationClient(clientConfig);
|
|
162
|
+
// Query ListStacks to check if stack was deleted
|
|
163
|
+
const listCommand = new client_cloudformation_1.ListStacksCommand({
|
|
164
|
+
StackStatusFilter: ["DELETE_COMPLETE"],
|
|
165
|
+
});
|
|
166
|
+
const listResponse = await listClient.send(listCommand);
|
|
167
|
+
// Find the stack in deleted stacks
|
|
168
|
+
const deletedStack = listResponse.StackSummaries?.find((summary) => summary.StackName === stackName);
|
|
169
|
+
if (deletedStack) {
|
|
170
|
+
// Stack was deleted - return success with DELETE_COMPLETE status
|
|
171
|
+
return {
|
|
172
|
+
success: true,
|
|
173
|
+
stackStatus: "DELETE_COMPLETE",
|
|
174
|
+
lastUpdateTime: deletedStack.DeletionTime?.toISOString() || deletedStack.LastUpdatedTime?.toISOString(),
|
|
175
|
+
stackArn: deletedStack.StackId,
|
|
176
|
+
region,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
catch (listError) {
|
|
181
|
+
// ListStacks failed - fall through to original error handling
|
|
182
|
+
console.error(chalk_1.default.dim(` Could not check deleted stacks: ${listError.message}`));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// Stack truly doesn't exist or other error occurred
|
|
74
186
|
return {
|
|
75
187
|
success: false,
|
|
76
|
-
error:
|
|
77
|
-
stackArn,
|
|
188
|
+
error: errorMessage,
|
|
189
|
+
stackArn: stackName,
|
|
78
190
|
region,
|
|
79
191
|
};
|
|
80
192
|
}
|
|
@@ -83,7 +195,10 @@ async function getStackStatus(stackArn, region, awsProfile) {
|
|
|
83
195
|
* Formats stack status with color coding
|
|
84
196
|
*/
|
|
85
197
|
function formatStackStatus(status) {
|
|
86
|
-
if (status
|
|
198
|
+
if (status === "DELETE_COMPLETE") {
|
|
199
|
+
return chalk_1.default.red(status);
|
|
200
|
+
}
|
|
201
|
+
else if (status.includes("COMPLETE") && !status.includes("ROLLBACK")) {
|
|
87
202
|
return chalk_1.default.green(status);
|
|
88
203
|
}
|
|
89
204
|
else if (status.includes("IN_PROGRESS")) {
|
|
@@ -399,9 +514,14 @@ async function getListenerRules(stackName, region, awsProfile) {
|
|
|
399
514
|
}
|
|
400
515
|
/**
|
|
401
516
|
* Fetches complete status including all health checks
|
|
517
|
+
*
|
|
518
|
+
* @param stackName - Stack name to query
|
|
519
|
+
* @param region - AWS region
|
|
520
|
+
* @param mode - Deployment mode (integrated or standalone)
|
|
521
|
+
* @param awsProfile - AWS profile to use
|
|
402
522
|
*/
|
|
403
|
-
async function fetchCompleteStatus(
|
|
404
|
-
const result = await getStackStatus(
|
|
523
|
+
async function fetchCompleteStatus(stackName, region, mode, awsProfile) {
|
|
524
|
+
const result = await getStackStatus(stackName, region, mode, awsProfile);
|
|
405
525
|
if (!result.success) {
|
|
406
526
|
return result;
|
|
407
527
|
}
|
|
@@ -423,9 +543,14 @@ async function fetchCompleteStatus(stackArn, stackName, region, awsProfile) {
|
|
|
423
543
|
}
|
|
424
544
|
/**
|
|
425
545
|
* Displays status result to console
|
|
546
|
+
*
|
|
547
|
+
* @param result - Status result to display
|
|
548
|
+
* @param profile - Profile name
|
|
549
|
+
* @param mode - Deployment mode (integrated or standalone)
|
|
550
|
+
* @param quiltConfig - Quilt configuration (optional)
|
|
426
551
|
*/
|
|
427
552
|
/* istanbul ignore next */
|
|
428
|
-
function displayStatusResult(result, profile, quiltConfig) {
|
|
553
|
+
function displayStatusResult(result, profile, mode, quiltConfig) {
|
|
429
554
|
const stackName = result.stackArn?.match(/stack\/([^/]+)\//)?.[1] || result.stackArn || "Unknown";
|
|
430
555
|
const region = result.region || "Unknown";
|
|
431
556
|
// Format last updated time in local timezone
|
|
@@ -443,11 +568,27 @@ function displayStatusResult(result, profile, quiltConfig) {
|
|
|
443
568
|
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
444
569
|
lastUpdatedStr = ` @ ${timeStr} (${timezone})`;
|
|
445
570
|
}
|
|
446
|
-
// Display header with
|
|
447
|
-
|
|
571
|
+
// Display header with mode indicator
|
|
572
|
+
const modeLabel = mode === "integrated"
|
|
573
|
+
? chalk_1.default.blue("[Integrated]")
|
|
574
|
+
: chalk_1.default.cyan("[Standalone]");
|
|
575
|
+
console.log(chalk_1.default.bold(`\nStack Status for Profile: ${profile} ${modeLabel}${lastUpdatedStr}\n`));
|
|
448
576
|
console.log(chalk_1.default.dim("─".repeat(80)));
|
|
577
|
+
// Show webhook URL prominently at the top
|
|
578
|
+
if (result.stackOutputs?.webhookEndpoint) {
|
|
579
|
+
console.log(`${chalk_1.default.bold("Webhook URL:")} ${chalk_1.default.cyan(result.stackOutputs.webhookEndpoint)}`);
|
|
580
|
+
console.log(chalk_1.default.dim("─".repeat(80)));
|
|
581
|
+
}
|
|
449
582
|
console.log(`${chalk_1.default.bold("Stack:")} ${chalk_1.default.cyan(stackName)} ${chalk_1.default.bold("Region:")} ${chalk_1.default.cyan(region)}`);
|
|
450
|
-
|
|
583
|
+
// Show stack status
|
|
584
|
+
let statusLine = `${chalk_1.default.bold("Stack Status:")} ${formatStackStatus(result.stackStatus)}`;
|
|
585
|
+
// Only show BenchlingIntegration for integrated stacks
|
|
586
|
+
if (mode === "integrated" && result.benchlingIntegrationEnabled !== undefined) {
|
|
587
|
+
statusLine += ` ${chalk_1.default.bold("BenchlingIntegration:")} ${result.benchlingIntegrationEnabled
|
|
588
|
+
? chalk_1.default.green("✓ Enabled")
|
|
589
|
+
: chalk_1.default.yellow("⚠ Disabled")}`;
|
|
590
|
+
}
|
|
591
|
+
console.log(statusLine);
|
|
451
592
|
console.log("");
|
|
452
593
|
// Display stack outputs and secret info on one line each
|
|
453
594
|
if (result.stackOutputs) {
|
|
@@ -504,8 +645,8 @@ function displayStatusResult(result, profile, quiltConfig) {
|
|
|
504
645
|
console.log(` ${chalk_1.default.cyan("API Gateway:")} ${chalk_1.default.dim(result.stackOutputs.apiGatewayLogGroup)}`);
|
|
505
646
|
}
|
|
506
647
|
}
|
|
507
|
-
// Display Quilt stack resources (
|
|
508
|
-
if (quiltConfig) {
|
|
648
|
+
// Display Quilt stack resources (ONLY for integrated mode)
|
|
649
|
+
if (mode === "integrated" && quiltConfig) {
|
|
509
650
|
const resources = [];
|
|
510
651
|
if (quiltConfig.athenaUserWorkgroup)
|
|
511
652
|
resources.push({ label: "User Workgroup", value: quiltConfig.athenaUserWorkgroup });
|
|
@@ -653,7 +794,12 @@ function displayStatusResult(result, profile, quiltConfig) {
|
|
|
653
794
|
console.log("");
|
|
654
795
|
}
|
|
655
796
|
// Show next steps based on status
|
|
656
|
-
if (result.stackStatus
|
|
797
|
+
if (result.stackStatus === "DELETE_COMPLETE") {
|
|
798
|
+
console.log(chalk_1.default.bold("Status:"));
|
|
799
|
+
console.log(chalk_1.default.red(" 🗑️ Stack has been deleted"));
|
|
800
|
+
console.log(chalk_1.default.dim(" Deploy a new stack to recreate it\n"));
|
|
801
|
+
}
|
|
802
|
+
else if (result.stackStatus?.includes("IN_PROGRESS")) {
|
|
657
803
|
console.log(chalk_1.default.bold("Status:"));
|
|
658
804
|
console.log(chalk_1.default.yellow(" ⏳ Stack update in progress..."));
|
|
659
805
|
console.log(chalk_1.default.dim(" Auto-refreshing until complete...\n"));
|
|
@@ -661,7 +807,8 @@ function displayStatusResult(result, profile, quiltConfig) {
|
|
|
661
807
|
else if (result.stackStatus?.includes("COMPLETE") && !result.stackStatus.includes("ROLLBACK")) {
|
|
662
808
|
console.log(chalk_1.default.bold("Status:"));
|
|
663
809
|
console.log(chalk_1.default.green(" ✓ Stack is up to date\n"));
|
|
664
|
-
|
|
810
|
+
// Only show BenchlingIntegration warning for integrated stacks
|
|
811
|
+
if (mode === "integrated" && !result.benchlingIntegrationEnabled) {
|
|
665
812
|
console.log(chalk_1.default.bold("Action Required:"));
|
|
666
813
|
console.log(chalk_1.default.yellow(" BenchlingIntegration is Disabled"));
|
|
667
814
|
console.log(chalk_1.default.dim(" Enable it via CloudFormation console or re-run setup\n"));
|
|
@@ -698,16 +845,20 @@ async function statusCommand(options = {}) {
|
|
|
698
845
|
error: errorMsg,
|
|
699
846
|
};
|
|
700
847
|
}
|
|
701
|
-
//
|
|
702
|
-
|
|
703
|
-
|
|
848
|
+
// Identify target stack based on mode
|
|
849
|
+
let stackIdentification;
|
|
850
|
+
try {
|
|
851
|
+
stackIdentification = identifyTargetStack(config, xdg, profile);
|
|
852
|
+
}
|
|
853
|
+
catch (error) {
|
|
854
|
+
const errorMsg = error.message;
|
|
855
|
+
console.error(chalk_1.default.red(`\n❌ ${errorMsg}\n`));
|
|
704
856
|
return {
|
|
705
857
|
success: false,
|
|
706
|
-
error:
|
|
858
|
+
error: errorMsg,
|
|
707
859
|
};
|
|
708
860
|
}
|
|
709
|
-
const region =
|
|
710
|
-
const stackName = stackArn.match(/stack\/([^/]+)\//)?.[1] || stackArn;
|
|
861
|
+
const { stackName, region, mode } = stackIdentification;
|
|
711
862
|
// Parse timer value
|
|
712
863
|
const refreshInterval = parseTimerValue(timer);
|
|
713
864
|
// Setup Ctrl+C handler for graceful exit
|
|
@@ -728,12 +879,12 @@ async function statusCommand(options = {}) {
|
|
|
728
879
|
clearScreen();
|
|
729
880
|
}
|
|
730
881
|
// Fetch and display status
|
|
731
|
-
result = await fetchCompleteStatus(
|
|
882
|
+
result = await fetchCompleteStatus(stackName, region, mode, awsProfile);
|
|
732
883
|
if (!result.success) {
|
|
733
884
|
console.error(chalk_1.default.red(`❌ Failed to get stack status: ${result.error}\n`));
|
|
734
885
|
return result;
|
|
735
886
|
}
|
|
736
|
-
displayStatusResult(result, profile, config.quilt);
|
|
887
|
+
displayStatusResult(result, profile, mode, config.quilt);
|
|
737
888
|
// Check if we should exit (no timer or user disabled it)
|
|
738
889
|
if (!refreshInterval) {
|
|
739
890
|
break;
|