@fjall/deploy-core 2.13.0 → 2.14.0
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/dist/.minified +1 -1
- package/dist/src/aws/index.d.ts +6 -2
- package/dist/src/aws/index.js +1 -1
- package/dist/src/aws/organisations/accountGlobals.d.ts +40 -0
- package/dist/src/aws/organisations/accountGlobals.js +1 -0
- package/dist/src/aws/organisations/accounts.js +1 -1
- package/dist/src/aws/organisations/importedAccounts.d.ts +16 -0
- package/dist/src/aws/organisations/importedAccounts.js +1 -0
- package/dist/src/aws/organisations/index.d.ts +3 -1
- package/dist/src/aws/organisations/index.js +1 -1
- package/dist/src/aws/organisations/rootAccess.d.ts +27 -0
- package/dist/src/aws/organisations/rootAccess.js +3 -0
- package/dist/src/aws/organisations/serviceAccess.d.ts +6 -0
- package/dist/src/aws/organisations/serviceAccess.js +1 -1
- package/dist/src/aws/organisations/types.d.ts +12 -0
- package/dist/src/aws/organisations/types.js +1 -1
- package/dist/src/aws/sts/assumeRoot.d.ts +46 -0
- package/dist/src/aws/sts/assumeRoot.js +1 -0
- package/dist/src/aws/targetReadiness.d.ts +70 -0
- package/dist/src/aws/targetReadiness.js +1 -0
- package/dist/src/aws/targetSetAdvisory.d.ts +24 -0
- package/dist/src/aws/targetSetAdvisory.js +1 -0
- package/dist/src/index.d.ts +13 -13
- package/dist/src/index.js +1 -1
- package/dist/src/orchestration/applicationDeploy.js +1 -1
- package/dist/src/orchestration/applicationDestroy.js +1 -1
- package/dist/src/orchestration/cascadeDestroyHelpers.d.ts +12 -1
- package/dist/src/orchestration/cascadeDestroyHelpers.js +1 -1
- package/dist/src/orchestration/cascadeHelpers.d.ts +21 -6
- package/dist/src/orchestration/cascadeHelpers.js +1 -1
- package/dist/src/orchestration/contextHelpers.d.ts +17 -2
- package/dist/src/orchestration/contextHelpers.js +1 -1
- package/dist/src/orchestration/index.d.ts +8 -3
- package/dist/src/orchestration/index.js +1 -1
- package/dist/src/orchestration/organisationDeploy/cascadeExecution.d.ts +28 -0
- package/dist/src/orchestration/organisationDeploy/cascadeExecution.js +1 -0
- package/dist/src/orchestration/organisationDeploy/infraSteps.d.ts +40 -0
- package/dist/src/orchestration/organisationDeploy/infraSteps.js +1 -0
- package/dist/src/orchestration/organisationDeploy/orgCascadeDeploy.d.ts +8 -0
- package/dist/src/orchestration/organisationDeploy/orgCascadeDeploy.js +5 -0
- package/dist/src/orchestration/organisationDeploy/orgContext.d.ts +12 -0
- package/dist/src/orchestration/organisationDeploy/orgContext.js +1 -0
- package/dist/src/orchestration/organisationDeploy/resolveCascadeAccounts.d.ts +15 -0
- package/dist/src/orchestration/organisationDeploy/resolveCascadeAccounts.js +1 -0
- package/dist/src/orchestration/organisationDeploy/singleComponentDeploy.d.ts +11 -0
- package/dist/src/orchestration/organisationDeploy/singleComponentDeploy.js +1 -0
- package/dist/src/orchestration/organisationDeploy/trailReconciliation.d.ts +21 -0
- package/dist/src/orchestration/organisationDeploy/trailReconciliation.js +1 -0
- package/dist/src/orchestration/organisationDeploy.d.ts +1 -5
- package/dist/src/orchestration/organisationDeploy.js +1 -5
- package/dist/src/orchestration/organisationDestroy.d.ts +1 -1
- package/dist/src/orchestration/organisationDestroy.js +2 -2
- package/dist/src/orchestration/organisationSetup.d.ts +18 -2
- package/dist/src/orchestration/organisationSetup.js +1 -1
- package/dist/src/orchestration/stackCleanup/bucketOps.d.ts +54 -0
- package/dist/src/orchestration/stackCleanup/bucketOps.js +1 -0
- package/dist/src/orchestration/stackCleanup/failedStack.d.ts +34 -0
- package/dist/src/orchestration/stackCleanup/failedStack.js +1 -0
- package/dist/src/orchestration/stackCleanup/logging.d.ts +9 -0
- package/dist/src/orchestration/stackCleanup/logging.js +1 -0
- package/dist/src/orchestration/stackCleanup/messages.d.ts +16 -0
- package/dist/src/orchestration/stackCleanup/messages.js +1 -0
- package/dist/src/orchestration/stackCleanup/orphanSweep.d.ts +25 -0
- package/dist/src/orchestration/stackCleanup/orphanSweep.js +1 -0
- package/dist/src/orchestration/stackCleanup/preEmpty.d.ts +35 -0
- package/dist/src/orchestration/stackCleanup/preEmpty.js +1 -0
- package/dist/src/orchestration/stackCleanup/stackResources.d.ts +9 -0
- package/dist/src/orchestration/stackCleanup/stackResources.js +1 -0
- package/dist/src/orchestration/stackCleanup.d.ts +13 -40
- package/dist/src/orchestration/stackCleanup.js +1 -1
- package/dist/src/orchestration/trailMigration/memberTrailCleanup.js +1 -1
- package/dist/src/orchestration/unlock/scpRemediation.d.ts +15 -0
- package/dist/src/orchestration/unlock/scpRemediation.js +1 -0
- package/dist/src/orchestration/unlock/unlockBucket.d.ts +37 -0
- package/dist/src/orchestration/unlock/unlockBucket.js +1 -0
- package/dist/src/orchestration/unlock/unlockQueue.d.ts +43 -0
- package/dist/src/orchestration/unlock/unlockQueue.js +1 -0
- package/dist/src/services/application/ApplicationStackService.d.ts +9 -10
- package/dist/src/services/application/ApplicationStackService.js +1 -1
- package/dist/src/services/application/applicationStackHelpers.d.ts +13 -8
- package/dist/src/services/application/applicationStackHelpers.js +3 -3
- package/dist/src/steps/stepRegistry.js +1 -1
- package/dist/src/types/FjallState.d.ts +7 -0
- package/dist/src/types/FjallState.js +1 -1
- package/dist/src/types/callbacks.d.ts +43 -2
- package/dist/src/types/callbacks.js +1 -0
- package/dist/src/types/deploymentEventSchema.d.ts +9 -0
- package/dist/src/types/deploymentEventSchema.js +1 -1
- package/dist/src/types/index.d.ts +5 -10
- package/dist/src/types/index.js +1 -1
- package/dist/src/types/orgConfig.d.ts +8 -2
- package/dist/src/types/params.d.ts +12 -0
- package/dist/src/types/patternDetection.d.ts +0 -25
- package/dist/src/types/patternDetection.js +1 -1
- package/dist/src/types/stepDefinitions.d.ts +2 -0
- package/dist/src/types/stepDefinitions.js +1 -1
- package/package.json +6 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CdkService } from "../infrastructure/CdkService.js";
|
|
2
2
|
import type { CloudFormationService } from "../infrastructure/CloudFormationService.js";
|
|
3
3
|
import type { AwsProvider } from "../../aws/AwsProvider.js";
|
|
4
|
+
import type { DeployCallbacks } from "../../types/callbacks.js";
|
|
4
5
|
import type { ResourceEvent } from "../../types/events.js";
|
|
5
6
|
import type { DeploymentContext } from "../../types/deployment/DeploymentTypes.js";
|
|
6
7
|
import { type ApplicationStack } from "../../types/operations.js";
|
|
@@ -8,9 +9,12 @@ import type { ParallelDeploymentResult } from "../../types/deployment/parallel.j
|
|
|
8
9
|
import type { AppResourceFlags } from "../../types/patternDetection.js";
|
|
9
10
|
import { type Result } from "@fjall/generator";
|
|
10
11
|
import { ApplicationError, type StackDeploymentData } from "../../types/application/ApplicationServiceTypes.js";
|
|
12
|
+
import { type DestroyAllStacksCallbacks } from "./applicationStackHelpers.js";
|
|
11
13
|
interface StackCallbacks {
|
|
12
14
|
onOutput?: (chunk: string) => void;
|
|
13
15
|
onResourceProgress?: (event: ResourceEvent) => void;
|
|
16
|
+
onLog?: DeployCallbacks["onLog"];
|
|
17
|
+
onStackCleanupProgress?: DeployCallbacks["onStackCleanupProgress"];
|
|
14
18
|
}
|
|
15
19
|
interface DeployStackOptions {
|
|
16
20
|
/**
|
|
@@ -23,6 +27,8 @@ interface DeployStackOptions {
|
|
|
23
27
|
interface ParallelStackCallbacks {
|
|
24
28
|
onOutput?: (chunk: string, stackId: ApplicationStack) => void;
|
|
25
29
|
onResourceProgress?: (event: ResourceEvent, stackId: ApplicationStack) => void;
|
|
30
|
+
onLog?: DeployCallbacks["onLog"];
|
|
31
|
+
onStackCleanupProgress?: DeployCallbacks["onStackCleanupProgress"];
|
|
26
32
|
onStackComplete?: (stack: ApplicationStack, success: boolean, duration: number, error?: Error) => void;
|
|
27
33
|
}
|
|
28
34
|
/**
|
|
@@ -56,7 +62,7 @@ export declare class ApplicationStackService {
|
|
|
56
62
|
/**
|
|
57
63
|
* Destroy a specific stack type
|
|
58
64
|
*/
|
|
59
|
-
destroyStack(stackType: ApplicationStack, context: DeploymentContext, callbacks?: StackCallbacks, useCdkOut?: boolean): Promise<Result<StackDeploymentData, ApplicationError>>;
|
|
65
|
+
destroyStack(stackType: ApplicationStack, context: DeploymentContext, callbacks?: StackCallbacks, useCdkOut?: boolean, abortSignal?: AbortSignal): Promise<Result<StackDeploymentData, ApplicationError>>;
|
|
60
66
|
/**
|
|
61
67
|
* Destroy multiple stacks in parallel within a destroy phase.
|
|
62
68
|
*
|
|
@@ -64,7 +70,7 @@ export declare class ApplicationStackService {
|
|
|
64
70
|
* be run beforehand. Multiple CDK commands cannot run in parallel because they
|
|
65
71
|
* all try to synthesise to the same cdk.out directory.
|
|
66
72
|
*/
|
|
67
|
-
destroyStacksInParallel(stacks: readonly ApplicationStack[], context: DeploymentContext, callbacks?: ParallelStackCallbacks, useCdkOut?: boolean): Promise<Result<ParallelDeploymentResult[], ApplicationError>>;
|
|
73
|
+
destroyStacksInParallel(stacks: readonly ApplicationStack[], context: DeploymentContext, callbacks?: ParallelStackCallbacks, useCdkOut?: boolean, abortSignal?: AbortSignal): Promise<Result<ParallelDeploymentResult[], ApplicationError>>;
|
|
68
74
|
/**
|
|
69
75
|
* Get stack outputs for a deployed stack
|
|
70
76
|
*/
|
|
@@ -78,14 +84,7 @@ export declare class ApplicationStackService {
|
|
|
78
84
|
* Destroy all stacks for an application in reverse order.
|
|
79
85
|
* Supports parallel destruction for OpenNext patterns (nextjs/payload).
|
|
80
86
|
*/
|
|
81
|
-
destroyAllStacks(context: DeploymentContext, callbacks?: {
|
|
82
|
-
onOutput?: (chunk: string, stackId?: ApplicationStack) => void;
|
|
83
|
-
onResourceProgress?: (event: ResourceEvent, stackId?: ApplicationStack) => void;
|
|
84
|
-
onStackStart?: (stackType: ApplicationStack, stackName: string) => void;
|
|
85
|
-
onStackComplete?: (stackType: ApplicationStack, result: Result<StackDeploymentData, ApplicationError>) => void | Promise<void>;
|
|
86
|
-
onParallelPhaseStart?: (stacks: readonly ApplicationStack[], description: string) => void;
|
|
87
|
-
onParallelPhaseComplete?: (results: ParallelDeploymentResult[]) => void;
|
|
88
|
-
}, resources?: AppResourceFlags): Promise<Result<{
|
|
87
|
+
destroyAllStacks(context: DeploymentContext, callbacks?: DestroyAllStacksCallbacks, resources?: AppResourceFlags, abortSignal?: AbortSignal): Promise<Result<{
|
|
89
88
|
message: string;
|
|
90
89
|
}, ApplicationError>>;
|
|
91
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{STACK_NOT_FOUND_PATTERN as
|
|
1
|
+
import{CloudFormationClient as R}from"@aws-sdk/client-cloudformation";import{S3Client as v}from"@aws-sdk/client-s3";import{capturedSweepBuckets as D,preEmptyStackBuckets as N,sweepOrphanedDestroyBuckets as F}from"../../orchestration/stackCleanup.js";import{STACK_NOT_FOUND_PATTERN as _,CDK_NO_STACKS_MATCH as L}from"../../types/constants.js";import{getApplicationStackName as y}from"../../types/operations.js";import{success as g,failure as k}from"@fjall/generator";import{ApplicationError as h}from"../../types/application/ApplicationServiceTypes.js";import{logger as d}from"@fjall/util/logger";import{maskSensitiveOutput as P}from"@fjall/util";import{convertCloudFormationOutputsToRecord as O}from"../supporting/helpers.js";import{destroyAllStacks as $,mapSettledResults as A,resolveWebsiteUrl as B}from"./applicationStackHelpers.js";class z{cdkService;cloudFormationService;aws;constructor(e,s,t){this.cdkService=e,this.cloudFormationService=s,this.aws=t}async runCdkSynth(e){return this.cdkService.runCdkSynth(e)}async deployStack(e,s,t,a){const c=s.target,i=y(c,e),n=await this.cdkService.runCdkDeploy(s,i,t?.onOutput,t?.onResourceProgress,this.aws,void 0,a?.parameters);if(n.success){const o=n.data;d.debug("ApplicationStackService","CDK deploy result",{stackName:i,stackType:e,success:!0,message:o.message,status:o.status,skipped:o.details?.skipped,hasOutput:!!o.details?.output});const u=await this.cloudFormationService.getStackOutputs(i);d.debug("ApplicationStackService","Stack outputs after deploy",{stackName:i,hasOutputs:u.success&&u.data.length>0,outputCount:u.success?u.data.length:0});const r=u.success&&u.data.length>0?O(u.data):void 0;return g({stackType:e,stackName:i,skipped:o.details?.skipped===!0,outputs:r})}else{const o=P(n.error||`Failed to deploy ${e} infrastructure`);return d.error("ApplicationStackService","Stack deployment failed",{stackType:e,target:s.target,error:o}),k(new h(o,{errorType:"deployment_failed",appName:s.target,operation:"deployStack",stackType:e}))}}async deployStacksInParallel(e,s,t){const a=t?.onOutput,c=t?.onResourceProgress,i=t?.onStackComplete,n=await Promise.allSettled(e.map(async o=>{const u=Date.now(),r=await this.deployStack(o,s,{onOutput:a?m=>a(m,o):void 0,onResourceProgress:c?m=>c(m,o):void 0}),S=Date.now()-u,p={stack:o,success:r.success,error:r.success?void 0:r.error,duration:S,...r.success&&r.data.outputs!==void 0?{outputs:r.data.outputs}:{}};return!r.success&&r.error&&d.debug("deployStacksInParallel",`Stack ${o} failed`,{error:r.error.message}),i?.(o,r.success,S,r.success?void 0:r.error),p}));return g(A(n,e))}async destroyStack(e,s,t,a,c){const i=s.target,n=y(i,e);let o=[];if(this.aws!==void 0)if(a===!0||(await this.cdkService.runCdkSynth(s)).success){const S=await N(this.aws.getClient(R),this.aws.getClient(v),n,{onLog:t?.onLog,onStackCleanupProgress:t?.onStackCleanupProgress},c);o=D(S)}else d.debug("ApplicationStackService","Skipping pre-empty pass after failed validation synth \u2014 the destroy will surface the error",{stackName:n});else d.debug("ApplicationStackService","No AWS provider available, skipping pre-empty pass",{stackName:n});const u=await this.cdkService.runCdkDestroy(s,n,t?.onOutput,t?.onResourceProgress,this.aws,a);if(u.success)return this.aws!==void 0&&o.length>0&&await F(this.aws.getClient(v),o,{onLog:t?.onLog,onStackCleanupProgress:t?.onStackCleanupProgress},c),g({stackType:e,stackName:n,skipped:!1,outputs:void 0});{const r=P(u.error||`Failed to destroy ${e} stack`);return d.error("ApplicationStackService","Stack destroy failed",{stackType:e,target:s.target,error:r}),k(new h(r,{errorType:"destroy_failed",appName:s.target,operation:"destroyStack",stackType:e}))}}async destroyStacksInParallel(e,s,t,a,c){const i=t?.onOutput,n=t?.onResourceProgress,o=t?.onStackComplete,u=await Promise.allSettled(e.map(async r=>{const S=Date.now(),p=await this.destroyStack(r,s,{onOutput:i?f=>i(f,r):void 0,onResourceProgress:n?f=>n(f,r):void 0,onLog:t?.onLog,onStackCleanupProgress:t?.onStackCleanupProgress},a,c),m=Date.now()-S,C=p.success?"":p.error?.message??"",w=C.includes(_)||C.includes(L),l={stack:r,success:p.success||w,error:p.success||w?void 0:p.error,duration:m};return!l.success&&l.error&&d.debug("destroyStacksInParallel",`Stack ${r} failed`,{error:l.error.message}),o?.(r,l.success,m,l.success?void 0:l.error),l}));return g(A(u,e))}async getStackOutputs(e,s){const t=y(e,s),a=await this.cloudFormationService.getStackOutputs(t);return a.success?g(O(a.data)):k(new h(`Failed to get outputs for ${t}`,{errorType:"stack_error",appName:e,operation:"getStackOutputs",stackType:s,details:a.error}))}async resolveWebsiteUrl(e){return B(e,this.cloudFormationService)}async destroyAllStacks(e,s,t,a){return $(this,e,s,t,a)}}export{z as ApplicationStackService};
|
|
@@ -7,6 +7,18 @@ import { type Result } from "@fjall/generator";
|
|
|
7
7
|
import { ApplicationError, type StackDeploymentData } from "../../types/application/ApplicationServiceTypes.js";
|
|
8
8
|
import type { ApplicationStackService } from "./ApplicationStackService.js";
|
|
9
9
|
import type { CloudFormationService } from "../infrastructure/CloudFormationService.js";
|
|
10
|
+
import type { DeployCallbacks } from "../../types/callbacks.js";
|
|
11
|
+
/** Shared with ApplicationStackService.destroyAllStacks — the two signatures must not drift. */
|
|
12
|
+
export interface DestroyAllStacksCallbacks {
|
|
13
|
+
onOutput?: (chunk: string, stackId?: ApplicationStack) => void;
|
|
14
|
+
onResourceProgress?: (event: ResourceEvent, stackId?: ApplicationStack) => void;
|
|
15
|
+
onLog?: DeployCallbacks["onLog"];
|
|
16
|
+
onStackCleanupProgress?: DeployCallbacks["onStackCleanupProgress"];
|
|
17
|
+
onStackStart?: (stackType: ApplicationStack, stackName: string) => void;
|
|
18
|
+
onStackComplete?: (stackType: ApplicationStack, result: Result<StackDeploymentData, ApplicationError>) => void | Promise<void>;
|
|
19
|
+
onParallelPhaseStart?: (stacks: readonly ApplicationStack[], description: string) => void;
|
|
20
|
+
onParallelPhaseComplete?: (results: ParallelDeploymentResult[]) => void;
|
|
21
|
+
}
|
|
10
22
|
/**
|
|
11
23
|
* Convert "doesn't exist" errors to success for destroy operations.
|
|
12
24
|
*/
|
|
@@ -24,14 +36,7 @@ export declare function handleDestroyError(result: Result<StackDeploymentData, A
|
|
|
24
36
|
* Destroy all stacks for an application in reverse order.
|
|
25
37
|
* Supports parallel destruction for OpenNext patterns (nextjs/payload).
|
|
26
38
|
*/
|
|
27
|
-
export declare function destroyAllStacks(service: ApplicationStackService, context: DeploymentContext, callbacks?: {
|
|
28
|
-
onOutput?: (chunk: string, stackId?: ApplicationStack) => void;
|
|
29
|
-
onResourceProgress?: (event: ResourceEvent, stackId?: ApplicationStack) => void;
|
|
30
|
-
onStackStart?: (stackType: ApplicationStack, stackName: string) => void;
|
|
31
|
-
onStackComplete?: (stackType: ApplicationStack, result: Result<StackDeploymentData, ApplicationError>) => void | Promise<void>;
|
|
32
|
-
onParallelPhaseStart?: (stacks: readonly ApplicationStack[], description: string) => void;
|
|
33
|
-
onParallelPhaseComplete?: (results: ParallelDeploymentResult[]) => void;
|
|
34
|
-
}, resources?: AppResourceFlags): Promise<Result<{
|
|
39
|
+
export declare function destroyAllStacks(service: ApplicationStackService, context: DeploymentContext, callbacks?: DestroyAllStacksCallbacks, resources?: AppResourceFlags, abortSignal?: AbortSignal): Promise<Result<{
|
|
35
40
|
message: string;
|
|
36
41
|
}, ApplicationError>>;
|
|
37
42
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{maskSensitiveOutput as
|
|
2
|
-
`);return
|
|
1
|
+
import{maskSensitiveOutput as T}from"@fjall/util";import{STACK_NOT_FOUND_PATTERN as D,CDK_NO_STACKS_MATCH as N,INFRASTRUCTURE_FILENAME as $}from"../../types/constants.js";import{APPLICATION_STACKS as R,getApplicationStackName as g,getApplicationDestroyOrder as U,getParallelDestroyGroups as K}from"../../types/operations.js";import{FrameworkRegistry as F}from"../../orchestration/builders/frameworkRegistry.js";import{success as w,failure as P,isFailure as A}from"@fjall/generator";import{ApplicationError as C}from"../../types/application/ApplicationServiceTypes.js";import{logger as M}from"@fjall/util/logger";function E(t,r,e){if(t.success)return t;const s=A(t)?t.error.message:"";return s.includes(D)||s.includes(N)?w({stackName:g(e,r),stackType:r,outputs:{},skipped:!0}):t}function L(t,r){if(t.success)return null;const e=A(t)?T(t.error.message):"";if(e.includes("TSError")||e.includes("Unable to compile TypeScript")||e.includes("Subprocess exited with error")){const s=e.match(/infrastructure\.ts\(\d+,\d+\): error TS\d+: .+/),d=s?s[0]:`Check ${$} for syntax errors`;return{continue:!1,result:P(new C(`CDK synthesis failed: ${d}`,{errorType:"synth_failed",operation:`destroy-${r}`}))}}return e.includes(D)||e.includes(N)?{continue:!0,result:w({message:"Stack already deleted"})}:{continue:!1,result:P(new C(`Failed to destroy ${r} stack: ${e}`,{errorType:"destroy_failed",operation:`destroy-${r}`}))}}async function W(t,r,e,s,d){const u=r.target,f=F.createDefault().resolve({appPath:r.path});let y,k;if(f){const a=f.builder.plan({appPath:r.path},f.detection);y=a.parallelDestroy,k=a.destroyOrder}else y=!1,k=U({pattern:null,resources:s});if(y){const a=K();for(const h of a){const m=h.stacks;if(m.length===1){const n=m[0],l=g(u,n);e?.onStackStart?.(n,l);const o=await t.destroyStack(n,r,{onOutput:e?.onOutput?c=>e.onOutput?.(c,n):void 0,onResourceProgress:e?.onResourceProgress?c=>e.onResourceProgress?.(c,n):void 0,onLog:e?.onLog,onStackCleanupProgress:e?.onStackCleanupProgress},void 0,d),i=E(o,n,u);e?.onStackComplete&&await e.onStackComplete(n,i);const p=L(i,n);if(p){if(p.continue)continue;return p.result}}else{const n=await t.runCdkSynth(r);if(!n.success)return P(new C(n.error,{errorType:"synth_failed",appName:u,operation:"destroy-parallel-synth"}));e?.onParallelPhaseStart?.(m,h.description);for(const o of m)e?.onStackStart?.(o,g(u,o));const l=await t.destroyStacksInParallel(m,r,{onOutput:e?.onOutput,onResourceProgress:e?.onResourceProgress,onLog:e?.onLog,onStackCleanupProgress:e?.onStackCleanupProgress,onStackComplete:async(o,i,p,c)=>{const O=c?.message!==void 0?T(c.message):"Stack destruction failed",_=i?w({stackName:g(u,o),stackType:o,outputs:{}}):P(c instanceof C?c:new C(O,{errorType:"destroy_failed",appName:u,operation:`destroy-${o}`}));await e?.onStackComplete?.(o,_)}},!0,d);if(l.success){e?.onParallelPhaseComplete?.(l.data);const o=l.data.filter(i=>!i.success);if(o.length>0){const i=o.filter(p=>p.error&&!p.error.message.includes(D)&&!p.error.message.includes(N));if(i.length>0){const p=i.map(O=>O.stack).join(", "),c=i.map(O=>`${O.stack}: ${O.error?.message??"Unknown error"}`).join(`
|
|
2
|
+
`);return P(new C(`Failed to destroy stacks: ${p}
|
|
3
3
|
|
|
4
|
-
${
|
|
4
|
+
${c}`,{errorType:"destroy_failed",appName:u,operation:"destroy-parallel"}))}}}}}}else for(const a of k){const h=g(u,a);e?.onStackStart?.(a,h);const m=await t.destroyStack(a,r,{onOutput:e?.onOutput?o=>e.onOutput?.(o,a):void 0,onResourceProgress:e?.onResourceProgress?o=>e.onResourceProgress?.(o,a):void 0,onLog:e?.onLog,onStackCleanupProgress:e?.onStackCleanupProgress},void 0,d),n=E(m,a,u);e?.onStackComplete&&await e.onStackComplete(a,n);const l=L(n,a);if(l){if(l.continue)continue;return l.result}}return w({message:"All stacks destroyed"})}function H(t,r){return t.map((e,s)=>e.status==="fulfilled"?e.value:{stack:r[s]??R.NETWORK,success:!1,error:e.reason instanceof Error?e.reason:new Error(String(e.reason)),duration:0})}async function q(t,r){try{const e=g(t,R.COMPUTE),s=await r.getStackOutputs(e);if(s.success&&s.data.length>0){const S=s.data.find(y=>y.OutputKey?.includes("LoadBalancerUrl"));if(S?.OutputValue)return S.OutputValue.toLowerCase();const f=s.data.find(y=>y.OutputKey?.includes("LoadBalancerDnsName"));if(f?.OutputValue)return`http://${f.OutputValue.toLowerCase()}`}const d=g(t,R.CDN),u=await r.getStackOutputs(d);if(u.success&&u.data.length>0){const S=u.data.find(f=>f.OutputKey?.includes("DistributionDomainName"));if(S?.OutputValue)return`https://${S.OutputValue.toLowerCase()}`}return}catch(e){M.warn("ApplicationStackService","URL resolution failed",{error:T(e instanceof Error?e.message:String(e))});return}}export{E as convertDestroyResultIfNotExists,W as destroyAllStacks,L as handleDestroyError,H as mapSettledResults,q as resolveWebsiteUrl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{APPLICATION_STACKS as n,APPLICATION_DEPLOY_ORDER as
|
|
1
|
+
import{APPLICATION_STACKS as n,APPLICATION_DEPLOY_ORDER as l,getApplicationStepName as t,getApplicationStepId as a}from"../types/index.js";import{STEP_IDS as e,STEP_NAMES as s,INFRA_STEP_NAME as d}from"../types/index.js";const O={Network:e.NETWORK_DESTROY,Storage:e.STORAGE_DESTROY,Messaging:e.MESSAGING_DESTROY,Database:e.DATABASE_DESTROY,Compute:e.COMPUTE_DESTROY,Cdn:e.CDN_DESTROY};function C(A){return O[A]??`${A.toLowerCase()}-destroy`}class p{static DEPLOYMENT_STEPS=new Map([["application-deploy",[{id:e.AUTH,name:s.AUTH},{id:e.DETECT_CONFIG,name:s.PREPARE_DEPLOY},{id:e.TARGET_READINESS,name:s.TARGET_READINESS,conditions:{requiresInfra:!0}},{id:e.BOOTSTRAP,name:s.BOOTSTRAP,conditions:{requiresInfra:!0}},{id:a(n.NETWORK,"deploy"),name:t(n.NETWORK,"deploy"),conditions:{requiresInfra:!0,requiresNetwork:!0}},{id:a(n.STORAGE,"deploy"),name:t(n.STORAGE,"deploy"),conditions:{requiresInfra:!0,requiresStorage:!0}},{id:a(n.MESSAGING,"deploy"),name:t(n.MESSAGING,"deploy"),conditions:{requiresInfra:!0,requiresMessaging:!0}},{id:a(n.DATABASE,"deploy"),name:t(n.DATABASE,"deploy"),conditions:{requiresInfra:!0,requiresDatabase:!0}},{id:e.DOCKER_OPERATIONS,name:"Docker operations",conditions:{requiresDocker:!0,requiresCompute:!0,skipForInfraOnly:!0}},{id:e.TAG_ECR_IMAGES,name:"Tagging container images",conditions:{requiresImageTagging:!0,requiresCompute:!0,skipForInfraOnly:!0}},{id:a(n.COMPUTE,"deploy"),name:t(n.COMPUTE,"deploy"),conditions:{requiresInfra:!0,requiresCompute:!0}},{id:a(n.CDN,"deploy"),name:t(n.CDN,"deploy"),conditions:{requiresInfra:!0,requiresCdn:!0}}]],["application-destroy",[{id:e.AUTH,name:s.AUTH},{id:e.DETECT_CONFIG,name:s.CHECK_INFRA_STATE},{id:a(n.CDN,"destroy"),name:t(n.CDN,"destroy"),conditions:{requiresCdn:!0}},{id:a(n.COMPUTE,"destroy"),name:t(n.COMPUTE,"destroy")},{id:a(n.DATABASE,"destroy"),name:t(n.DATABASE,"destroy")},{id:a(n.MESSAGING,"destroy"),name:t(n.MESSAGING,"destroy"),conditions:{requiresMessaging:!0}},{id:a(n.STORAGE,"destroy"),name:t(n.STORAGE,"destroy"),conditions:{requiresStorage:!0}},{id:a(n.NETWORK,"destroy"),name:t(n.NETWORK,"destroy")}]],["organisation-deploy",[{id:e.AUTH,name:s.AUTH},{id:e.ORG_SETUP,name:s.ORG_SETUP},{id:e.PREPARE_ENVIRONMENT,name:d.PREPARE},{id:e.ORG_DEPLOY,name:s.ORG_DEPLOY,conditions:{requiresOrgChanges:!0}},{id:e.CASCADE_PLATFORM,name:s.CASCADE_PLATFORM,conditions:{requiresPlatformAccount:!0}},{id:e.CASCADE_ACCOUNTS,name:s.CASCADE_ACCOUNTS,conditions:{requiresMemberAccounts:!0}}]],["organisation-destroy",[{id:e.AUTH,name:s.AUTH},{id:e.CFN_CHECK,name:s.CHECK_INFRA_STATE},{id:e.CASCADE_ACCOUNTS,name:"Destroying account infrastructure",conditions:{requiresMemberAccounts:!0}},{id:e.CASCADE_PLATFORM,name:"Destroying platform infrastructure",conditions:{requiresPlatformAccount:!0}},{id:e.DESTROY,name:"Destroying organisation infrastructure"}]],["platform-deploy",[{id:e.AUTH,name:s.AUTH},{id:e.CONNECT,name:d.CONNECT},{id:e.PREPARE_ENVIRONMENT,name:d.PREPARE},{id:e.DEPLOY,name:d.DEPLOY},{id:e.MONITORING,name:d.MONITORING}]],["platform-destroy",[{id:e.AUTH,name:s.AUTH},{id:e.CFN_CHECK,name:"Checking infrastructure state"},{id:e.ORG_DESTROY,name:"Destroying platform infrastructure"}]],["account-deploy",[{id:e.AUTH,name:s.AUTH},{id:e.CONNECT,name:d.CONNECT},{id:e.PREPARE_ENVIRONMENT,name:d.PREPARE},{id:e.DEPLOY,name:d.DEPLOY},{id:e.MONITORING,name:d.MONITORING}]],["account-destroy",[{id:e.AUTH,name:s.AUTH},{id:e.CFN_CHECK,name:"Checking infrastructure state"},{id:e.ORG_DESTROY,name:"Destroying account infrastructure"}]]]);static getSteps(r){if(r.deploymentType==="application"&&r.operation==="deploy"&&r.deployOnly)return[{id:e.AUTH,name:s.AUTH},{id:e.DOCKER_OPERATIONS,name:"Build and push Docker container"},{id:a(n.COMPUTE,"deploy"),name:t(n.COMPUTE,"deploy")}];const o=`${r.deploymentType}-${r.operation}`;return(this.DEPLOYMENT_STEPS.get(o)??[]).filter(i=>{if(r.deploymentType==="application"){const T=r.builderName==="opennext";if(i.conditions?.requiresInfra&&r.deployOnly)return!1;if(r.resources){const E=r.resources;if(i.conditions?.requiresNetwork&&!E.hasNetwork||i.conditions?.requiresCompute&&!E.hasCompute||i.conditions?.requiresDatabase&&!E.hasDatabase||i.conditions?.requiresStorage&&!E.hasStorage||i.conditions?.requiresMessaging&&!E.hasMessaging||i.conditions?.requiresCdn&&!E.hasCdn)return!1}else if(r.operation==="deploy"&&!T&&(i.conditions?.requiresNetwork||i.conditions?.requiresCompute||i.conditions?.requiresDatabase||i.conditions?.requiresStorage||i.conditions?.requiresMessaging||i.conditions?.requiresCdn))return!1;if(i.conditions?.requiresDocker||i.id===e.DOCKER_OPERATIONS)return T||r.infraOnly||r.resources&&!r.resources.hasCompute?!1:r.deployOnly?r.hasDockerfile===!0:r.hasDockerfile===!0||r.hasDockerfile===!1&&!r.isManagedAccount;if(i.conditions?.requiresImageTagging)return r.infraOnly||T||r.resources&&!r.resources.hasCompute?!1:r.hasDockerfile===!1}return!(i.conditions?.requiresMemberAccounts&&!r.hasMemberAccounts||i.conditions?.requiresPlatformAccount&&!r.hasPlatformAccount||i.conditions?.requiresOrgChanges&&r.hasOrgChanges!==!0||i.conditions?.requiresPlatformChanges&&r.hasPlatformChanges!==!0||i.conditions?.requiresAccountChanges&&r.hasAccountChanges!==!0||i.conditions?.requiresDomainConfiguration&&!r.hasDomainConfiguration||i.conditions?.requiresDomainChanges&&r.hasDomainChanges!==!0)}).map(i=>i.id===e.DOCKER_OPERATIONS?{...i,name:r.hasDockerfile?"Building and pushing Docker image":"Initialising container repository"}:i)}static getStepNames(r){return this.getSteps(r).map(o=>o.name)}static getStepIndex(r,o){return this.getSteps(o).findIndex(c=>c.id===r)}static getStepById(r,o="application"){const u=`${o}-deploy`,i=(this.DEPLOYMENT_STEPS.get(u)||[]).find(f=>f.id===r);if(i)return i;const T=`${o}-destroy`;return(this.DEPLOYMENT_STEPS.get(T)||[]).find(f=>f.id===r)}static isStepIncluded(r,o){return this.getSteps(o).some(c=>c.id===r)}static createContext(r,o,u){return{deploymentType:r,operation:o,deployOnly:u?.deployOnly??!1,infraOnly:u?.infraOnly??!1,isManagedAccount:u?.isManagedAccount??!1,hasDockerfile:u?.hasDockerfile??!1,pattern:u?.pattern??null,builderName:u?.builderName,resources:u?.resources}}static getDeploymentTypes(){return["application","organisation","platform","account"]}static getStackNames(r){switch(r){case"application":return[...l];case"organisation":return["Organisation"];case"platform":return["Platform"];case"account":return["Account"];default:return[]}}static getInfraStepIds(){return[e.CFN_CHECK,e.TARGET_READINESS,e.BOOTSTRAP,e.DIFF,e.NETWORK,e.STORAGE,e.MESSAGING,e.DATABASE,e.COMPUTE,e.CDN]}static getDockerStepIds(){return[e.ECR_INIT,e.DOCKER_DEPLOY]}}export{p as StepRegistry,C as getDestroyStepId};
|
|
@@ -24,6 +24,13 @@ export type FjallStateFile = z.infer<typeof FjallStateFileSchema>;
|
|
|
24
24
|
* Get the state file path for an application
|
|
25
25
|
*/
|
|
26
26
|
export declare function getStateFilePath(appPath: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Suffix form of a region for cascade artefact naming — shared by assembly
|
|
29
|
+
* dirs (`cdk.out.<accountId>.<suffix>`), per-account state files, and the
|
|
30
|
+
* Platform stack's IPAM output keys (`IpamPoolId<accountId><suffix>`). One
|
|
31
|
+
* derivation so producers and consumers of those names cannot drift.
|
|
32
|
+
*/
|
|
33
|
+
export declare function regionSuffix(region: string): string;
|
|
27
34
|
/**
|
|
28
35
|
* Get the per-account state file path for a cascade target.
|
|
29
36
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as a}from"zod";import{randomBytes as u}from"crypto";import{readFile as
|
|
1
|
+
import{z as a}from"zod";import{randomBytes as u}from"crypto";import{readFile as f,writeFile as d,unlink as s,rename as m,mkdir as S}from"fs/promises";import{dirname as g,join as c}from"path";import{fileExists as h}from"@fjall/util/fsHelpers";import{logger as o}from"@fjall/util/logger";import{getErrorMessage as i,maskSensitiveOutput as y}from"@fjall/util";const F=a.object({hash:a.string(),deployedAt:a.string(),stackStatus:a.string().optional()}).strict(),w=a.object({version:a.literal(1),lastDeployedAt:a.string().optional(),templateHashes:a.record(a.string(),F),metadata:a.record(a.string(),a.unknown()).optional()}).strict(),x=".fjall-state.json";function l(t){return c(t,x)}function j(t){return t.replace(/-/g,"")}function k(t,r,e){return c(t,`.fjall-state.cascade-${r}-${j(e)}.json`)}async function E(t){if(!await h(t))return null;try{const r=await f(t,"utf-8"),e=JSON.parse(r),n=w.safeParse(e);return n.success?n.data:null}catch(r){return o.debug("FjallState","Failed to read state file",{path:t,error:i(r)}),null}}async function A(t,r){const e=`${t}.${Date.now()}-${u(4).toString("hex")}.tmp`;await S(g(t),{recursive:!0});try{await d(e,JSON.stringify(r,null,2),"utf-8"),await m(e,t)}catch(n){try{await s(e)}catch(p){o.debug("FjallState","Temp file cleanup failed (non-fatal)",{path:e,error:i(p)})}throw n}}async function v(t){return E(l(t))}async function I(t,r){return A(l(t),r)}function J(){return{version:1,templateHashes:{}}}async function M(t){const r=l(t);try{await s(r)}catch(e){(typeof e=="object"&&e!==null&&"code"in e?e.code:void 0)!=="ENOENT"&&o.warn("FjallState","Failed to delete state file",{path:r,error:y(i(e))})}}function _(t,r,e,n){return{...t,lastDeployedAt:new Date().toISOString(),templateHashes:{...t.templateHashes,[r]:{hash:e,deployedAt:new Date().toISOString(),...n!==void 0&&{stackStatus:n}}}}}export{w as FjallStateFileSchema,J as createEmptyState,M as deleteStateFile,k as getCascadeStateFilePath,l as getStateFilePath,v as readStateFile,E as readStateFileAt,j as regionSuffix,_ as updateTemplateHash,I as writeStateFile,A as writeStateFileAt};
|
|
@@ -3,6 +3,40 @@ import type { TrailLifecycleState } from "@fjall/util/config";
|
|
|
3
3
|
import type { DetectionResult } from "./detection.js";
|
|
4
4
|
import type { CascadeLedger } from "../orchestration/cascadeSummary.js";
|
|
5
5
|
export type StepCompleteStatus = "completed" | "skipped" | "error";
|
|
6
|
+
/**
|
|
7
|
+
* Structured payload for the "quarantine-suspected" stack-cleanup phase:
|
|
8
|
+
* an AccessDenied empty pass on a DELETE_FAILED bucket, the earliest signal
|
|
9
|
+
* that the auto-delete deny policy stranded the bucket.
|
|
10
|
+
*/
|
|
11
|
+
export interface StackCleanupQuarantineDetail {
|
|
12
|
+
/** Bucket whose empty pass was denied. */
|
|
13
|
+
bucketName: string;
|
|
14
|
+
/** Account the bucket lives in, when the caller knows it. */
|
|
15
|
+
accountId?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Structured payload for the "retained-buckets" stack-cleanup phase: buckets
|
|
19
|
+
* the pre-empty pass left untouched (no pre-empty tag → Retain removal
|
|
20
|
+
* policy). Emitted once per stack when the retained set is non-empty, so
|
|
21
|
+
* operators hear by name which buckets survive the destroy (AC3.5).
|
|
22
|
+
*/
|
|
23
|
+
export interface StackCleanupRetainedBucketsDetail {
|
|
24
|
+
/** Bucket names left in place; they survive the destroy by design. */
|
|
25
|
+
retainedBuckets: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Pre-formatted, identifier-only operator copy (canonical source:
|
|
28
|
+
* formatRetainedBucketsMessage in orchestration/stackCleanup.ts). Adapters
|
|
29
|
+
* render this verbatim so the remediation wording has a single source.
|
|
30
|
+
*/
|
|
31
|
+
message: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Narrow an onStackCleanupProgress detail to the quarantine payload.
|
|
35
|
+
* Accepts undefined so call sites drop their `detail !== undefined &&` prefix.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isQuarantineDetail(detail: StackCleanupQuarantineDetail | StackCleanupRetainedBucketsDetail | undefined): detail is StackCleanupQuarantineDetail;
|
|
38
|
+
/** Narrow an onStackCleanupProgress detail to the retained-buckets payload. */
|
|
39
|
+
export declare function isRetainedBucketsDetail(detail: StackCleanupQuarantineDetail | StackCleanupRetainedBucketsDetail | undefined): detail is StackCleanupRetainedBucketsDetail;
|
|
6
40
|
/**
|
|
7
41
|
* Unified callback interface for deployment progress.
|
|
8
42
|
*
|
|
@@ -173,8 +207,15 @@ export interface DeployCallbacks {
|
|
|
173
207
|
* ConnectedAwsAccount update) — the engine holds no durable state itself.
|
|
174
208
|
*/
|
|
175
209
|
onTrailLifecycleChanged?: (accountId: string, from: TrailLifecycleState | undefined, to: TrailLifecycleState) => void;
|
|
176
|
-
/**
|
|
177
|
-
|
|
210
|
+
/**
|
|
211
|
+
* @emittedBy engine — progress during failed-state stack cleanup (S3
|
|
212
|
+
* emptying, deletion) and the pre-destroy pre-empty pass. `detail` is only
|
|
213
|
+
* populated for two phases: "quarantine-suspected" (Phase 2's detection
|
|
214
|
+
* rule and `fjall unlock` consume that vocabulary, so the literal must not
|
|
215
|
+
* be renamed) and "retained-buckets" (the production-retained set, named
|
|
216
|
+
* so operators delete deliberately).
|
|
217
|
+
*/
|
|
218
|
+
onStackCleanupProgress?: (stackName: string, phase: "emptying-bucket" | "deleting-stack" | "waiting" | "complete" | "error" | "quarantine-suspected" | "retained-buckets", detail?: StackCleanupQuarantineDetail | StackCleanupRetainedBucketsDetail) => void;
|
|
178
219
|
/**
|
|
179
220
|
* @emittedBy engine — fired after the detection pipeline completes with full analysis results.
|
|
180
221
|
* May be async — engine awaits the return value so callers can run post-detection
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(e){return e!==void 0&&"bucketName"in e}function t(e){return e!==void 0&&"retainedBuckets"in e}export{n as isQuarantineDetail,t as isRetainedBucketsDetail};
|
|
@@ -15,6 +15,15 @@ export declare const DEPLOYMENT_EVENT_RESOURCE_CATEGORIES: readonly ["security",
|
|
|
15
15
|
export type DeploymentEventResourceCategory = (typeof DEPLOYMENT_EVENT_RESOURCE_CATEGORIES)[number];
|
|
16
16
|
export declare const CASCADE_PHASES: readonly ["platform", "domains", "accounts"];
|
|
17
17
|
export declare const CASCADE_ACCOUNT_STATUSES: readonly ["started", "deploying", "completed", "failed"];
|
|
18
|
+
/**
|
|
19
|
+
* Field caps shared with producers that truncate before enqueueing (webapp
|
|
20
|
+
* `deploymentCallbackAdapter`). Defined beside the schema so its `.max()`
|
|
21
|
+
* and the producer's `.slice()` cannot drift apart — a producer cap above
|
|
22
|
+
* the schema cap makes the server reject the whole event.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DEPLOYMENT_EVENT_STATUS_REASON_MAX = 2048;
|
|
25
|
+
export declare const DEPLOYMENT_EVENT_ERROR_MESSAGE_MAX = 4096;
|
|
26
|
+
export declare const DEPLOYMENT_EVENT_TRAIL_DETAIL_MAX = 2048;
|
|
18
27
|
export declare const DEPLOYMENT_EVENT_TYPES: readonly ["step", "resource", "docker", "ecs", "error", "complete", "cascade_phase", "cascade_account", "cascade_missing_accounts", "parallel_phase", "detection", "trail_migration", "log"];
|
|
19
28
|
export type DeploymentEventType = (typeof DEPLOYMENT_EVENT_TYPES)[number];
|
|
20
29
|
export type DeploymentEventCascadePhase = (typeof CASCADE_PHASES)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";import{TRAIL_MIGRATION_PHASES as r,TRAIL_MIGRATION_STATUSES as i}from"./events.js";const c=["security","network","compute","database","storage","monitoring","dns","identity","bootstrap","events","registry","backup"],n=["platform","domains","accounts"],m=["started","deploying","completed","failed"],l=["step","resource","docker","ecs","error","complete","cascade_phase","cascade_account","cascade_missing_accounts","parallel_phase","detection","trail_migration","log"],
|
|
1
|
+
import{z as e}from"zod";import{TRAIL_MIGRATION_PHASES as r,TRAIL_MIGRATION_STATUSES as i}from"./events.js";const c=["security","network","compute","database","storage","monitoring","dns","identity","bootstrap","events","registry","backup"],n=["platform","domains","accounts"],m=["started","deploying","completed","failed"],l=2048,p=4096,u=2048,g=["step","resource","docker","ecs","error","complete","cascade_phase","cascade_account","cascade_missing_accounts","parallel_phase","detection","trail_migration","log"],d={step:"step",resource:"resource",docker:"docker",ecs:"ecs",error:"error",complete:null,cascade_phase:"cascadePhase",cascade_account:"cascadeAccount",cascade_missing_accounts:"cascadeMissingAccounts",parallel_phase:"parallelPhase",detection:"detection",trail_migration:"trailMigration",log:"log"},_=e.object({type:e.enum(g),timestamp:e.string().max(64),sequence:e.number().int().nonnegative().optional(),step:e.object({id:e.string().max(256),name:e.string().max(256),index:e.number(),total:e.number(),status:e.string().max(64)}).strict().optional(),resource:e.object({logicalId:e.string().max(256),resourceType:e.string().max(256),category:e.enum(c),group:e.string().max(128).optional(),constructPath:e.string().max(512).optional(),displayName:e.string().max(256),status:e.string().max(64),statusReason:e.string().max(l).optional(),physicalId:e.string().max(2048).optional(),expectedDurationSeconds:e.number().optional(),stack:e.string().max(256).optional()}).strict().optional(),docker:e.object({message:e.string().max(2048),percentage:e.number().optional()}).strict().optional(),ecs:e.object({status:e.string().max(64),message:e.string().max(2048).optional(),percentage:e.number().optional()}).strict().optional(),error:e.object({message:e.string().max(p),category:e.string().max(128).optional(),remediation:e.array(e.string().max(1024)).max(10).optional()}).strict().optional(),message:e.string().max(2048).optional(),cascadePhase:e.object({phase:e.enum(n),status:e.enum(["started","completed"])}).strict().optional(),cascadeAccount:e.object({accountId:e.string().max(32),region:e.string().max(32),operationKey:e.string().max(256),status:e.enum(m),error:e.string().max(2048).optional(),phase:e.enum(["bootstrap","synth","deploy","destroy"]).optional(),cascadePhase:e.enum(n).optional()}).strict().optional(),cascadeMissingAccounts:e.object({accountNames:e.array(e.string().max(256)).max(256)}).strict().optional(),parallelPhase:e.object({stacks:e.array(e.string().max(256)).max(20),status:e.enum(["started","completed"]),results:e.array(e.object({stack:e.string().max(256),success:e.boolean(),error:e.string().max(2048).optional()}).strict()).max(20).optional()}).strict().optional(),detection:e.object({pattern:e.string().max(128).nullable(),hasDockerfile:e.boolean(),hasDifferences:e.boolean(),resources:e.object({hasNetwork:e.boolean(),hasCompute:e.boolean(),hasDatabase:e.boolean(),hasStorage:e.boolean(),hasMessaging:e.boolean(),hasCdn:e.boolean()}).strict(),requiredSecrets:e.array(e.string().max(512)).max(100).optional()}).strict().optional(),trailMigration:e.object({accountId:e.string().max(32),accountName:e.string().max(256),phase:e.enum(r),status:e.enum(i),detail:e.string().max(u).optional()}).strict().optional(),log:e.object({message:e.string().max(2048),level:e.enum(["info","debug","warn"])}).strict().optional()}).strict().superRefine((t,o)=>{const a=d[t.type],s=a?t[a]:void 0;a&&s==null&&o.addIssue({code:e.ZodIssueCode.custom,message:`"${a}" is required when type is "${t.type}"`,path:[a]}),t.type==="complete"&&!t.message&&o.addIssue({code:e.ZodIssueCode.custom,message:'"message" is required when type is "complete"',path:["message"]})});function b(t){if(t==="platform")return"platform";if(t==="account")return"accounts"}export{m as CASCADE_ACCOUNT_STATUSES,n as CASCADE_PHASES,p as DEPLOYMENT_EVENT_ERROR_MESSAGE_MAX,c as DEPLOYMENT_EVENT_RESOURCE_CATEGORIES,l as DEPLOYMENT_EVENT_STATUS_REASON_MAX,u as DEPLOYMENT_EVENT_TRAIL_DETAIL_MAX,g as DEPLOYMENT_EVENT_TYPES,_ as DeploymentEventSchema,b as toCascadePhase};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export { DeploymentEventSchema, DEPLOYMENT_EVENT_TYPES, DEPLOYMENT_EVENT_RESOURCE_CATEGORIES, CASCADE_PHASES, CASCADE_ACCOUNT_STATUSES, toCascadePhase } from "./deploymentEventSchema.js";
|
|
1
|
+
export { DeploymentEventSchema, DEPLOYMENT_EVENT_TYPES, DEPLOYMENT_EVENT_RESOURCE_CATEGORIES, DEPLOYMENT_EVENT_STATUS_REASON_MAX, DEPLOYMENT_EVENT_ERROR_MESSAGE_MAX, DEPLOYMENT_EVENT_TRAIL_DETAIL_MAX, CASCADE_PHASES, CASCADE_ACCOUNT_STATUSES, toCascadePhase } from "./deploymentEventSchema.js";
|
|
2
2
|
export type { DeploymentEvent, DeploymentEventType, DeploymentEventResourceCategory, DeploymentEventCascadePhase, DeploymentEventCascadeAccountStatus } from "./deploymentEventSchema.js";
|
|
3
3
|
export type { AwsCredentials, DeployIdentity } from "./credentials.js";
|
|
4
|
-
export type { DeployCallbacks, StepCompleteStatus } from "./callbacks.js";
|
|
4
|
+
export type { DeployCallbacks, StepCompleteStatus, StackCleanupQuarantineDetail, StackCleanupRetainedBucketsDetail } from "./callbacks.js";
|
|
5
|
+
export { isQuarantineDetail, isRetainedBucketsDetail } from "./callbacks.js";
|
|
5
6
|
export type { ProgressEvent, ProgressEventType, ResourceEvent, AwsAuthResult, CascadeDeploymentResult, CascadePhase, BuildPushStartEvent, BuildPushProgressEvent, BuildPushCompleteEvent, TaskDefRegisteredEvent, ECSCompleteEvent, MigrationsStartEvent, MigrationsCompleteEvent, TrailMigrationPhase, TrailMigrationStatus, TrailMigrationPhaseEvent } from "./events.js";
|
|
6
7
|
export { TRAIL_MIGRATION_PHASES, TRAIL_MIGRATION_STATUSES } from "./events.js";
|
|
7
8
|
export type { ApiClientInterface, EntitlementsData } from "./apiClient.js";
|
|
8
9
|
export type { DeployParams, DeployOptions, DeploymentType, DeployResult, DestroyParams, DestroyOptions, DestroyResult } from "./params.js";
|
|
9
|
-
export type { OrgConfig, ProviderAccount, SSOSession } from "./orgConfig.js";
|
|
10
|
+
export type { OrgConfig, ProviderAccount, RootAccessManagementMode, SSOSession } from "./orgConfig.js";
|
|
10
11
|
export type { Entitlements } from "./entitlements.js";
|
|
11
12
|
export type { StackOutput, StackOutputsRecord, DeploymentContext, StepOutput, ApplicationDeploymentContext, CallerIdentity } from "./deployment/index.js";
|
|
12
13
|
export { stubCallerIdentity } from "./deployment/index.js";
|
|
@@ -21,16 +22,10 @@ export { PARALLEL_OPERATION_TYPES } from "./deployment/index.js";
|
|
|
21
22
|
export type { OpenNextPattern, AppResourceFlags } from "./patternTypes.js";
|
|
22
23
|
export { isOpenNextPattern, OPENNEXT_PATTERNS } from "./patternTypes.js";
|
|
23
24
|
export { deriveResourcesFromManifestStacks } from "./patternDetection.js";
|
|
24
|
-
/** @deprecated Use FrameworkRegistry.resolve() instead */
|
|
25
|
-
export { detectPattern } from "./patternDetection.js";
|
|
26
|
-
/** @deprecated Use FrameworkRegistry.resolve() instead */
|
|
27
|
-
export { detectPayloadPattern } from "./patternDetection.js";
|
|
28
|
-
/** @deprecated Use FrameworkRegistry.resolve() instead */
|
|
29
|
-
export { detectDatabase } from "./patternDetection.js";
|
|
30
25
|
export { STACK_NOT_FOUND_PATTERN, STACK_FAILED_STATE_PATTERN, CDK_NO_STACKS_MATCH, INFRASTRUCTURE_FILENAME } from "./constants.js";
|
|
31
26
|
export { ApplicationError, wrapApplicationError, type ApplicationErrorType, type StackDeploymentData, type StackDeploymentOptions, type ApplicationDeploymentData, type ApplicationDestructionData } from "./application/index.js";
|
|
32
27
|
export type { FjallStateFile, TemplateHashEntry } from "./FjallState.js";
|
|
33
|
-
export { FjallStateFileSchema, readStateFile, writeStateFile, createEmptyState, deleteStateFile, updateTemplateHash, getStateFilePath } from "./FjallState.js";
|
|
28
|
+
export { FjallStateFileSchema, readStateFile, writeStateFile, createEmptyState, deleteStateFile, updateTemplateHash, getStateFilePath, regionSuffix } from "./FjallState.js";
|
|
34
29
|
export type { FrameworkBuilder, FrameworkDetection, BuildPlan, BuildCommand, BuildCallbacks, DetectionContext, BuildOptions } from "./frameworkBuilder.js";
|
|
35
30
|
export { STEP_IDS, STEP_NAMES, INFRASTRUCTURE_STEP_NAMES, INFRA_STEP_NAME } from "./stepDefinitions.js";
|
|
36
31
|
export type { StepId, InfrastructureStepName, StepDefinition, StepDeploymentType, Operation, StepContext } from "./stepDefinitions.js";
|
package/dist/src/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DeploymentEventSchema as
|
|
1
|
+
import{DeploymentEventSchema as t,DEPLOYMENT_EVENT_TYPES as A,DEPLOYMENT_EVENT_RESOURCE_CATEGORIES as T,DEPLOYMENT_EVENT_STATUS_REASON_MAX as r,DEPLOYMENT_EVENT_ERROR_MESSAGE_MAX as S,DEPLOYMENT_EVENT_TRAIL_DETAIL_MAX as _,CASCADE_PHASES as a,CASCADE_ACCOUNT_STATUSES as o,toCascadePhase as p}from"./deploymentEventSchema.js";import{isQuarantineDetail as i,isRetainedBucketsDetail as N}from"./callbacks.js";import{TRAIL_MIGRATION_PHASES as R,TRAIL_MIGRATION_STATUSES as l}from"./events.js";import{stubCallerIdentity as L}from"./deployment/index.js";import{ProgressReporter as n}from"./ProgressEvent.js";import{APPLICATION_STACKS as m,ORGANISATION_TYPES as C,APPLICATION_DEPLOY_ORDER as c,APPLICATION_DESTROY_ORDER as M,OPENNEXT_DEPLOY_ORDER as f,OPENNEXT_DESTROY_ORDER as x,PARALLEL_DEPLOY_GROUPS as Y,PARALLEL_DESTROY_GROUPS as g,OPENNEXT_PARALLEL_GROUPS as F,isApplicationOperation as U,isOrganisationOperation as d,getParallelDeployGroups as G,getParallelDestroyGroups as u,getApplicationDeployOrder as y,getApplicationDestroyOrder as X,getApplicationStackName as h,getOrganisationStackName as k,isApplicationStack as K,getApplicationStepName as V,getApplicationStepId as H,toPascalCase as v}from"./operations.js";import{PARALLEL_OPERATION_TYPES as b}from"./deployment/index.js";import{isOpenNextPattern as B,OPENNEXT_PATTERNS as Q}from"./patternTypes.js";import{deriveResourcesFromManifestStacks as z}from"./patternDetection.js";import{STACK_NOT_FOUND_PATTERN as W,STACK_FAILED_STATE_PATTERN as Z,CDK_NO_STACKS_MATCH as $,INFRASTRUCTURE_FILENAME as ee}from"./constants.js";import{ApplicationError as te,wrapApplicationError as Ae}from"./application/index.js";import{FjallStateFileSchema as re,readStateFile as Se,writeStateFile as _e,createEmptyState as ae,deleteStateFile as oe,updateTemplateHash as pe,getStateFilePath as Oe,regionSuffix as ie}from"./FjallState.js";import{STEP_IDS as Pe,STEP_NAMES as Re,INFRASTRUCTURE_STEP_NAMES as le,INFRA_STEP_NAME as De}from"./stepDefinitions.js";export{c as APPLICATION_DEPLOY_ORDER,M as APPLICATION_DESTROY_ORDER,m as APPLICATION_STACKS,te as ApplicationError,o as CASCADE_ACCOUNT_STATUSES,a as CASCADE_PHASES,$ as CDK_NO_STACKS_MATCH,S as DEPLOYMENT_EVENT_ERROR_MESSAGE_MAX,T as DEPLOYMENT_EVENT_RESOURCE_CATEGORIES,r as DEPLOYMENT_EVENT_STATUS_REASON_MAX,_ as DEPLOYMENT_EVENT_TRAIL_DETAIL_MAX,A as DEPLOYMENT_EVENT_TYPES,t as DeploymentEventSchema,re as FjallStateFileSchema,ee as INFRASTRUCTURE_FILENAME,le as INFRASTRUCTURE_STEP_NAMES,De as INFRA_STEP_NAME,f as OPENNEXT_DEPLOY_ORDER,x as OPENNEXT_DESTROY_ORDER,F as OPENNEXT_PARALLEL_GROUPS,Q as OPENNEXT_PATTERNS,C as ORGANISATION_TYPES,Y as PARALLEL_DEPLOY_GROUPS,g as PARALLEL_DESTROY_GROUPS,b as PARALLEL_OPERATION_TYPES,n as ProgressReporter,Z as STACK_FAILED_STATE_PATTERN,W as STACK_NOT_FOUND_PATTERN,Pe as STEP_IDS,Re as STEP_NAMES,R as TRAIL_MIGRATION_PHASES,l as TRAIL_MIGRATION_STATUSES,ae as createEmptyState,oe as deleteStateFile,z as deriveResourcesFromManifestStacks,y as getApplicationDeployOrder,X as getApplicationDestroyOrder,h as getApplicationStackName,H as getApplicationStepId,V as getApplicationStepName,k as getOrganisationStackName,G as getParallelDeployGroups,u as getParallelDestroyGroups,Oe as getStateFilePath,U as isApplicationOperation,K as isApplicationStack,B as isOpenNextPattern,d as isOrganisationOperation,i as isQuarantineDetail,N as isRetainedBucketsDetail,Se as readStateFile,ie as regionSuffix,L as stubCallerIdentity,p as toCascadePhase,v as toPascalCase,pe as updateTemplateHash,Ae as wrapApplicationError,_e as writeStateFile};
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* Passed to CDK via -c orgConfig=<json> context at synthesis time.
|
|
9
9
|
* See: investigations/2026-03-16-config-split-investigation.md
|
|
10
10
|
*/
|
|
11
|
-
import type { ProviderAccount, SSOSession } from "@fjall/util/config";
|
|
12
|
-
export type { ProviderAccount, SSOSession };
|
|
11
|
+
import type { ProviderAccount, RootAccessManagementMode, SSOSession } from "@fjall/util/config";
|
|
12
|
+
export type { ProviderAccount, RootAccessManagementMode, SSOSession };
|
|
13
13
|
export interface OrgConfig {
|
|
14
14
|
providerAccounts: ProviderAccount[];
|
|
15
15
|
primaryRegion?: string;
|
|
@@ -17,4 +17,10 @@ export interface OrgConfig {
|
|
|
17
17
|
disasterRecoveryRegion?: string;
|
|
18
18
|
rootOidcRoleArn?: string;
|
|
19
19
|
ssoSessions?: Record<string, SSOSession>;
|
|
20
|
+
/**
|
|
21
|
+
* Centralised root-access opt-out. Absent ⇒ default-on ("centralised");
|
|
22
|
+
* "off" maps to OrgSetupConfig.skipRootAccessManagement at the adapter
|
|
23
|
+
* boundary — the engine never sees this union.
|
|
24
|
+
*/
|
|
25
|
+
rootAccessManagement?: RootAccessManagementMode;
|
|
20
26
|
}
|
|
@@ -72,6 +72,11 @@ export interface DeployOptions {
|
|
|
72
72
|
serviceName?: string;
|
|
73
73
|
/** Skip the pre-rollout migrations RunTask. Honoured by the code-only orchestrator. */
|
|
74
74
|
skipMigrations?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Skip the pre-deploy TARGET_READINESS probe. The step still emits and
|
|
77
|
+
* completes as "skipped" so the bypass is recorded in output (AC2b.3).
|
|
78
|
+
*/
|
|
79
|
+
skipReadinessCheck?: boolean;
|
|
75
80
|
/**
|
|
76
81
|
* Roll forward/back to an existing image tag. When set, the orchestrator skips
|
|
77
82
|
* build + push and rolls ECS to `<repo>:<imageTag>`. Implies `deployOnly`.
|
|
@@ -129,6 +134,13 @@ export interface DestroyParams {
|
|
|
129
134
|
* Worker: provide this from DB, omit apiClient.
|
|
130
135
|
*/
|
|
131
136
|
identity?: DeployIdentity;
|
|
137
|
+
/**
|
|
138
|
+
* Caller shutdown signal. Stack-cleanup probes, bucket pre-empty/orphan
|
|
139
|
+
* sweeps, and the failed-stack deletion poll compose this with their own
|
|
140
|
+
* per-request timeouts so SIGTERM is not stalled by an in-flight call
|
|
141
|
+
* (mirrors DeployParams.abortSignal).
|
|
142
|
+
*/
|
|
143
|
+
abortSignal?: AbortSignal;
|
|
132
144
|
}
|
|
133
145
|
export interface DestroyOptions {
|
|
134
146
|
/** Skip interactive confirmation prompts */
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Pure types and predicates live in patternTypes.ts (browser-safe).
|
|
5
5
|
* This file contains only functions that require Node fs access.
|
|
6
6
|
*/
|
|
7
|
-
import type { PatternType } from "@fjall/generator";
|
|
8
7
|
export type { OpenNextPattern, AppResourceFlags } from "./patternTypes.js";
|
|
9
8
|
export { OPENNEXT_PATTERNS, isOpenNextPattern } from "./patternTypes.js";
|
|
10
9
|
import type { AppResourceFlags } from "./patternTypes.js";
|
|
@@ -15,27 +14,3 @@ export declare function deriveResourcesFromManifestStacks(stackNames: string[]):
|
|
|
15
14
|
* Returns null if file doesn't exist or can't be read.
|
|
16
15
|
*/
|
|
17
16
|
export declare function readInfrastructureContent(appPath: string): string | null;
|
|
18
|
-
/**
|
|
19
|
-
* Detect the application pattern (Payload, Next.js, or none) from infrastructure.ts.
|
|
20
|
-
*
|
|
21
|
-
* Pattern detection is based on the IaC file (infrastructure.ts), NOT on
|
|
22
|
-
* project files like package.json. This ensures accurate detection even
|
|
23
|
-
* when multiple apps coexist in the same project directory.
|
|
24
|
-
*
|
|
25
|
-
* @deprecated Use FrameworkRegistry.resolve() instead. This function is retained
|
|
26
|
-
* for backwards compatibility with consumers that have not yet migrated.
|
|
27
|
-
*
|
|
28
|
-
* @param appPath - The fjall app path (e.g., "fjall/app8" or absolute path)
|
|
29
|
-
*/
|
|
30
|
-
export declare function detectPattern(appPath: string): {
|
|
31
|
-
pattern: PatternType | null;
|
|
32
|
-
hasDatabase: boolean;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Detect if infrastructure.ts contains a Payload CMS pattern.
|
|
36
|
-
*/
|
|
37
|
-
export declare function detectPayloadPattern(appPath: string): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Detect if infrastructure.ts contains a database resource.
|
|
40
|
-
*/
|
|
41
|
-
export declare function detectDatabase(appPath: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as
|
|
1
|
+
import{existsSync as s,readFileSync as a}from"fs";import{join as i}from"path";import{logger as f}from"@fjall/util/logger";import{getErrorMessage as m}from"@fjall/util";import{APPLICATION_STACKS as e}from"./operations.js";import{INFRASTRUCTURE_FILENAME as u}from"./constants.js";import{OPENNEXT_PATTERNS as g,isOpenNextPattern as C}from"./patternTypes.js";function p(t){const r=o=>t.some(n=>n.endsWith(o));return{hasNetwork:r(e.NETWORK),hasCompute:r(e.COMPUTE),hasDatabase:r(e.DATABASE),hasStorage:r(e.STORAGE),hasMessaging:r(e.MESSAGING),hasCdn:r(e.CDN)}}function h(t){try{const r=i(t,u);return s(r)?a(r,"utf-8"):null}catch(r){return f.debug("patternDetection","Failed to read infrastructure file",{appPath:t,error:m(r)}),null}}export{g as OPENNEXT_PATTERNS,p as deriveResourcesFromManifestStacks,C as isOpenNextPattern,h as readInfrastructureContent};
|
|
@@ -15,6 +15,7 @@ import type { AppResourceFlags } from "./patternTypes.js";
|
|
|
15
15
|
export declare const STEP_IDS: {
|
|
16
16
|
readonly AUTH: "auth";
|
|
17
17
|
readonly DETECT_CONFIG: "detect-config";
|
|
18
|
+
readonly TARGET_READINESS: "target-readiness";
|
|
18
19
|
readonly BOOTSTRAP: "bootstrap";
|
|
19
20
|
readonly CFN_CHECK: "cfn-check";
|
|
20
21
|
readonly DIFF: "diff";
|
|
@@ -71,6 +72,7 @@ export declare const STEP_NAMES: {
|
|
|
71
72
|
readonly AUTH: "Authenticating with AWS";
|
|
72
73
|
readonly PREPARE_DEPLOY: "Preparing deployment";
|
|
73
74
|
readonly PREPARE_DESTROY: "Preparing destruction";
|
|
75
|
+
readonly TARGET_READINESS: "Verifying target readiness";
|
|
74
76
|
readonly BOOTSTRAP: "Bootstrapping AWS environment";
|
|
75
77
|
readonly CHECK_INFRA_STATE: "Checking infrastructure state";
|
|
76
78
|
readonly ORG_SETUP: "Configuring organisation";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const E={AUTH:"auth",DETECT_CONFIG:"detect-config",BOOTSTRAP:"bootstrap",CFN_CHECK:"cfn-check",DIFF:"diff",DEPLOY:"deploy",DESTROY:"destroy",VERIFY:"verify",CDK_SYNTH:"cdk-synth",DOCKER_OPERATIONS:"docker-operations",ECR_INIT:"ecr-init",DOCKER_DEPLOY:"docker-deploy",TAG_ECR_IMAGES:"tag-ecr-images",ORG_SETUP:"org-setup",ORG_ENSURE:"org-ensure",ORG_POLICY_TYPES:"policy-types",ORG_SERVICE_ACCESS:"service-access",ORG_CREATE_ACCOUNTS:"create-accounts",ORG_ENSURE_OUS:"ensure-ous",ORG_PLACE_ACCOUNTS:"place-accounts",IDENTITY_CENTRE:"identity-centre",ORG_ACCOUNTS:"accounts",ORG_COST_TAGS:"cost-tags",ORG_PROFILES:"profiles",PREPARE:"prepare",PREPARE_ENVIRONMENT:"prepare-environment",PLATFORM_ACCOUNT:"platform-account",ACCOUNT_CONTEXT:"account-context",CONNECT:"connect",MONITORING:"monitoring",ORG_DEPLOY:"organisation-deploy",ORG_DESTROY:"organisation-destroy",CASCADE_PLATFORM:"cascade-platform",CASCADE_DOMAINS:"cascade-domains",CASCADE_ACCOUNTS:"cascade-accounts",NETWORK:"network",STORAGE:"storage",MESSAGING:"messaging",DATABASE:"database",COMPUTE:"compute",CDN:"cdn",NETWORK_DESTROY:"network-destroy",STORAGE_DESTROY:"storage-destroy",MESSAGING_DESTROY:"messaging-destroy",DATABASE_DESTROY:"database-destroy",COMPUTE_DESTROY:"compute-destroy",CDN_DESTROY:"cdn-destroy"},t={AUTH:"Authenticating with AWS",PREPARE_DEPLOY:"Preparing deployment",PREPARE_DESTROY:"Preparing destruction",BOOTSTRAP:"Bootstrapping AWS environment",CHECK_INFRA_STATE:"Checking infrastructure state",ORG_SETUP:"Configuring organisation",ORG_DEPLOY:"Deploying organisation",CASCADE_PLATFORM:"Deploying platform",CASCADE_ACCOUNTS:"Deploying accounts"},e=["Connect securely","Prepare environment","Deploy infrastructure","Enable monitoring"],o={CONNECT:e[0],PREPARE:e[1],DEPLOY:e[2],MONITORING:e[3]};export{e as INFRASTRUCTURE_STEP_NAMES,o as INFRA_STEP_NAME,E as STEP_IDS,t as STEP_NAMES};
|
|
1
|
+
const E={AUTH:"auth",DETECT_CONFIG:"detect-config",TARGET_READINESS:"target-readiness",BOOTSTRAP:"bootstrap",CFN_CHECK:"cfn-check",DIFF:"diff",DEPLOY:"deploy",DESTROY:"destroy",VERIFY:"verify",CDK_SYNTH:"cdk-synth",DOCKER_OPERATIONS:"docker-operations",ECR_INIT:"ecr-init",DOCKER_DEPLOY:"docker-deploy",TAG_ECR_IMAGES:"tag-ecr-images",ORG_SETUP:"org-setup",ORG_ENSURE:"org-ensure",ORG_POLICY_TYPES:"policy-types",ORG_SERVICE_ACCESS:"service-access",ORG_CREATE_ACCOUNTS:"create-accounts",ORG_ENSURE_OUS:"ensure-ous",ORG_PLACE_ACCOUNTS:"place-accounts",IDENTITY_CENTRE:"identity-centre",ORG_ACCOUNTS:"accounts",ORG_COST_TAGS:"cost-tags",ORG_PROFILES:"profiles",PREPARE:"prepare",PREPARE_ENVIRONMENT:"prepare-environment",PLATFORM_ACCOUNT:"platform-account",ACCOUNT_CONTEXT:"account-context",CONNECT:"connect",MONITORING:"monitoring",ORG_DEPLOY:"organisation-deploy",ORG_DESTROY:"organisation-destroy",CASCADE_PLATFORM:"cascade-platform",CASCADE_DOMAINS:"cascade-domains",CASCADE_ACCOUNTS:"cascade-accounts",NETWORK:"network",STORAGE:"storage",MESSAGING:"messaging",DATABASE:"database",COMPUTE:"compute",CDN:"cdn",NETWORK_DESTROY:"network-destroy",STORAGE_DESTROY:"storage-destroy",MESSAGING_DESTROY:"messaging-destroy",DATABASE_DESTROY:"database-destroy",COMPUTE_DESTROY:"compute-destroy",CDN_DESTROY:"cdn-destroy"},t={AUTH:"Authenticating with AWS",PREPARE_DEPLOY:"Preparing deployment",PREPARE_DESTROY:"Preparing destruction",TARGET_READINESS:"Verifying target readiness",BOOTSTRAP:"Bootstrapping AWS environment",CHECK_INFRA_STATE:"Checking infrastructure state",ORG_SETUP:"Configuring organisation",ORG_DEPLOY:"Deploying organisation",CASCADE_PLATFORM:"Deploying platform",CASCADE_ACCOUNTS:"Deploying accounts"},e=["Connect securely","Prepare environment","Deploy infrastructure","Enable monitoring"],o={CONNECT:e[0],PREPARE:e[1],DEPLOY:e[2],MONITORING:e[3]};export{e as INFRASTRUCTURE_STEP_NAMES,o as INFRA_STEP_NAME,E as STEP_IDS,t as STEP_NAMES};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/deploy-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"description": "Shared deployment engine for Fjall — used by CLI and webapp worker",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -69,15 +69,17 @@
|
|
|
69
69
|
"@aws-sdk/client-cost-explorer": "^3.1038.0",
|
|
70
70
|
"@aws-sdk/client-ec2": "^3.1038.0",
|
|
71
71
|
"@aws-sdk/client-ecr": "^3.1039.0",
|
|
72
|
+
"@aws-sdk/client-iam": "^3.1038.0",
|
|
72
73
|
"@aws-sdk/client-kms": "^3.1065.0",
|
|
73
74
|
"@aws-sdk/client-organizations": "^3.1038.0",
|
|
74
75
|
"@aws-sdk/client-ram": "^3.1038.0",
|
|
75
76
|
"@aws-sdk/client-s3": "^3.1038.0",
|
|
76
77
|
"@aws-sdk/client-secrets-manager": "^3.1038.0",
|
|
78
|
+
"@aws-sdk/client-sqs": "^3.1067.0",
|
|
77
79
|
"@aws-sdk/client-sso-admin": "^3.1038.0",
|
|
78
80
|
"@aws-sdk/client-sts": "^3.1038.0",
|
|
79
|
-
"@fjall/generator": "^2.
|
|
80
|
-
"@fjall/util": "^2.
|
|
81
|
+
"@fjall/generator": "^2.14.0",
|
|
82
|
+
"@fjall/util": "^2.14.0",
|
|
81
83
|
"@smithy/node-http-handler": "^4.6.1",
|
|
82
84
|
"tsx": "^4.21.0",
|
|
83
85
|
"zod": "^4.4.3"
|
|
@@ -86,5 +88,5 @@
|
|
|
86
88
|
"@types/node": "^25.6.0",
|
|
87
89
|
"vitest": "^4.1.5"
|
|
88
90
|
},
|
|
89
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "ce434478f9e3d5e5ccf979c152a237c81e4acee5"
|
|
90
92
|
}
|