@fjall/generator 4.3.0 → 4.4.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
|
-
146 files minified at 2026-07-
|
|
1
|
+
146 files minified at 2026-07-30T00:34:10.939Z
|
|
@@ -113,6 +113,30 @@ export declare function devSyncSubject(fjallOrgId: string): string;
|
|
|
113
113
|
* FjallMachineSubject statement, never by the user or service statements.
|
|
114
114
|
*/
|
|
115
115
|
export declare function deployAccountSubject(fjallOrgId: string, awsAccountId: string): string;
|
|
116
|
+
/**
|
|
117
|
+
* Generic machine subject — the shared literal every non-flipped machine mint
|
|
118
|
+
* issues and the pre-§4.4a trust accepts. Same cross-package coupled-value
|
|
119
|
+
* contract as {@link deployAccountSubject}: the webapp mint, the trust builder
|
|
120
|
+
* below, and the dev-gate trust probe must all route through THIS helper
|
|
121
|
+
* rather than re-deriving the string.
|
|
122
|
+
*/
|
|
123
|
+
export declare function genericMachineSubject(fjallOrgId: string): string;
|
|
124
|
+
/**
|
|
125
|
+
* The service subjects the FjallDeploy trust accepts (see
|
|
126
|
+
* {@link buildNarrowedDeployTrustStatements} for why `dev-substrate-setup`
|
|
127
|
+
* rides the admin role). Single source for the vocabulary — consumers deriving
|
|
128
|
+
* runtime accept-sets or minting these subjects must use this tuple, never a
|
|
129
|
+
* re-listed copy.
|
|
130
|
+
*/
|
|
131
|
+
export declare const DEPLOY_SERVICE_SUBJECT_NAMES: readonly ["discovery", "connection", "org-setup", "dev-substrate-setup"];
|
|
132
|
+
export type DeployServiceSubjectName = (typeof DEPLOY_SERVICE_SUBJECT_NAMES)[number];
|
|
133
|
+
/**
|
|
134
|
+
* Server-minted service subject for the FjallDeploy-role service family.
|
|
135
|
+
* Coupled cross-package value ({@link deployAccountSubject} contract): the
|
|
136
|
+
* webapp's discovery credential provider and job handlers mint these exact
|
|
137
|
+
* strings.
|
|
138
|
+
*/
|
|
139
|
+
export declare function serviceSubject(fjallOrgId: string, service: DeployServiceSubjectName): string;
|
|
116
140
|
/**
|
|
117
141
|
* One statement of an OIDC federated trust (assume-role policy) document.
|
|
118
142
|
* Distinct from `BoundaryStatement` because trust statements carry a
|
|
@@ -134,6 +158,20 @@ export interface OidcTrustParams {
|
|
|
134
158
|
/** Issuer domain without scheme, e.g. `fjall.io`. */
|
|
135
159
|
issuerDomain: string;
|
|
136
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* §4.4a machine-trust rendering mode for the FjallDeploy role.
|
|
163
|
+
*
|
|
164
|
+
* - `"expanded"` (default): governance renders `[generic, acct]` — a SUPERSET
|
|
165
|
+
* of the pre-§4.4a trust, safe for every org because off-allowlist mints
|
|
166
|
+
* still issue the generic subject.
|
|
167
|
+
* - `"account-scoped"` (Step-3 contract): the machine statement accepts ONLY
|
|
168
|
+
* the account-scoped literal. Opt-in per deployment — NEVER the shared
|
|
169
|
+
* default: issuance for most orgs still mints the generic subject, so a
|
|
170
|
+
* default contract would lock their governance CI out at STS. Set it only
|
|
171
|
+
* where per-account issuance is known-flipped (Fjall's own governance
|
|
172
|
+
* accounts today; §4.4b's probe gate machine-sets it later).
|
|
173
|
+
*/
|
|
174
|
+
export type MachineTrustMode = "expanded" | "account-scoped";
|
|
137
175
|
/**
|
|
138
176
|
* Params for the narrowed FjallDeploy trust, with the optional §4.4a
|
|
139
177
|
* governance-expand fields. A superset of {@link OidcTrustParams}: existing
|
|
@@ -155,6 +193,14 @@ export interface NarrowedDeployTrustParams extends OidcTrustParams {
|
|
|
155
193
|
* unless `accountTier` is governance.
|
|
156
194
|
*/
|
|
157
195
|
accountId?: string;
|
|
196
|
+
/**
|
|
197
|
+
* {@link MachineTrustMode}. Absent ⇒ `"expanded"`. `"account-scoped"`
|
|
198
|
+
* REQUIRES a governance `accountTier` and an `accountId` — anything else
|
|
199
|
+
* throws at synth rather than falling back to the generic literal (the
|
|
200
|
+
* expand-mode fail-safe inverts under contract: a silent generic fallback
|
|
201
|
+
* would re-widen the exact trust Step 3 exists to remove).
|
|
202
|
+
*/
|
|
203
|
+
machineTrustMode?: MachineTrustMode;
|
|
158
204
|
}
|
|
159
205
|
/**
|
|
160
206
|
* G4 narrowed trust for `FjallDeploy{orgId}` — replaces the single bare
|
|
@@ -180,6 +226,11 @@ export interface NarrowedDeployTrustParams extends OidcTrustParams {
|
|
|
180
226
|
* absent tier renders the generic-only machine subject unchanged; a governance
|
|
181
227
|
* tier WITHOUT `accountId` falls back to generic-only (fail-safe — never widen
|
|
182
228
|
* to a bare wildcard we cannot bind to an account).
|
|
229
|
+
*
|
|
230
|
+
* §4.4a Step-3 contract: `machineTrustMode: "account-scoped"` renders the
|
|
231
|
+
* account-scoped literal ONLY (no generic member). Opt-in per deployment —
|
|
232
|
+
* see {@link MachineTrustMode} for why the shared default stays `"expanded"`
|
|
233
|
+
* and why misuse throws instead of falling back.
|
|
183
234
|
*/
|
|
184
235
|
export declare function buildNarrowedDeployTrustStatements(params: NarrowedDeployTrustParams): OidcTrustStatement[];
|
|
185
236
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var g=Object.defineProperty;var a=(e,t)=>g(e,"name",{value:t,configurable:!0});import{isGovernanceTier as f}from"@fjall/util";const w="fjall.io",i="sts.amazonaws.com",E="0000000000000000000000000000000000000000";function p(e){return`FjallDevDeploy${e}`}a(p,"devDeployRoleName");function y(e){return`FjallDevProvisioner${e}`}a(y,"devProvisionerRoleName");function b(e){return`FjallDevSyncWriter${e}`}a(b,"devSyncWriterRoleName");const P="FjallDevDeployPolicy",F="FjallDevProvisionerPolicy",T="FjallDevSyncWriterPolicy",v="FjallDevBoundary";function S(e){return`arn:aws:iam::${e}:policy/${v}`}a(S,"devBoundaryPolicyArn");function A(e){return`org:${e}:dev-provisioner`}a(A,"devProvisionerSubject");function D(e){return`org:${e}:dev-sync`}a(D,"devSyncSubject");function m(e,t){return`org:${e}:acct:${t}`}a(m,"deployAccountSubject");function $(e){const{fjallOrgId:t,providerArn:o,issuerDomain:r,accountTier:l,accountId:n}=e,s={[`${r}:aud`]:i},c=`org:${t}:*`,d=l!==void 0&&f(l)&&n!==void 0?[c,m(t,n)]:c;return[{Sid:"FjallMachineSubject",Effect:"Allow",Principal:{Federated:o},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...s,[`${r}:sub`]:d}}},{Sid:"FjallUserSubjects",Effect:"Allow",Principal:{Federated:o},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:s,StringLike:{[`${r}:sub`]:`org:${t}:user:*`}}},{Sid:"FjallServiceSubjects",Effect:"Allow",Principal:{Federated:o},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...s,[`${r}:sub`]:[`org:${t}:discovery`,`org:${t}:connection`,`org:${t}:org-setup`,`org:${t}:dev-substrate-setup`]}}}]}a($,"buildNarrowedDeployTrustStatements");function C(e){const{fjallOrgId:t,providerArn:o,issuerDomain:r,accountId:l}=e;return[{Sid:"FjallDevSubjectsThisAccount",Effect:"Allow",Principal:{Federated:o},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${r}:aud`]:i},StringLike:{[`${r}:sub`]:`org:${t}:dev:${l}:*`}}}]}a(C,"buildDevDeployTrustStatements");function u(e){const{providerArn:t,issuerDomain:o,sid:r,subject:l}=e;return[{Sid:r,Effect:"Allow",Principal:{Federated:t},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${o}:aud`]:i,[`${o}:sub`]:l}}}]}a(u,"buildServiceSubjectTrustStatements");function L(e){return u({...e,sid:"FjallDevProvisionerSubject",subject:A(e.fjallOrgId)})}a(L,"buildDevProvisionerTrustStatements");function k(e){return u({...e,sid:"FjallDevSyncSubject",subject:D(e.fjallOrgId)})}a(k,"buildDevSyncWriterTrustStatements");function G({accountId:e}){return[{Sid:"FjallDevEcsTaggedMutations",Effect:"Allow",Action:["ecs:UpdateService","ecs:DeleteService","ecs:RunTask","ecs:StopTask"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTaggedCreates",Effect:"Allow",Action:["ecs:RegisterTaskDefinition","ecs:CreateService"],Resource:"*",Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTagOnCreate",Effect:"Allow",Action:["ecs:TagResource"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"ecs:CreateAction":["RegisterTaskDefinition","CreateService","RunTask"]}}},{Sid:"FjallDevEcsReads",Effect:"Allow",Action:["ecs:Describe*","ecs:List*"],Resource:"*"},{Sid:"FjallDevEcsDeregisterTaskDefinition",Effect:"Allow",Action:["ecs:DeregisterTaskDefinition"],Resource:`arn:aws:ecs:*:${e}:task-definition/fjall-dev-*`},{Sid:"FjallDevElbTaggedMutations",Effect:"Allow",Action:["elasticloadbalancing:ModifyRule","elasticloadbalancing:DeleteRule","elasticloadbalancing:ModifyTargetGroup","elasticloadbalancing:ModifyTargetGroupAttributes","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:RegisterTargets","elasticloadbalancing:DeregisterTargets"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTaggedCreates",Effect:"Allow",Action:["elasticloadbalancing:CreateTargetGroup","elasticloadbalancing:CreateRule"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTagOnCreate",Effect:"Allow",Action:["elasticloadbalancing:AddTags"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"elasticloadbalancing:CreateAction":["CreateTargetGroup","CreateRule"]}}},{Sid:"FjallDevElbReads",Effect:"Allow",Action:["elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevSsmDevTree",Effect:"Allow",Action:["ssm:GetParameter*","ssm:PutParameter","ssm:AddTagsToResource"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevLogsMutations",Effect:"Allow",Action:["logs:PutRetentionPolicy","logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsTaggedCreate",Effect:"Allow",Action:["logs:CreateLogGroup","logs:TagResource"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevLogsRead",Effect:"Allow",Action:["logs:GetLogEvents","logs:DescribeLogStreams","logs:FilterLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsDescribeGroups",Effect:"Allow",Action:["logs:DescribeLogGroups"],Resource:"*"},{Sid:"FjallDevKmsViaDevAlias",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevKmsSsmSecureString",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}},{Sid:"FjallDevEcrAuthToken",Effect:"Allow",Action:["ecr:GetAuthorizationToken"],Resource:"*"},{Sid:"FjallDevEcrPushPull",Effect:"Allow",Action:["ecr:PutImage","ecr:InitiateLayerUpload","ecr:UploadLayerPart","ecr:CompleteLayerUpload","ecr:BatchCheckLayerAvailability","ecr:BatchGetImage","ecr:GetDownloadUrlForLayer","ecr:DescribeImages"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevPassDevPathRoles",Effect:"Allow",Action:["iam:PassRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`}]}a(G,"buildDevDeployPolicyStatements");function x({accountId:e}){return[{Sid:"FjallDevProvisionerBoundedRoleWrites",Effect:"Allow",Action:["iam:CreateRole","iam:PutRolePolicy","iam:AttachRolePolicy"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`,Condition:{StringEquals:{"iam:PermissionsBoundary":S(e)}}},{Sid:"FjallDevProvisionerPathRoleOps",Effect:"Allow",Action:["iam:DeleteRole","iam:DeleteRolePolicy","iam:DetachRolePolicy","iam:ListRolePolicies","iam:TagRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`},{Sid:"FjallDevProvisionerListRoles",Effect:"Allow",Action:["iam:ListRoles"],Resource:"*"},{Sid:"FjallDevProvisionerDevMasterSecrets",Effect:"Allow",Action:["secretsmanager:GetSecretValue"],Resource:`arn:aws:secretsmanager:*:${e}:secret:fjall-dev-*`},{Sid:"FjallDevProvisionerKmsDecryptViaSecretsManager",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"secretsmanager.*.amazonaws.com"}}},{Sid:"FjallDevProvisionerDataApi",Effect:"Allow",Action:["rds-data:ExecuteStatement","rds-data:BatchExecuteStatement","rds-data:BeginTransaction","rds-data:CommitTransaction","rds-data:RollbackTransaction"],Resource:`arn:aws:rds:*:${e}:cluster:fjall-dev-*`},{Sid:"FjallDevProvisionerMetrics",Effect:"Allow",Action:["cloudwatch:GetMetricData"],Resource:"*"},{Sid:"FjallDevProvisionerOrphanDiscovery",Effect:"Allow",Action:["tag:GetResources"],Resource:"*"},{Sid:"FjallDevProvisionerSsmTeardown",Effect:"Allow",Action:["ssm:DeleteParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevProvisionerLogsTeardown",Effect:"Allow",Action:["logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevProvisionerTaggedTeardown",Effect:"Allow",Action:["ecs:UpdateService","ecs:StopTask","ecs:DeleteService","elasticloadbalancing:DeleteRule","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:DeregisterTargets"],Resource:[`arn:aws:ecs:*:${e}:*`,`arn:aws:elasticloadbalancing:*:${e}:*`],Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevProvisionerTeardownReads",Effect:"Allow",Action:["ecs:Describe*","elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevProvisionerImageJanitor",Effect:"Allow",Action:["ecr:ListImages","ecr:DescribeImages","ecr:BatchDeleteImage"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevProvisionerSsmReadAll",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/*`},{Sid:"FjallDevProvisionerKmsDecryptViaSsm",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}}]}a(x,"buildDevProvisionerPolicyStatements");function O({accountId:e}){return[{Sid:"FjallDevSyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}}]}a(O,"buildDevSyncWriterPolicyStatements");function h({accountId:e}){return[{Sid:"FjallDevBoundarySsmDevRead",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevBoundaryKmsDecryptDevAlias",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevBoundarySyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}},{Sid:"FjallDevBoundarySlotLogs",Effect:"Allow",Action:["logs:CreateLogStream","logs:PutLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevBoundarySyncQueue",Effect:"Allow",Action:["sqs:ReceiveMessage","sqs:DeleteMessage","sqs:GetQueueUrl"],Resource:`arn:aws:sqs:*:${e}:fjall-dev-sync-${e}-*`}]}a(h,"buildDevBoundaryStatements");export{v as DEV_BOUNDARY_POLICY_NAME,P as DEV_DEPLOY_POLICY_NAME,F as DEV_PROVISIONER_POLICY_NAME,T as DEV_SYNC_WRITER_POLICY_NAME,i as FJALL_OIDC_AUDIENCE,w as FJALL_OIDC_ISSUER_DOMAIN,E as FJALL_OIDC_PLACEHOLDER_THUMBPRINT,h as buildDevBoundaryStatements,G as buildDevDeployPolicyStatements,C as buildDevDeployTrustStatements,x as buildDevProvisionerPolicyStatements,L as buildDevProvisionerTrustStatements,O as buildDevSyncWriterPolicyStatements,k as buildDevSyncWriterTrustStatements,$ as buildNarrowedDeployTrustStatements,m as deployAccountSubject,S as devBoundaryPolicyArn,p as devDeployRoleName,y as devProvisionerRoleName,A as devProvisionerSubject,D as devSyncSubject,b as devSyncWriterRoleName};
|
|
1
|
+
var A=Object.defineProperty;var t=(e,a)=>A(e,"name",{value:a,configurable:!0});import{isGovernanceTier as u}from"@fjall/util";const y="fjall.io",c="sts.amazonaws.com",P="0000000000000000000000000000000000000000";function F(e){return`FjallDevDeploy${e}`}t(F,"devDeployRoleName");function T(e){return`FjallDevProvisioner${e}`}t(T,"devProvisionerRoleName");function $(e){return`FjallDevSyncWriter${e}`}t($,"devSyncWriterRoleName");const C="FjallDevDeployPolicy",k="FjallDevProvisionerPolicy",L="FjallDevSyncWriterPolicy",D="FjallDevBoundary";function m(e){return`arn:aws:iam::${e}:policy/${D}`}t(m,"devBoundaryPolicyArn");function R(e){return`org:${e}:dev-provisioner`}t(R,"devProvisionerSubject");function j(e){return`org:${e}:dev-sync`}t(j,"devSyncSubject");function d(e,a){return`org:${e}:acct:${a}`}t(d,"deployAccountSubject");function f(e){return`org:${e}:*`}t(f,"genericMachineSubject");const w=["discovery","connection","org-setup","dev-substrate-setup"];function E(e,a){return`org:${e}:${a}`}t(E,"serviceSubject");function h(e){const{fjallOrgId:a,providerArn:i,issuerDomain:r,accountTier:o,accountId:l}=e,v=e.machineTrustMode??"expanded",n={[`${r}:aud`]:c};let s;if(v==="account-scoped"){if(o===void 0||!u(o)||l===void 0)throw new Error(`machineTrustMode "account-scoped" requires a governance accountTier and an accountId (got tier: ${String(o)}, accountId ${l===void 0?"absent":"present"}) \u2014 refusing to fall back to the generic machine subject: a silent fallback would re-widen the trust the \xA74.4a Step-3 contract removes`);s=[d(a,l)]}else o!==void 0&&u(o)&&l!==void 0?s=[f(a),d(a,l)]:s=f(a);return[{Sid:"FjallMachineSubject",Effect:"Allow",Principal:{Federated:i},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...n,[`${r}:sub`]:s}}},{Sid:"FjallUserSubjects",Effect:"Allow",Principal:{Federated:i},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:n,StringLike:{[`${r}:sub`]:`org:${a}:user:*`}}},{Sid:"FjallServiceSubjects",Effect:"Allow",Principal:{Federated:i},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...n,[`${r}:sub`]:w.map(S=>E(a,S))}}}]}t(h,"buildNarrowedDeployTrustStatements");function x(e){const{fjallOrgId:a,providerArn:i,issuerDomain:r,accountId:o}=e;return[{Sid:"FjallDevSubjectsThisAccount",Effect:"Allow",Principal:{Federated:i},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${r}:aud`]:c},StringLike:{[`${r}:sub`]:`org:${a}:dev:${o}:*`}}}]}t(x,"buildDevDeployTrustStatements");function g(e){const{providerArn:a,issuerDomain:i,sid:r,subject:o}=e;return[{Sid:r,Effect:"Allow",Principal:{Federated:a},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${i}:aud`]:c,[`${i}:sub`]:o}}}]}t(g,"buildServiceSubjectTrustStatements");function G(e){return g({...e,sid:"FjallDevProvisionerSubject",subject:R(e.fjallOrgId)})}t(G,"buildDevProvisionerTrustStatements");function O(e){return g({...e,sid:"FjallDevSyncSubject",subject:j(e.fjallOrgId)})}t(O,"buildDevSyncWriterTrustStatements");function q({accountId:e}){return[{Sid:"FjallDevEcsTaggedMutations",Effect:"Allow",Action:["ecs:UpdateService","ecs:DeleteService","ecs:RunTask","ecs:StopTask"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTaggedCreates",Effect:"Allow",Action:["ecs:RegisterTaskDefinition","ecs:CreateService"],Resource:"*",Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTagOnCreate",Effect:"Allow",Action:["ecs:TagResource"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"ecs:CreateAction":["RegisterTaskDefinition","CreateService","RunTask"]}}},{Sid:"FjallDevEcsReads",Effect:"Allow",Action:["ecs:Describe*","ecs:List*"],Resource:"*"},{Sid:"FjallDevEcsDeregisterTaskDefinition",Effect:"Allow",Action:["ecs:DeregisterTaskDefinition"],Resource:`arn:aws:ecs:*:${e}:task-definition/fjall-dev-*`},{Sid:"FjallDevElbTaggedMutations",Effect:"Allow",Action:["elasticloadbalancing:ModifyRule","elasticloadbalancing:DeleteRule","elasticloadbalancing:ModifyTargetGroup","elasticloadbalancing:ModifyTargetGroupAttributes","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:RegisterTargets","elasticloadbalancing:DeregisterTargets"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTaggedCreates",Effect:"Allow",Action:["elasticloadbalancing:CreateTargetGroup","elasticloadbalancing:CreateRule"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTagOnCreate",Effect:"Allow",Action:["elasticloadbalancing:AddTags"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"elasticloadbalancing:CreateAction":["CreateTargetGroup","CreateRule"]}}},{Sid:"FjallDevElbReads",Effect:"Allow",Action:["elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevSsmDevTree",Effect:"Allow",Action:["ssm:GetParameter*","ssm:PutParameter","ssm:AddTagsToResource"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevLogsMutations",Effect:"Allow",Action:["logs:PutRetentionPolicy","logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsTaggedCreate",Effect:"Allow",Action:["logs:CreateLogGroup","logs:TagResource"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevLogsRead",Effect:"Allow",Action:["logs:GetLogEvents","logs:DescribeLogStreams","logs:FilterLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsDescribeGroups",Effect:"Allow",Action:["logs:DescribeLogGroups"],Resource:"*"},{Sid:"FjallDevKmsViaDevAlias",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevKmsSsmSecureString",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}},{Sid:"FjallDevEcrAuthToken",Effect:"Allow",Action:["ecr:GetAuthorizationToken"],Resource:"*"},{Sid:"FjallDevEcrPushPull",Effect:"Allow",Action:["ecr:PutImage","ecr:InitiateLayerUpload","ecr:UploadLayerPart","ecr:CompleteLayerUpload","ecr:BatchCheckLayerAvailability","ecr:BatchGetImage","ecr:GetDownloadUrlForLayer","ecr:DescribeImages"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevPassDevPathRoles",Effect:"Allow",Action:["iam:PassRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`}]}t(q,"buildDevDeployPolicyStatements");function M({accountId:e}){return[{Sid:"FjallDevProvisionerBoundedRoleWrites",Effect:"Allow",Action:["iam:CreateRole","iam:PutRolePolicy","iam:AttachRolePolicy"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`,Condition:{StringEquals:{"iam:PermissionsBoundary":m(e)}}},{Sid:"FjallDevProvisionerPathRoleOps",Effect:"Allow",Action:["iam:DeleteRole","iam:DeleteRolePolicy","iam:DetachRolePolicy","iam:ListRolePolicies","iam:TagRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`},{Sid:"FjallDevProvisionerListRoles",Effect:"Allow",Action:["iam:ListRoles"],Resource:"*"},{Sid:"FjallDevProvisionerDevMasterSecrets",Effect:"Allow",Action:["secretsmanager:GetSecretValue"],Resource:`arn:aws:secretsmanager:*:${e}:secret:fjall-dev-*`},{Sid:"FjallDevProvisionerKmsDecryptViaSecretsManager",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"secretsmanager.*.amazonaws.com"}}},{Sid:"FjallDevProvisionerDataApi",Effect:"Allow",Action:["rds-data:ExecuteStatement","rds-data:BatchExecuteStatement","rds-data:BeginTransaction","rds-data:CommitTransaction","rds-data:RollbackTransaction"],Resource:`arn:aws:rds:*:${e}:cluster:fjall-dev-*`},{Sid:"FjallDevProvisionerMetrics",Effect:"Allow",Action:["cloudwatch:GetMetricData"],Resource:"*"},{Sid:"FjallDevProvisionerOrphanDiscovery",Effect:"Allow",Action:["tag:GetResources"],Resource:"*"},{Sid:"FjallDevProvisionerSsmTeardown",Effect:"Allow",Action:["ssm:DeleteParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevProvisionerLogsTeardown",Effect:"Allow",Action:["logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevProvisionerTaggedTeardown",Effect:"Allow",Action:["ecs:UpdateService","ecs:StopTask","ecs:DeleteService","elasticloadbalancing:DeleteRule","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:DeregisterTargets"],Resource:[`arn:aws:ecs:*:${e}:*`,`arn:aws:elasticloadbalancing:*:${e}:*`],Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevProvisionerTeardownReads",Effect:"Allow",Action:["ecs:Describe*","elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevProvisionerImageJanitor",Effect:"Allow",Action:["ecr:ListImages","ecr:DescribeImages","ecr:BatchDeleteImage"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevProvisionerSsmReadAll",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/*`},{Sid:"FjallDevProvisionerKmsDecryptViaSsm",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}}]}t(M,"buildDevProvisionerPolicyStatements");function _({accountId:e}){return[{Sid:"FjallDevSyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}}]}t(_,"buildDevSyncWriterPolicyStatements");function W({accountId:e}){return[{Sid:"FjallDevBoundarySsmDevRead",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevBoundaryKmsDecryptDevAlias",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevBoundarySyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}},{Sid:"FjallDevBoundarySlotLogs",Effect:"Allow",Action:["logs:CreateLogStream","logs:PutLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevBoundarySyncQueue",Effect:"Allow",Action:["sqs:ReceiveMessage","sqs:DeleteMessage","sqs:GetQueueUrl"],Resource:`arn:aws:sqs:*:${e}:fjall-dev-sync-${e}-*`}]}t(W,"buildDevBoundaryStatements");export{w as DEPLOY_SERVICE_SUBJECT_NAMES,D as DEV_BOUNDARY_POLICY_NAME,C as DEV_DEPLOY_POLICY_NAME,k as DEV_PROVISIONER_POLICY_NAME,L as DEV_SYNC_WRITER_POLICY_NAME,c as FJALL_OIDC_AUDIENCE,y as FJALL_OIDC_ISSUER_DOMAIN,P as FJALL_OIDC_PLACEHOLDER_THUMBPRINT,W as buildDevBoundaryStatements,q as buildDevDeployPolicyStatements,x as buildDevDeployTrustStatements,M as buildDevProvisionerPolicyStatements,G as buildDevProvisionerTrustStatements,_ as buildDevSyncWriterPolicyStatements,O as buildDevSyncWriterTrustStatements,h as buildNarrowedDeployTrustStatements,d as deployAccountSubject,m as devBoundaryPolicyArn,F as devDeployRoleName,T as devProvisionerRoleName,R as devProvisionerSubject,j as devSyncSubject,$ as devSyncWriterRoleName,f as genericMachineSubject,E as serviceSubject};
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GENERATOR_VERSION = "4.
|
|
1
|
+
export declare const GENERATOR_VERSION = "4.4.0";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const E="4.
|
|
1
|
+
const E="4.4.0";export{E as GENERATOR_VERSION};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/generator",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Pure infrastructure generation logic for Fjall",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"license": "SEE LICENSE IN LICENSE",
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@fjall/util": "^4.
|
|
51
|
+
"@fjall/util": "^4.4.0",
|
|
52
52
|
"ast-types": "^0.16.1",
|
|
53
53
|
"recast": "^0.23.11",
|
|
54
54
|
"ts-morph": "^28.0.0",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"typescript-eslint": "^8.59.1",
|
|
65
65
|
"vitest": "^4.1.5"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "c700128600ab453fa63ce28b3effe8965373be43"
|
|
68
68
|
}
|