@fjall/deploy-core 3.11.0 → 4.0.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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
234 files minified at 2026-07-
|
|
1
|
+
234 files minified at 2026-07-24T06:41:58.672Z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var a=Object.defineProperty;var t=(o,r)=>a(o,"name",{value:r,configurable:!0});import{GetRoleCommand as c}from"@aws-sdk/client-iam";import{success as i,failure as s}from"@fjall/generator";import{accountTier as l,getErrorMessage as u}from"@fjall/util";import{ACCOUNT_MONITORING_ROLE_NAME as p}from"@fjall/util/aws";import{composeSdkAbortSignal as g}from"./types.js";const n=p;async function E(o,r){try{return await o.send(new c({RoleName:n}),{abortSignal:g(r)}),i(!0)}catch(e){return e instanceof Error&&e.name==="NoSuchEntityException"?i(!1):s(new Error(`Failed to probe account globals (role "${n}"): ${u(e)}`))}}t(E,"describeAccountGlobalsExist");function d(o){return(o??[]).some(r=>l(r)==="organisation")}t(d,"hasOrganisationTierAccount");function O(o){const e=d(o.providerAccounts)?`run \`fjall deploy
|
|
1
|
+
var a=Object.defineProperty;var t=(o,r)=>a(o,"name",{value:r,configurable:!0});import{GetRoleCommand as c}from"@aws-sdk/client-iam";import{success as i,failure as s}from"@fjall/generator";import{accountTier as l,getErrorMessage as u}from"@fjall/util";import{ACCOUNT_MONITORING_ROLE_NAME as p}from"@fjall/util/aws";import{composeSdkAbortSignal as g}from"./types.js";const n=p;async function E(o,r){try{return await o.send(new c({RoleName:n}),{abortSignal:g(r)}),i(!0)}catch(e){return e instanceof Error&&e.name==="NoSuchEntityException"?i(!1):s(new Error(`Failed to probe account globals (role "${n}"): ${u(e)}`))}}t(E,"describeAccountGlobalsExist");function d(o){return(o??[]).some(r=>l(r)==="organisation")}t(d,"hasOrganisationTierAccount");function O(o){const e=d(o.providerAccounts)?`run \`fjall org deploy\` to provision the primary region (${o.primaryRegion}), then retry this deploy`:`target the primary region (${o.primaryRegion}) and run \`fjall account deploy\`, then retry this deploy`;return`Cannot deploy "${o.target}" into ${o.deployRegion}: the account globals (fixed-name IAM resources such as the ${n} role) are created only in the primary region (${o.primaryRegion}) and were not found in this account. Nothing has been deployed. Deploy the primary region first: ${e}.`}t(O,"buildMissingAccountGlobalsAdvisory");export{n as ACCOUNT_GLOBALS_ROLE_NAME,O as buildMissingAccountGlobalsAdvisory,E as describeAccountGlobalsExist,d as hasOrganisationTierAccount};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _=Object.defineProperty;var s=(e,t)=>_(e,"name",{value:t,configurable:!0});import{DescribeStacksCommand as P}from"@aws-sdk/client-cloudformation";import{DescribeIpamPoolsCommand as R}from"@aws-sdk/client-ec2";import{success as c,failure as d}from"@fjall/generator";import{accountTier as E,generateTargetName as k,getErrorMessage as T}from"@fjall/util";import{formatIpamPairTagValue as w,IPAM_OPERATIONS_POOL_TAG_KEY as $,STACK_NOT_FOUND_PATTERN as L}from"@fjall/util/aws";import{getOrganisationStackName as I,ORGANISATION_TYPES as S}from"../types/operations.js";import{hasOrganisationTierAccount as h}from"./organisations/accountGlobals.js";import{composeSdkAbortSignal as N,isAborted as C}from"./organisations/types.js";const g=I(S.ACCOUNT),b=I(S.PLATFORM),v=new Set(["CREATE_FAILED","ROLLBACK_IN_PROGRESS","ROLLBACK_COMPLETE","ROLLBACK_FAILED","REVIEW_IN_PROGRESS","DELETE_IN_PROGRESS","DELETE_FAILED"]);function x(e){switch(e.kind){case"missing-account-stack":return`the ${e.stackName} stack was not found in ${e.region}`;case"missing-ipam-pool":return`no IPAM pool exists for account ${e.accountId} in ${e.region}`}}s(x,"describeTargetReadinessReason");function M(e){const t=e.accountName??e.accountId,n=e.reasons.map(x).join(" and "),o=e.accountName!==void 0?`run \`fjall target set ${k(e.accountName,e.region)}\` then \`fjall deploy
|
|
1
|
+
var _=Object.defineProperty;var s=(e,t)=>_(e,"name",{value:t,configurable:!0});import{DescribeStacksCommand as P}from"@aws-sdk/client-cloudformation";import{DescribeIpamPoolsCommand as R}from"@aws-sdk/client-ec2";import{success as c,failure as d}from"@fjall/generator";import{accountTier as E,generateTargetName as k,getErrorMessage as T}from"@fjall/util";import{formatIpamPairTagValue as w,IPAM_OPERATIONS_POOL_TAG_KEY as $,STACK_NOT_FOUND_PATTERN as L}from"@fjall/util/aws";import{getOrganisationStackName as I,ORGANISATION_TYPES as S}from"../types/operations.js";import{hasOrganisationTierAccount as h}from"./organisations/accountGlobals.js";import{composeSdkAbortSignal as N,isAborted as C}from"./organisations/types.js";const g=I(S.ACCOUNT),b=I(S.PLATFORM),v=new Set(["CREATE_FAILED","ROLLBACK_IN_PROGRESS","ROLLBACK_COMPLETE","ROLLBACK_FAILED","REVIEW_IN_PROGRESS","DELETE_IN_PROGRESS","DELETE_FAILED"]);function x(e){switch(e.kind){case"missing-account-stack":return`the ${e.stackName} stack was not found in ${e.region}`;case"missing-ipam-pool":return`no IPAM pool exists for account ${e.accountId} in ${e.region}`}}s(x,"describeTargetReadinessReason");function M(e){const t=e.accountName??e.accountId,n=e.reasons.map(x).join(" and "),o=e.accountName!==void 0?`run \`fjall target set ${k(e.accountName,e.region)}\` then \`fjall account deploy\`, then retry this deploy`:"run `fjall target list` to find the target name, `fjall target set <target>`, then `fjall account deploy`, then retry this deploy",a=h(e.providerAccounts)?"run `fjall org deploy` (the cascade provisions every account and creates the IPAM pool), then retry this deploy":o;return`Target "${t}" is not ready in ${e.region}: ${n}. Nothing has been deployed. Provision the target first: ${a}.`}s(M,"buildTargetUnreadyAdvisory");function F(e){return e instanceof Error&&e.name==="ValidationError"&&e.message.includes(L)}s(F,"isStackNotFoundError");async function D(e,t,n,o=g){try{const r=(await e.send(new P({StackName:o}),{abortSignal:N(n)})).Stacks?.[0]?.StackStatus;return c(r!==void 0&&!v.has(r))}catch(a){return F(a)?c(!1):d(new Error(`Failed to probe the ${o} stack in ${t}: ${T(a)}`))}}s(D,"probeAccountStackExists");function K(e,t,n,o){return e.Locale!==n?!1:o.side==="owner"?(e.Tags??[]).some(a=>a.Key===$&&a.Value===o.pairTagValue):e.OwnerId===t?!1:o.platformAccountId===void 0||e.OwnerId===o.platformAccountId}s(K,"matchesIpamPair");async function j(e,t,n,o,a){try{let r;do{if(C(a))return d(new Error(`Aborted: IPAM pool probe for account ${t} in ${n} cancelled by shutdown signal`));const i=await e.send(new R({...r!==void 0&&{NextToken:r}}),{abortSignal:N(a)});if((i.IpamPools??[]).some(u=>K(u,t,n,o)))return c(!0);r=i.NextToken}while(r!==void 0);return c(!1)}catch(r){return d(new Error(`Failed to probe IPAM pools for account ${t} in ${n}: ${T(r)}`))}}s(j,"probeIpamPoolExists");async function J(e,t,n,o,a){const r=[],i=o?.providerAccounts,l=(i??[]).find(f=>f.id===t.id),u=l!==void 0&&E(l)==="platform",A=u?b:g,m=await D(e.cloudFormation,n,a,A);if(!m.success)return d(m.error);if(m.data||r.push({kind:"missing-account-stack",stackName:A,region:n}),h(i)){const f=(i??[]).find(O=>E(O)==="platform")?.id,y=u?{side:"owner",pairTagValue:w(t.id,n)}:{side:"consumer",...f!==void 0&&{platformAccountId:f}},p=await j(e.ec2,t.id,n,y,a);if(!p.success)return d(p.error);p.data||r.push({kind:"missing-ipam-pool",accountId:t.id,region:n})}return r.length===0?c({ready:!0}):c({ready:!1,reasons:r,advisory:M({accountId:t.id,...t.name!==void 0&&{accountName:t.name},region:n,reasons:r,...o!==void 0&&{providerAccounts:o.providerAccounts}})})}s(J,"checkTargetReadiness");export{g as ACCOUNT_STACK_NAME,M as buildTargetUnreadyAdvisory,J as checkTargetReadiness,x as describeTargetReadinessReason,D as probeAccountStackExists};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var r=Object.defineProperty;var e=(o,n)=>r(o,"name",{value:n,configurable:!0});import{hasOrganisationTierAccount as
|
|
1
|
+
var r=Object.defineProperty;var e=(o,n)=>r(o,"name",{value:n,configurable:!0});import{hasOrganisationTierAccount as c}from"./organisations/accountGlobals.js";import{describeTargetReadinessReason as a}from"./targetReadiness.js";function l(o){const n=o.accountName??o.accountId,t=o.reasons.map(a).join(" and "),i=c(o.providerAccounts)?"Run `fjall org deploy` \u2014 the cascade provisions every account and creates the IPAM pool":"Run `fjall account deploy` to provision it";return`Target "${n}" is not ready in ${o.region}: ${t}. ${i}.`}e(l,"buildTargetSetUnreadyAdvisory");export{l as buildTargetSetUnreadyAdvisory};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/deploy-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.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",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"@aws-sdk/client-ssm": "^3.1038.0",
|
|
89
89
|
"@aws-sdk/client-sso-admin": "^3.1038.0",
|
|
90
90
|
"@aws-sdk/client-sts": "^3.1038.0",
|
|
91
|
-
"@fjall/generator": "^
|
|
92
|
-
"@fjall/util": "^
|
|
91
|
+
"@fjall/generator": "^4.0.0",
|
|
92
|
+
"@fjall/util": "^4.0.0",
|
|
93
93
|
"@smithy/node-http-handler": "^4.6.1",
|
|
94
94
|
"aws-cdk": "^2.1128.1",
|
|
95
95
|
"tsx": "^4.21.0",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"typescript": "^6.0.3",
|
|
101
101
|
"vitest": "^4.1.5"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "14031063ccd2685e390b70f6a3f4efe2bac7ced9"
|
|
104
104
|
}
|