@empire-builder-kit/nx 1.0.0-rc.30 → 1.0.0-rc.32
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/executors.json +8 -3
- package/package.json +14 -7
- package/src/aws/child-environment.d.ts +10 -0
- package/src/aws/child-environment.js +77 -0
- package/src/aws/child-environment.js.map +1 -0
- package/src/aws/identity.d.ts +13 -0
- package/src/aws/identity.js +41 -0
- package/src/aws/identity.js.map +1 -0
- package/src/aws-authority/index.d.ts +1 -0
- package/src/aws-authority/index.js +5 -0
- package/src/aws-authority/index.js.map +1 -0
- package/src/aws-authority/stage-authority.d.ts +240 -0
- package/src/aws-authority/stage-authority.js +2968 -0
- package/src/aws-authority/stage-authority.js.map +1 -0
- package/src/cli/main.d.ts +2 -0
- package/src/cli/main.js +11 -0
- package/src/cli/main.js.map +1 -1
- package/src/developer-agent/generator-planning.js +4 -4
- package/src/developer-agent/generator-planning.js.map +1 -1
- package/src/developer-agent/operation-registry.js +14 -6
- package/src/developer-agent/operation-registry.js.map +1 -1
- package/src/developer-agent/workspace-inspection.js +11 -2
- package/src/developer-agent/workspace-inspection.js.map +1 -1
- package/src/executors/deployment-plan/deployment-plan.js +1 -1
- package/src/executors/deployment-plan/deployment-plan.js.map +1 -1
- package/src/executors/foundation-preflight/foundation-preflight.d.ts +0 -1
- package/src/executors/foundation-preflight/foundation-preflight.js.map +1 -1
- package/src/executors/foundation-preflight/schema.json +0 -5
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.d.ts +12 -3
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js +95 -32
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js.map +1 -1
- package/src/executors/foundation-profile-preflight/production-database-safeguard.d.ts +64 -0
- package/src/executors/foundation-profile-preflight/production-database-safeguard.js +221 -0
- package/src/executors/foundation-profile-preflight/production-database-safeguard.js.map +1 -0
- package/src/executors/foundation-profile-preflight/schema.json +1 -6
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.d.ts +11 -1
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js +44 -21
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js.map +1 -1
- package/src/executors/foundation-remove-preflight/schema.json +6 -1
- package/src/executors/github-bootstrap/github-bootstrap.d.ts +1 -0
- package/src/executors/github-bootstrap/github-bootstrap.js +1 -0
- package/src/executors/github-bootstrap/github-bootstrap.js.map +1 -1
- package/src/executors/github-bootstrap/schema.json +7 -1
- package/src/executors/infrastructure-plan/infrastructure-plan.d.ts +27 -369
- package/src/executors/infrastructure-plan/infrastructure-plan.js +237 -5470
- package/src/executors/infrastructure-plan/infrastructure-plan.js.map +1 -1
- package/src/executors/infrastructure-plan/schema.json +8 -64
- package/src/executors/local-deploy/federated-credential-transport.d.ts +48 -0
- package/src/executors/local-deploy/federated-credential-transport.js +252 -0
- package/src/executors/local-deploy/federated-credential-transport.js.map +1 -0
- package/src/executors/local-deploy/local-approval.d.ts +4 -9
- package/src/executors/local-deploy/local-approval.js +3 -7
- package/src/executors/local-deploy/local-approval.js.map +1 -1
- package/src/executors/local-deploy/local-deploy.d.ts +60 -43
- package/src/executors/local-deploy/local-deploy.js +955 -804
- package/src/executors/local-deploy/local-deploy.js.map +1 -1
- package/src/executors/local-deploy/schema.json +3 -20
- package/src/executors/refresh/refresh.js +2 -2
- package/src/executors/refresh/refresh.js.map +1 -1
- package/src/executors/remove/remove.js +2 -2
- package/src/executors/remove/remove.js.map +1 -1
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.d.ts +27 -1
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js +907 -22
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js.map +1 -1
- package/src/executors/router-waf-rehearsal/schema.json +17 -2
- package/src/executors/secret-initialize/schema.json +42 -0
- package/src/executors/secret-initialize/secret-initialize.d.ts +32 -0
- package/src/executors/secret-initialize/secret-initialize.js +243 -0
- package/src/executors/secret-initialize/secret-initialize.js.map +1 -0
- package/src/executors/secret-metadata/secret-metadata.d.ts +4 -1
- package/src/executors/secret-metadata/secret-metadata.js +76 -29
- package/src/executors/secret-metadata/secret-metadata.js.map +1 -1
- package/src/executors/sst-lifecycle/generated-secret-retirement.d.ts +53 -0
- package/src/executors/sst-lifecycle/generated-secret-retirement.js +192 -0
- package/src/executors/sst-lifecycle/generated-secret-retirement.js.map +1 -0
- package/src/executors/sst-lifecycle/governed-native-operation.d.ts +46 -0
- package/src/executors/sst-lifecycle/governed-native-operation.js +153 -0
- package/src/executors/sst-lifecycle/governed-native-operation.js.map +1 -0
- package/src/executors/sst-lifecycle/run-sst-command.d.ts +27 -7
- package/src/executors/sst-lifecycle/run-sst-command.js +474 -89
- package/src/executors/sst-lifecycle/run-sst-command.js.map +1 -1
- package/src/executors/sst-lifecycle/schema.json +0 -5
- package/src/executors/sst-lifecycle/secret-preflight.d.ts +2 -0
- package/src/executors/sst-lifecycle/secret-preflight.js +13 -7
- package/src/executors/sst-lifecycle/secret-preflight.js.map +1 -1
- package/src/executors/unlock/unlock.js +2 -2
- package/src/executors/unlock/unlock.js.map +1 -1
- package/src/foundation/provision-logical-database.js +2 -0
- package/src/foundation/provision-logical-database.js.map +1 -1
- package/src/foundation/router-waf-rate-rehearsal.d.ts +97 -0
- package/src/foundation/router-waf-rate-rehearsal.js +210 -0
- package/src/foundation/router-waf-rate-rehearsal.js.map +1 -0
- package/src/foundation/router-waf.d.ts +59 -9
- package/src/foundation/router-waf.js +427 -32
- package/src/foundation/router-waf.js.map +1 -1
- package/src/foundation/stages.d.ts +1 -0
- package/src/foundation/stages.js +11 -0
- package/src/foundation/stages.js.map +1 -1
- package/src/generators/formatting.d.ts +8 -0
- package/src/generators/formatting.js +118 -0
- package/src/generators/formatting.js.map +1 -0
- package/src/generators/function/function.js +37 -17
- package/src/generators/function/function.js.map +1 -1
- package/src/generators/post-generation-install.js +2 -2
- package/src/generators/post-generation-install.js.map +1 -1
- package/src/generators/preset/generator.js +28 -8
- package/src/generators/preset/generator.js.map +1 -1
- package/src/generators/preset/schema.d.ts +3 -0
- package/src/generators/preset/schema.json +5 -5
- package/src/generators/preset/workspace-files-developer-agent.js +15 -7
- package/src/generators/preset/workspace-files-developer-agent.js.map +1 -1
- package/src/generators/preset/workspace-files-ecr-inspector.d.ts +18 -0
- package/src/generators/preset/workspace-files-ecr-inspector.js +298 -0
- package/src/generators/preset/workspace-files-ecr-inspector.js.map +1 -0
- package/src/generators/preset/workspace-files-performance-cost.d.ts +2 -2
- package/src/generators/preset/workspace-files-performance-cost.js +8 -8
- package/src/generators/preset/workspace-files-performance-cost.js.map +1 -1
- package/src/generators/preset/workspace-files-performance-load.d.ts +1 -1
- package/src/generators/preset/workspace-files-performance-load.js +29 -24
- package/src/generators/preset/workspace-files-performance-load.js.map +1 -1
- package/src/generators/preset/workspace-files-stage-authority.d.ts +6 -0
- package/src/generators/preset/workspace-files-stage-authority.js +479 -0
- package/src/generators/preset/workspace-files-stage-authority.js.map +1 -0
- package/src/generators/preset/workspace-files-thin-deploy.d.ts +40 -0
- package/src/generators/preset/workspace-files-thin-deploy.js +1500 -0
- package/src/generators/preset/workspace-files-thin-deploy.js.map +1 -0
- package/src/generators/preset/workspace-files-thin-docs.d.ts +5 -0
- package/src/generators/preset/workspace-files-thin-docs.js +240 -0
- package/src/generators/preset/workspace-files-thin-docs.js.map +1 -0
- package/src/generators/preset/workspace-files-thin-release.d.ts +14 -0
- package/src/generators/preset/workspace-files-thin-release.js +26 -0
- package/src/generators/preset/workspace-files-thin-release.js.map +1 -0
- package/src/generators/preset/workspace-files.d.ts +2 -1
- package/src/generators/preset/workspace-files.js +448 -680
- package/src/generators/preset/workspace-files.js.map +1 -1
- package/src/generators/repository-policy/repository-policy.js +149 -19
- package/src/generators/repository-policy/repository-policy.js.map +1 -1
- package/src/generators/repository-policy/schema.d.ts +2 -0
- package/src/generators/repository-policy/schema.json +11 -1
- package/src/generators/repository-policy/tree-policy.d.ts +3 -0
- package/src/generators/repository-policy/tree-policy.js +25 -0
- package/src/generators/repository-policy/tree-policy.js.map +1 -0
- package/src/generators/slice/built-in-plan-api-files.js +1 -0
- package/src/generators/slice/built-in-plan-api-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-async-work-files.js +41 -0
- package/src/generators/slice/built-in-plan-async-work-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +6 -0
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js +5 -31
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-data-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-data-files.js +89 -30
- package/src/generators/slice/built-in-plan-data-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js +19 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js +21 -3
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js +20 -1
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-foundation-files.js +3 -5
- package/src/generators/slice/built-in-plan-foundation-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-frontend-files.js +5 -1
- package/src/generators/slice/built-in-plan-frontend-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-infrastructure-files.js +199 -188
- package/src/generators/slice/built-in-plan-infrastructure-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-metadata-files.js +13 -0
- package/src/generators/slice/built-in-plan-metadata-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.js +307 -0
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-operations-files.js +65 -51
- package/src/generators/slice/built-in-plan-operations-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-performance-files.js +97 -19
- package/src/generators/slice/built-in-plan-performance-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-project-files.js +9 -68
- package/src/generators/slice/built-in-plan-project-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-secret-runtime-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-secret-runtime-files.js +87 -76
- package/src/generators/slice/built-in-plan-secret-runtime-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-testing-files.js +94 -47
- package/src/generators/slice/built-in-plan-testing-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-thin-release-files.d.ts +11 -0
- package/src/generators/slice/built-in-plan-thin-release-files.js +129 -0
- package/src/generators/slice/built-in-plan-thin-release-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-verification-files.js +6 -2
- package/src/generators/slice/built-in-plan-verification-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-web-files.js +4 -2
- package/src/generators/slice/built-in-plan-web-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-workload-role-files.js +26 -4
- package/src/generators/slice/built-in-plan-workload-role-files.js.map +1 -1
- package/src/generators/slice/built-in-plan.d.ts +1 -0
- package/src/generators/slice/built-in-plan.js +28 -11
- package/src/generators/slice/built-in-plan.js.map +1 -1
- package/src/generators/slice/slice.js +30 -32
- package/src/generators/slice/slice.js.map +1 -1
- package/src/generators/upgrade/upgrade.d.ts +1 -1
- package/src/generators/upgrade/upgrade.js +200 -48
- package/src/generators/upgrade/upgrade.js.map +1 -1
- package/src/generators/workload/performance-registration.d.ts +1 -0
- package/src/generators/workload/performance-registration.js +9 -11
- package/src/generators/workload/performance-registration.js.map +1 -1
- package/src/generators/workload/service-performance-files.d.ts +1 -0
- package/src/generators/workload/service-performance-files.js +27 -7
- package/src/generators/workload/service-performance-files.js.map +1 -1
- package/src/generators/workload/workload.d.ts +1 -1
- package/src/generators/workload/workload.js +55 -28
- package/src/generators/workload/workload.js.map +1 -1
- package/src/git-policy/github-bootstrap.d.ts +28 -7
- package/src/git-policy/github-bootstrap.js +205 -163
- package/src/git-policy/github-bootstrap.js.map +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/local-dev/private-state.d.ts +3 -0
- package/src/local-dev/private-state.js +17 -5
- package/src/local-dev/private-state.js.map +1 -1
- package/src/local-dev/tls.js +5 -1
- package/src/local-dev/tls.js.map +1 -1
- package/src/performance/cost-collection.d.ts +1 -1
- package/src/performance/cost-collection.js +4 -2
- package/src/performance/cost-collection.js.map +1 -1
- package/src/performance/cost-controls.d.ts +3 -1
- package/src/performance/cost-controls.js +9 -4
- package/src/performance/cost-controls.js.map +1 -1
- package/src/performance/evidence.d.ts +1 -1
- package/src/performance/evidence.js +5 -3
- package/src/performance/evidence.js.map +1 -1
- package/src/performance/load-safety.js +5 -3
- package/src/performance/load-safety.js.map +1 -1
- package/src/performance/model.d.ts +2 -2
- package/src/performance/model.js +4 -3
- package/src/performance/model.js.map +1 -1
- package/src/release/index.d.ts +0 -2
- package/src/release/index.js +0 -2
- package/src/release/index.js.map +1 -1
- package/src/release/source-authority.d.ts +4 -5
- package/src/release/source-authority.js +13 -123
- package/src/release/source-authority.js.map +1 -1
- package/src/repository-policy/aurora-preflight.d.ts +1 -1
- package/src/repository-policy/aurora-preflight.js +4 -1
- package/src/repository-policy/aurora-preflight.js.map +1 -1
- package/src/repository-policy/policy.d.ts +21 -2
- package/src/repository-policy/policy.js +290 -25
- package/src/repository-policy/policy.js.map +1 -1
- package/src/schemas/performance-policy-v1.json +3 -1
- package/src/schemas/repository-policy-v1.json +46 -2
- package/src/secrets/adapters.d.ts +7 -2
- package/src/secrets/adapters.js +34 -3
- package/src/secrets/adapters.js.map +1 -1
- package/src/secrets/aws-control-plane.d.ts +10 -1
- package/src/secrets/aws-control-plane.js +67 -0
- package/src/secrets/aws-control-plane.js.map +1 -1
- package/src/secrets/generated-aws-control-plane.d.ts +23 -0
- package/src/secrets/generated-aws-control-plane.js +259 -0
- package/src/secrets/generated-aws-control-plane.js.map +1 -0
- package/src/secrets/metadata.js +38 -10
- package/src/secrets/metadata.js.map +1 -1
- package/src/secrets/model.d.ts +8 -1
- package/src/secrets/model.js +24 -3
- package/src/secrets/model.js.map +1 -1
- package/src/secrets/operator.d.ts +89 -3
- package/src/secrets/operator.js +422 -9
- package/src/secrets/operator.js.map +1 -1
- package/src/secrets/registry.d.ts +2 -1
- package/src/secrets/registry.js +18 -1
- package/src/secrets/registry.js.map +1 -1
- package/src/secrets/workload-access.js +10 -2
- package/src/secrets/workload-access.js.map +1 -1
- package/src/supply-chain/action-pins.js +61 -7
- package/src/supply-chain/action-pins.js.map +1 -1
- package/src/supply-chain/build-output-bounds.d.ts +2 -0
- package/src/supply-chain/build-output-bounds.js +12 -0
- package/src/supply-chain/build-output-bounds.js.map +1 -0
- package/src/supply-chain/build-output.js +2 -4
- package/src/supply-chain/build-output.js.map +1 -1
- package/src/supply-chain/ecr-scanning.d.ts +5 -3
- package/src/supply-chain/ecr-scanning.js +11 -7
- package/src/supply-chain/ecr-scanning.js.map +1 -1
- package/src/supply-chain/ecs-deployed-image.d.ts +5 -3
- package/src/supply-chain/ecs-deployed-image.js +6 -4
- package/src/supply-chain/ecs-deployed-image.js.map +1 -1
- package/src/supply-chain/generated-container-release-command.js +849 -44
- package/src/supply-chain/generated-container-release-command.js.map +1 -1
- package/src/supply-chain/generated-ecr-collector-command.d.ts +0 -1
- package/src/supply-chain/generated-ecr-collector-command.js +188 -91
- package/src/supply-chain/generated-ecr-collector-command.js.map +1 -1
- package/src/supply-chain/generated-files.js +4 -3
- package/src/supply-chain/generated-files.js.map +1 -1
- package/src/supply-chain/index.d.ts +1 -1
- package/src/supply-chain/index.js +2 -1
- package/src/supply-chain/index.js.map +1 -1
- package/src/workload-roles/index.d.ts +10 -17
- package/src/workload-roles/index.js +5 -18
- package/src/workload-roles/index.js.map +1 -1
- package/src/workspace-deployment/identity.d.ts +3 -0
- package/src/workspace-deployment/identity.js +22 -0
- package/src/workspace-deployment/identity.js.map +1 -0
- package/src/workspace-deployment/index.d.ts +3 -0
- package/src/workspace-deployment/index.js +7 -0
- package/src/workspace-deployment/index.js.map +1 -0
- package/src/workspace-deployment/migration-evidence.d.ts +29 -0
- package/src/workspace-deployment/migration-evidence.js +83 -0
- package/src/workspace-deployment/migration-evidence.js.map +1 -0
- package/src/workspace-deployment/migration.d.ts +27 -0
- package/src/workspace-deployment/migration.js +109 -0
- package/src/workspace-deployment/migration.js.map +1 -0
- package/src/workspace-deployment/ownership.d.ts +81 -0
- package/src/workspace-deployment/ownership.js +381 -0
- package/src/workspace-deployment/ownership.js.map +1 -0
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderStageAuthorityWorkspaceFiles = renderStageAuthorityWorkspaceFiles;
|
|
4
|
+
function renderStageAuthorityWorkspaceFiles(options) {
|
|
5
|
+
return {
|
|
6
|
+
'docs/stage-deployment-authority.md': `# Stage deployment authority
|
|
7
|
+
|
|
8
|
+
Each active stage uses one stable deployment role and one runtime permission
|
|
9
|
+
boundary. The authority is independent of framework package candidates and is
|
|
10
|
+
updated only when the reviewed service-family contract changes.
|
|
11
|
+
|
|
12
|
+
Render a stage's CloudFormation template from the committed repository policy:
|
|
13
|
+
|
|
14
|
+
\`\`\`sh
|
|
15
|
+
pnpm nx run <workspace>:stage-authority-render -- \\
|
|
16
|
+
--stage=development \\
|
|
17
|
+
--aws-principal-arn=<temporary-credential-source-role>
|
|
18
|
+
\`\`\`
|
|
19
|
+
|
|
20
|
+
Locally admitted stages require at least one reviewed
|
|
21
|
+
\`--aws-principal-arn\`. Stages that require only protected GitHub deployment
|
|
22
|
+
require one exact \`--github-repository\` environment trust and reject local AWS
|
|
23
|
+
principals. Production-isolated staging requires both the local principal and
|
|
24
|
+
the protected GitHub environment trust: local staging remains supported, while
|
|
25
|
+
the protected \`develop\` deployment produces the receipt consumed by production
|
|
26
|
+
promotion. The \`starter\` profile may add that exact GitHub trust to either of
|
|
27
|
+
its locally admitted stages because its GitHub paved road is optional. Fully
|
|
28
|
+
isolated development rejects GitHub trust.
|
|
29
|
+
|
|
30
|
+
GitHub trust is scoped to the repository's exact stage environment and always
|
|
31
|
+
uses GitHub's immutable owner/repository-ID OIDC subject customization. Every
|
|
32
|
+
\`--github-repository\` must be accompanied by both
|
|
33
|
+
\`--github-owner-id=<numeric-id>\` and
|
|
34
|
+
\`--github-repository-id=<numeric-id>\`; a partial or name-only subject is
|
|
35
|
+
rejected. Obtain the canonical slug and IDs from the GitHub bootstrap report,
|
|
36
|
+
but do not enable immutable subjects yet for an existing repository. First apply the rendered
|
|
37
|
+
\`ownership-template.json\` as the owner-claim stack named in
|
|
38
|
+
\`ownership-manifest.json\`. CloudFormation creates the retained
|
|
39
|
+
\`/ebk/<stage>/workspace-owner\` record atomically. Then apply
|
|
40
|
+
\`template.json\` as the authority stack shown in \`manifest.json\`; its
|
|
41
|
+
CloudFormation Rule reads the exact owner before any IAM change. A second
|
|
42
|
+
workspace therefore cannot address the same account, Region, and stage tuple,
|
|
43
|
+
while a clone retaining the committed deployment ID reuses both stacks.
|
|
44
|
+
Read back and simulate the effective immutable-subject trust, then apply the
|
|
45
|
+
GitHub bootstrap change that configures the repository's default immutable OIDC
|
|
46
|
+
subject. This AWS-trust-first order prevents an existing protected deployment
|
|
47
|
+
from being stranded between the subject-format and trust-policy changes.
|
|
48
|
+
Existing deployed workspaces must first commit the explicit migration evidence
|
|
49
|
+
described in \`docs/workspace-deployment-ownership.md\`; never claim an existing
|
|
50
|
+
tuple by editing policy directly. Read back the deployed template and policies
|
|
51
|
+
and compare their canonical digests before any application mutation. Simulate
|
|
52
|
+
representative permitted lifecycle calls and denied account, trust,
|
|
53
|
+
boundary-removal, cross-stage, cross-account, and cross-Region calls against
|
|
54
|
+
the effective assumed role.
|
|
55
|
+
|
|
56
|
+
The deployment role is a temporary infrastructure administrator, not a runtime
|
|
57
|
+
workload identity. It therefore receives stable service-family authority for
|
|
58
|
+
the generated architecture instead of a candidate-specific provider-call
|
|
59
|
+
inventory. Sensitive seams remain independently bounded: IAM roles must use the
|
|
60
|
+
generated stage path and permission boundary, \`iam:PassRole\` is limited to
|
|
61
|
+
those roles, Lambda resource-policy mutation follows the generated integration
|
|
62
|
+
and Function URL contracts, later trust-policy mutation is denied, and
|
|
63
|
+
unreviewed direct resource-policy APIs are denied.
|
|
64
|
+
The \`/ebk/<stage>/workloads/\` IAM path is an EBK-owned reserved namespace for
|
|
65
|
+
roles created from reviewed generated infrastructure. External or manually
|
|
66
|
+
managed roles must never be created there, and the deployer's bounded
|
|
67
|
+
\`iam:PassRole\` access to that path is not adopter extension authority.
|
|
68
|
+
Supported generated S3,
|
|
69
|
+
Lambda, SNS, and SQS policy surfaces remain resource-contained. The generated
|
|
70
|
+
edge WAF log group is ARN-contained. CloudWatch Logs exposes
|
|
71
|
+
\`PutResourcePolicy\` only at account scope, with no resource or action-specific
|
|
72
|
+
condition keys, so its reviewed generated payload cannot be inspected by IAM;
|
|
73
|
+
the exact edge Region and reviewed generated source are the honest controls.
|
|
74
|
+
When the committed application Region is also the edge Region, ordinary log
|
|
75
|
+
lifecycle mutations are admitted only for the generated stage application and
|
|
76
|
+
API execution-log namespaces; unrelated and other-stage log groups remain
|
|
77
|
+
denied.
|
|
78
|
+
IAM identity
|
|
79
|
+
policies cannot inspect the initial \`AssumeRolePolicyDocument\` supplied to
|
|
80
|
+
\`CreateRole\`. For that create-time field, reviewed generated infrastructure
|
|
81
|
+
source is the control: the temporary deployment principal is trusted to execute
|
|
82
|
+
that source, while later trust-policy mutation remains denied. EBK does not
|
|
83
|
+
claim a postdeployment trust attestor. Runtime roles are created by SST/Pulumi
|
|
84
|
+
in the application stack and must carry the generated stage permission
|
|
85
|
+
boundary.
|
|
86
|
+
|
|
87
|
+
The policy generator is checked against a compact, versioned extract of AWS's
|
|
88
|
+
official Service Authorization Reference v1.4. Every wildcard-admitted service
|
|
89
|
+
family is covered. Every permission-management action that the role can admit
|
|
90
|
+
is either explicitly denied or an exact reviewed lifecycle seam: bounded
|
|
91
|
+
workload-role IAM operations, AWS-resource KMS grants, generated Lambda
|
|
92
|
+
integration permissions, stage SNS/SQS attributes, and stage/SST S3 bucket
|
|
93
|
+
policy, public-access-block, and ownership controls, plus the generated edge
|
|
94
|
+
WAF log-delivery resource policy described above. Actions the role does not
|
|
95
|
+
admit remain implicitly denied.
|
|
96
|
+
Unsupported replication, alternate RDS topology/integration, export, account
|
|
97
|
+
control, arbitrary user/data-plane, and exfiltration operations remain denied.
|
|
98
|
+
|
|
99
|
+
Governed nonproduction Slice removal configures the provider to delete the
|
|
100
|
+
versioned confidential-export bucket, removes its deterministic alias, and may
|
|
101
|
+
schedule only a KMS key carrying both the exact stage and
|
|
102
|
+
\`standard-data-export\` management tags. Production export buckets, aliases,
|
|
103
|
+
and keys remain retained and are explicitly denied deletion. Long generated
|
|
104
|
+
bucket names are truncated and hash-suffixed while preserving the
|
|
105
|
+
\`-data-export\` suffix so that protection remains narrowly scoped.
|
|
106
|
+
|
|
107
|
+
The role may inspect secret metadata. SST 4.17.1's generated Foundation Aurora
|
|
108
|
+
credential is the one value exception: the temporary deployer may put and read
|
|
109
|
+
that exact stage/account/Region-bound secret version so the pinned provider can
|
|
110
|
+
create and reconcile it. The reserved name must also carry the exact
|
|
111
|
+
\`ebk:stage\` tag. \`GetSecretValue\` and \`PutSecretValue\` remain denied for
|
|
112
|
+
operator-secret and all other Slice containers.
|
|
113
|
+
Generated source creates Slice containers inside the deterministic
|
|
114
|
+
\`ebk/<stage>/*\` namespace. The temporary deployer's \`UpdateSecret\` authority
|
|
115
|
+
is denied outside that namespace and the exact generated Foundation
|
|
116
|
+
provider-secret identity. Imported, externally owned or shared, unmanaged,
|
|
117
|
+
other-stage, cross-account, and cross-Region containers remain outside this
|
|
118
|
+
update authority. The namespace is reserved for EBK-owned, stage-exclusive
|
|
119
|
+
containers, including explicitly approved cross-Slice use; imported or
|
|
120
|
+
externally owned containers must use a name outside it. The namespace contract
|
|
121
|
+
covers generated database, machine-client, generated-value, and EBK-owned
|
|
122
|
+
operator containers without adding a new IAM exception for every provider
|
|
123
|
+
resource type. It does not admit
|
|
124
|
+
\`GetSecretValue\` or \`PutSecretValue\` for Slice containers. Because
|
|
125
|
+
\`CreateSecret\` and \`UpdateSecret\` can optionally carry a value, IAM cannot
|
|
126
|
+
distinguish a metadata-only call; reviewed generated source, temporary
|
|
127
|
+
credentials, the stage namespace, and CloudTrail are the honest controls for
|
|
128
|
+
those provider APIs.
|
|
129
|
+
SSM value reads are limited to the stage's Foundation configuration, SST 4.17.1
|
|
130
|
+
bootstrap record, stage-qualified SST passphrases, SST's VPC private-key
|
|
131
|
+
reference, and the exact retained workspace-owner record. The deployment role
|
|
132
|
+
can read but cannot change or delete that owner. Foundation removal enumerates Product Slice registration names and
|
|
133
|
+
metadata without reading their values. Recursive and historical SSM value reads
|
|
134
|
+
are denied. These controls,
|
|
135
|
+
the exact trust, temporary credentials, requested Region, known account/stage
|
|
136
|
+
tags, production-name protections, and explicit protection-removal denies are
|
|
137
|
+
the stable guardrails around the broader infrastructure service families. In
|
|
138
|
+
commercial AWS, CloudFront, CloudFront-scope WAF, and edge ACM mutations use
|
|
139
|
+
the us-east-1 control plane while application resources remain bound to the
|
|
140
|
+
committed deployment Region. RC.31 does not claim Router edge support in
|
|
141
|
+
noncommercial partitions: CloudFront is unavailable inside GovCloud, and the
|
|
142
|
+
China-partition CloudFront/WAF/edge-ACM control plane is not yet proven.
|
|
143
|
+
|
|
144
|
+
When multiple stages share one AWS account, their application resources,
|
|
145
|
+
runtime roles, data, and discovery remain separately named and tagged, but the
|
|
146
|
+
native SST deployment role is account-scoped enough to reconcile SST's shared
|
|
147
|
+
bootstrap state and assets. Tag and name denies are defense in depth, not a hard
|
|
148
|
+
IAM boundary between same-account deployment roles. Choose
|
|
149
|
+
\`production-isolated\` when production requires an AWS-enforced deployment
|
|
150
|
+
blast-radius boundary from development and staging.
|
|
151
|
+
`,
|
|
152
|
+
'docs/workspace-deployment-ownership.md': `# Workspace deployment ownership
|
|
153
|
+
|
|
154
|
+
Every generated workspace commits one stable, random \`workspaceDeploymentId\`
|
|
155
|
+
and \`workspaceDeploymentProvenance: { kind: "fresh", schemaVersion: 1 }\`.
|
|
156
|
+
That identity belongs to the workspace, not to a checkout: clones with the same
|
|
157
|
+
committed policy are the same deployment owner.
|
|
158
|
+
|
|
159
|
+
Before authority or SST lifecycle work, each active account/Region/canonical
|
|
160
|
+
stage tuple must contain exactly one retained String parameter at
|
|
161
|
+
\`/ebk/<stage>/workspace-owner\`. The value binds the tuple to the generated
|
|
162
|
+
deployment ID; the current workspace name remains diagnostic metadata and may
|
|
163
|
+
be renamed without transferring authority. The ownership claim is deliberately
|
|
164
|
+
exclusive and retained. Two workspaces do not cohabit one tuple, and removing
|
|
165
|
+
an application stack does not release the claim.
|
|
166
|
+
|
|
167
|
+
Render stage authority with \`pnpm nx run ${options.name}:stage-authority-render --
|
|
168
|
+
--stage=<stage> ...\`. Apply the emitted \`ownership-template.json\` as the exact
|
|
169
|
+
claim stack in \`ownership-manifest.json\` before applying the authority template.
|
|
170
|
+
CloudFormation's fixed-name SSM create is the atomic claim. The authority
|
|
171
|
+
template accepts only that exact parameter path and fails its Rule before any
|
|
172
|
+
IAM change unless its value is the exact committed owner. The deployment role
|
|
173
|
+
may read the owner but is explicitly denied every owner mutation.
|
|
174
|
+
|
|
175
|
+
For a read-only report, run
|
|
176
|
+
\`node tools/stage-authority-render.mjs --stage=<stage> --ownership-doctor=true
|
|
177
|
+
--profile=<temporary-profile>\`. It reports \`owned\`, \`unclaimed\`, or \`conflict\`;
|
|
178
|
+
a conflict identifies the committed owner without changing AWS.
|
|
179
|
+
|
|
180
|
+
## Existing prerelease deployments
|
|
181
|
+
|
|
182
|
+
An existing policy without the required deployment identity provenance is fail
|
|
183
|
+
closed. Inventory
|
|
184
|
+
each configured tuple read-only and commit bounded evidence under
|
|
185
|
+
\`docs/adoption/\`. The evidence must bind the exact prior policy SHA-256,
|
|
186
|
+
workspace name, proposed \`ebkws-<32 lowercase hex>\` ID, and every configured
|
|
187
|
+
tuple. The ID, exact Region, and every active-stage account must be committed in
|
|
188
|
+
the same migration change; an empty interim topology cannot reserve future
|
|
189
|
+
coordinates. Each tuple declares \`empty\` with no resource digests or
|
|
190
|
+
\`existing-workspace\` with sorted SHA-256 digests of its bounded resource
|
|
191
|
+
identity evidence. Then run the repository-policy generator with both
|
|
192
|
+
\`--workspaceDeploymentId\` and
|
|
193
|
+
\`--workspaceDeploymentMigrationEvidence\`. Report-only mode shows the exact
|
|
194
|
+
result with \`workspaceDeploymentProvenance.kind: "migrated"\`; \`--apply\`
|
|
195
|
+
commits it. Every later policy read revalidates the retained evidence bytes,
|
|
196
|
+
workspace identity, the syntactically valid diagnostic name recorded at migration,
|
|
197
|
+
and exact active stage/account/Region tuple set. The current package name may be
|
|
198
|
+
renamed without renewing ownership evidence because authority is bound to the
|
|
199
|
+
immutable deployment ID rather than that diagnostic label.
|
|
200
|
+
A profile, account, or Region change for a migrated workspace requires a new
|
|
201
|
+
versioned evidence path whose previous-policy digest binds the current policy;
|
|
202
|
+
unrelated policy changes retain the existing binding.
|
|
203
|
+
|
|
204
|
+
This migration is an explicit ownership assertion, not automatic discovery.
|
|
205
|
+
Never use it to adopt a tuple whose resources belong to another workspace. An
|
|
206
|
+
occupied but unclaimed tuple requires reviewed evidence that the existing
|
|
207
|
+
resources belong to this workspace. There is no implicit compatibility claim,
|
|
208
|
+
ownership transfer, or force-adoption path.
|
|
209
|
+
`,
|
|
210
|
+
'tools/stage-authority-render.mjs': `import {
|
|
211
|
+
assertBoundStageAuthorityTemplateFitsBodyLimit,
|
|
212
|
+
canonicalStageAuthorityTemplate,
|
|
213
|
+
createStageAuthorityPlan,
|
|
214
|
+
} from '@empire-builder-kit/nx/aws-authority';
|
|
215
|
+
import {
|
|
216
|
+
configuredDeploymentAccountForStage,
|
|
217
|
+
configuredDeploymentRegion,
|
|
218
|
+
isActiveDeploymentStage,
|
|
219
|
+
readRepositoryOperatingPolicy,
|
|
220
|
+
requiresGithubDeployment,
|
|
221
|
+
} from '@empire-builder-kit/nx/repository-policy';
|
|
222
|
+
import {
|
|
223
|
+
bindStageAuthorityTemplateToWorkspaceOwner,
|
|
224
|
+
canonicalWorkspaceStageOwner,
|
|
225
|
+
createWorkspaceStageOwnershipClaimPlan,
|
|
226
|
+
inspectWorkspaceStageOwnership,
|
|
227
|
+
} from '@empire-builder-kit/nx/workspace-deployment';
|
|
228
|
+
import { createHash } from 'node:crypto';
|
|
229
|
+
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
230
|
+
import { join } from 'node:path';
|
|
231
|
+
|
|
232
|
+
const values = new Map();
|
|
233
|
+
const principals = [];
|
|
234
|
+
for (const argument of process.argv.slice(2)) {
|
|
235
|
+
const index = argument.indexOf('=');
|
|
236
|
+
if (!argument.startsWith('--') || index <= 2) {
|
|
237
|
+
throw new Error('Stage authority arguments must use --name=value.');
|
|
238
|
+
}
|
|
239
|
+
const name = argument.slice(2, index);
|
|
240
|
+
const value = argument.slice(index + 1);
|
|
241
|
+
if (!value) throw new Error('Stage authority arguments cannot be empty.');
|
|
242
|
+
if (name === 'aws-principal-arn') principals.push(value);
|
|
243
|
+
else if (values.has(name)) throw new Error('Duplicate stage authority argument: ' + name);
|
|
244
|
+
else values.set(name, value);
|
|
245
|
+
}
|
|
246
|
+
const stage = values.get('stage');
|
|
247
|
+
if (!['development', 'staging', 'production'].includes(stage)) {
|
|
248
|
+
throw new Error('--stage must be development, staging, or production.');
|
|
249
|
+
}
|
|
250
|
+
const policy = readRepositoryOperatingPolicy(process.cwd());
|
|
251
|
+
const rootPackage = JSON.parse(readFileSync('package.json', 'utf8'));
|
|
252
|
+
const workspaceName = rootPackage?.name;
|
|
253
|
+
if (
|
|
254
|
+
typeof workspaceName !== 'string' ||
|
|
255
|
+
workspaceName.length > 214 ||
|
|
256
|
+
!/^(?:@[a-z0-9][a-z0-9._~-]*\\/)?[a-z0-9][a-z0-9._~-]*$/.test(workspaceName)
|
|
257
|
+
) {
|
|
258
|
+
throw new Error('Workspace ownership requires the current generated root package name.');
|
|
259
|
+
}
|
|
260
|
+
if (policy.deploymentProfile !== '${options.deploymentProfile}') {
|
|
261
|
+
throw new Error('Generated and committed deployment profiles differ.');
|
|
262
|
+
}
|
|
263
|
+
if (policy.workspaceDeploymentId !== '${options.workspaceDeploymentId}') {
|
|
264
|
+
throw new Error('Generated and committed workspace deployment identities differ.');
|
|
265
|
+
}
|
|
266
|
+
if (!isActiveDeploymentStage(policy.deploymentProfile, stage)) {
|
|
267
|
+
throw new Error('Requested stage is inactive for the committed deployment profile.');
|
|
268
|
+
}
|
|
269
|
+
const accountId = configuredDeploymentAccountForStage(
|
|
270
|
+
policy.deploymentProfile,
|
|
271
|
+
policy.deploymentAccounts,
|
|
272
|
+
stage,
|
|
273
|
+
);
|
|
274
|
+
const region = configuredDeploymentRegion(policy.deploymentRegion);
|
|
275
|
+
if (/^(?:us-iso-|us-isob-|eu-isoe-|us-isof-)/.test(region)) {
|
|
276
|
+
throw new Error(
|
|
277
|
+
'The committed Region belongs to an unsupported AWS partition. Generated authority supports aws, aws-cn, and aws-us-gov only.',
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
const partition = region.startsWith('cn-')
|
|
281
|
+
? 'aws-cn'
|
|
282
|
+
: region.startsWith('us-gov-')
|
|
283
|
+
? 'aws-us-gov'
|
|
284
|
+
: 'aws';
|
|
285
|
+
const ownershipTarget = {
|
|
286
|
+
accountId,
|
|
287
|
+
region,
|
|
288
|
+
stage,
|
|
289
|
+
workspaceDeploymentId: policy.workspaceDeploymentId,
|
|
290
|
+
workspaceName,
|
|
291
|
+
};
|
|
292
|
+
const ownershipDoctor = values.get('ownership-doctor');
|
|
293
|
+
if (ownershipDoctor !== undefined && ownershipDoctor !== 'true') {
|
|
294
|
+
throw new Error('--ownership-doctor must be exactly true when supplied.');
|
|
295
|
+
}
|
|
296
|
+
if (ownershipDoctor === 'true') {
|
|
297
|
+
if (principals.length > 0 || values.has('github-repository')) {
|
|
298
|
+
throw new Error('Workspace ownership doctor does not accept authority trust inputs.');
|
|
299
|
+
}
|
|
300
|
+
const profile = values.get('profile');
|
|
301
|
+
const [{ GetCallerIdentityCommand, STSClient }, { fromIni }] = await Promise.all([
|
|
302
|
+
import('@aws-sdk/client-sts'),
|
|
303
|
+
import('@aws-sdk/credential-providers'),
|
|
304
|
+
]);
|
|
305
|
+
const credentials = profile ? fromIni({ profile }) : undefined;
|
|
306
|
+
const identity = await new STSClient({
|
|
307
|
+
...(credentials ? { credentials } : {}),
|
|
308
|
+
region,
|
|
309
|
+
}).send(new GetCallerIdentityCommand({}));
|
|
310
|
+
if (identity.Account !== accountId) {
|
|
311
|
+
throw new Error('Workspace ownership doctor caller differs from the committed stage account.');
|
|
312
|
+
}
|
|
313
|
+
const inspection = await inspectWorkspaceStageOwnership(
|
|
314
|
+
ownershipTarget,
|
|
315
|
+
profile ? { profile } : {},
|
|
316
|
+
);
|
|
317
|
+
process.stdout.write(JSON.stringify({
|
|
318
|
+
accountId,
|
|
319
|
+
expectedOwner: inspection.expectedOwner,
|
|
320
|
+
kind: 'ebk-workspace-stage-owner-doctor',
|
|
321
|
+
parameterArn: inspection.parameterArn,
|
|
322
|
+
region,
|
|
323
|
+
...(inspection.status === 'owned'
|
|
324
|
+
? { owner: inspection.expectedOwner }
|
|
325
|
+
: inspection.status === 'conflict' && inspection.actualOwner
|
|
326
|
+
? { owner: inspection.actualOwner }
|
|
327
|
+
: {}),
|
|
328
|
+
...(inspection.status === 'conflict' ? { reason: inspection.reason } : {}),
|
|
329
|
+
schemaVersion: 1,
|
|
330
|
+
stage,
|
|
331
|
+
status: inspection.status,
|
|
332
|
+
}, null, 2) + '\\n');
|
|
333
|
+
if (inspection.status !== 'owned') process.exitCode = 1;
|
|
334
|
+
} else {
|
|
335
|
+
const repository = values.get('github-repository');
|
|
336
|
+
if (repository && !/^[A-Za-z0-9_.-]+[/][A-Za-z0-9_.-]+$/.test(repository)) {
|
|
337
|
+
throw new Error('--github-repository must be one exact owner/repository slug.');
|
|
338
|
+
}
|
|
339
|
+
const githubOwnerId = values.get('github-owner-id');
|
|
340
|
+
const githubRepositoryId = values.get('github-repository-id');
|
|
341
|
+
const githubId = /^[1-9][0-9]{0,19}$/;
|
|
342
|
+
if (repository && (!githubOwnerId || !githubRepositoryId)) {
|
|
343
|
+
throw new Error(
|
|
344
|
+
'--github-repository requires both --github-owner-id and --github-repository-id.',
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
if ((githubOwnerId || githubRepositoryId) && !repository) {
|
|
348
|
+
throw new Error('Immutable GitHub IDs require --github-repository.');
|
|
349
|
+
}
|
|
350
|
+
if (
|
|
351
|
+
(githubOwnerId && !githubId.test(githubOwnerId)) ||
|
|
352
|
+
(githubRepositoryId && !githubId.test(githubRepositoryId))
|
|
353
|
+
) {
|
|
354
|
+
throw new Error('Immutable GitHub owner and repository IDs must be positive bounded integers.');
|
|
355
|
+
}
|
|
356
|
+
const githubOnly = requiresGithubDeployment(policy.deploymentProfile, stage);
|
|
357
|
+
const productionIsolatedStaging =
|
|
358
|
+
policy.deploymentProfile === 'production-isolated' && stage === 'staging';
|
|
359
|
+
const localRequired = !githubOnly;
|
|
360
|
+
const githubRequired = githubOnly || productionIsolatedStaging;
|
|
361
|
+
const githubAllowed = githubRequired || policy.deploymentProfile === 'starter';
|
|
362
|
+
if (localRequired && principals.length === 0) {
|
|
363
|
+
throw new Error(
|
|
364
|
+
'Locally admitted stages require at least one reviewed --aws-principal-arn.',
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
if (!localRequired && principals.length > 0) {
|
|
368
|
+
throw new Error(
|
|
369
|
+
'Protected GitHub deployment stages reject local --aws-principal-arn trust.',
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
if (githubRequired && !repository) {
|
|
373
|
+
throw new Error(
|
|
374
|
+
'This stage requires protected GitHub deployment and one exact --github-repository trust.',
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
if (repository && !githubAllowed) {
|
|
378
|
+
throw new Error(
|
|
379
|
+
'This locally admitted isolated-profile stage does not permit GitHub trust.',
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
const [githubOwner, githubRepository] = repository?.split('/') ?? [];
|
|
383
|
+
const githubSubject = repository
|
|
384
|
+
? 'repo:' +
|
|
385
|
+
githubOwner + '@' + githubOwnerId + '/' + githubRepository + '@' + githubRepositoryId +
|
|
386
|
+
':environment:' + stage
|
|
387
|
+
: undefined;
|
|
388
|
+
const plan = createStageAuthorityPlan({
|
|
389
|
+
accountId,
|
|
390
|
+
awsPrincipalArns: principals,
|
|
391
|
+
...(repository
|
|
392
|
+
? {
|
|
393
|
+
github: {
|
|
394
|
+
oidcProviderArn:
|
|
395
|
+
'arn:' + partition + ':iam::' + accountId + ':oidc-provider/token.actions.githubusercontent.com',
|
|
396
|
+
subject: githubSubject,
|
|
397
|
+
},
|
|
398
|
+
}
|
|
399
|
+
: {}),
|
|
400
|
+
region,
|
|
401
|
+
partition,
|
|
402
|
+
stage,
|
|
403
|
+
});
|
|
404
|
+
const ownership = createWorkspaceStageOwnershipClaimPlan(ownershipTarget);
|
|
405
|
+
const authorityTemplate = bindStageAuthorityTemplateToWorkspaceOwner(
|
|
406
|
+
plan.template,
|
|
407
|
+
ownershipTarget,
|
|
408
|
+
);
|
|
409
|
+
assertBoundStageAuthorityTemplateFitsBodyLimit(authorityTemplate);
|
|
410
|
+
const template = canonicalStageAuthorityTemplate(authorityTemplate);
|
|
411
|
+
const directory = join('.ebk', 'authority', stage);
|
|
412
|
+
mkdirSync(directory, { mode: 0o700, recursive: true });
|
|
413
|
+
const templatePath = join(directory, 'template.json');
|
|
414
|
+
const manifestPath = join(directory, 'manifest.json');
|
|
415
|
+
const ownershipTemplate = canonicalStageAuthorityTemplate(ownership.template);
|
|
416
|
+
const ownershipTemplatePath = join(directory, 'ownership-template.json');
|
|
417
|
+
const ownershipManifestPath = join(directory, 'ownership-manifest.json');
|
|
418
|
+
writeFileSync(templatePath, template, { encoding: 'utf8', mode: 0o600 });
|
|
419
|
+
writeFileSync(ownershipTemplatePath, ownershipTemplate, {
|
|
420
|
+
encoding: 'utf8',
|
|
421
|
+
mode: 0o600,
|
|
422
|
+
});
|
|
423
|
+
const ownershipTemplateSha256 = createHash('sha256')
|
|
424
|
+
.update(ownershipTemplate)
|
|
425
|
+
.digest('hex');
|
|
426
|
+
const ownershipManifest = {
|
|
427
|
+
accountId,
|
|
428
|
+
digest: ownershipTemplateSha256,
|
|
429
|
+
kind: 'ebk-workspace-stage-owner-claim',
|
|
430
|
+
parameterArn: ownership.parameterArn,
|
|
431
|
+
parameterName: ownership.parameterName,
|
|
432
|
+
region,
|
|
433
|
+
schemaVersion: 1,
|
|
434
|
+
stackName: ownership.stackName,
|
|
435
|
+
stage,
|
|
436
|
+
templateSha256: ownershipTemplateSha256,
|
|
437
|
+
workspaceDeploymentId: policy.workspaceDeploymentId,
|
|
438
|
+
workspaceName,
|
|
439
|
+
};
|
|
440
|
+
writeFileSync(
|
|
441
|
+
ownershipManifestPath,
|
|
442
|
+
JSON.stringify(ownershipManifest, null, 2) + '\\n',
|
|
443
|
+
{ encoding: 'utf8', mode: 0o600 },
|
|
444
|
+
);
|
|
445
|
+
const templateSha256 = createHash('sha256').update(template).digest('hex');
|
|
446
|
+
const manifest = {
|
|
447
|
+
accountId,
|
|
448
|
+
deploymentRoleArn: plan.identity.deploymentRoleArn,
|
|
449
|
+
digest: templateSha256,
|
|
450
|
+
kind: 'ebk-stage-authority-render',
|
|
451
|
+
limitations: plan.limitations,
|
|
452
|
+
profile: policy.deploymentProfile,
|
|
453
|
+
region,
|
|
454
|
+
schemaVersion: 1,
|
|
455
|
+
stackName: plan.identity.stackName,
|
|
456
|
+
stage,
|
|
457
|
+
templateSha256,
|
|
458
|
+
workspaceDeploymentId: policy.workspaceDeploymentId,
|
|
459
|
+
workspaceName,
|
|
460
|
+
workspaceOwner: canonicalWorkspaceStageOwner(ownershipTarget),
|
|
461
|
+
workspaceOwnerClaimStackName: ownership.stackName,
|
|
462
|
+
workspaceOwnerManifestPath: ownershipManifestPath,
|
|
463
|
+
};
|
|
464
|
+
writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\\n', {
|
|
465
|
+
encoding: 'utf8',
|
|
466
|
+
mode: 0o600,
|
|
467
|
+
});
|
|
468
|
+
process.stdout.write(JSON.stringify({
|
|
469
|
+
manifestPath,
|
|
470
|
+
...manifest,
|
|
471
|
+
ownershipManifestPath,
|
|
472
|
+
ownershipTemplatePath,
|
|
473
|
+
templatePath,
|
|
474
|
+
}) + '\\n');
|
|
475
|
+
}
|
|
476
|
+
`,
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
//# sourceMappingURL=workspace-files-stage-authority.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-files-stage-authority.js","sourceRoot":"","sources":["../../../../../../packages/nx/src/generators/preset/workspace-files-stage-authority.ts"],"names":[],"mappings":";;AAEA,gFA8dC;AA9dD,SAAgB,kCAAkC,CAAC,OAIlD;IACC,OAAO;QACL,oCAAoC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiJzC;QACG,wCAAwC,EAAE;;;;;;;;;;;;;;;4CAeF,OAAO,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CvD;QACG,kCAAkC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAkDJ,OAAO,CAAC,iBAAiB;;;wCAGrB,OAAO,CAAC,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqNpE;KACE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { DeploymentProfile } from '../../repository-policy/index.js';
|
|
2
|
+
export declare const THIN_DEPLOY_WORKFLOW_PATH: ".github/workflows/deploy.yml";
|
|
3
|
+
export interface ThinDeployActionPins {
|
|
4
|
+
checkout: string;
|
|
5
|
+
configureAwsCredentials: string;
|
|
6
|
+
downloadArtifact: string;
|
|
7
|
+
pnpmSetup: string;
|
|
8
|
+
setupNode: string;
|
|
9
|
+
uploadArtifact: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ThinDeployToolVersions {
|
|
12
|
+
node: string;
|
|
13
|
+
sst: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ThinDeployWorkflowOptions {
|
|
16
|
+
actionPins: ThinDeployActionPins;
|
|
17
|
+
deploymentProfile: DeploymentProfile;
|
|
18
|
+
name: string;
|
|
19
|
+
toolVersions: ThinDeployToolVersions;
|
|
20
|
+
}
|
|
21
|
+
export interface ThinDeployWorkflowFilePlan {
|
|
22
|
+
files: Readonly<Record<typeof THIN_DEPLOY_WORKFLOW_PATH, string>>;
|
|
23
|
+
managedPaths: readonly [typeof THIN_DEPLOY_WORKFLOW_PATH];
|
|
24
|
+
}
|
|
25
|
+
export declare function renderThinDeployVerifyCaller(profile: DeploymentProfile): string;
|
|
26
|
+
/** @internal Exported for executable source-contract tests. */
|
|
27
|
+
export declare function exactStageDeployerGuardScript(operation: string, accountVariable: string): string;
|
|
28
|
+
/** @internal Shared verbatim by every generated protected workflow. */
|
|
29
|
+
export declare function canonicalStageAuthorityDerivationScript(): string;
|
|
30
|
+
/** @internal Exported for executable source-contract tests. */
|
|
31
|
+
export declare function exactStagingPromotionPullGuardScript(): string;
|
|
32
|
+
/** @internal Shared verbatim with the generated workflow and executable tests. */
|
|
33
|
+
export declare function stagingPromotionReceiptValidationScript(): string;
|
|
34
|
+
/** @internal Shared verbatim with the generated workflow and executable tests. */
|
|
35
|
+
export declare function restoredCandidateValidationScript(): string;
|
|
36
|
+
/** @internal Shared verbatim with the generated workflow and executable tests. */
|
|
37
|
+
export declare function stagingPromotionSealScript(): string;
|
|
38
|
+
/** @internal Shared verbatim with the generated workflow and executable tests. */
|
|
39
|
+
export declare function postdeploySupplyChainBindingScript(): string;
|
|
40
|
+
export declare function renderThinDeployWorkflowFilePlan(options: ThinDeployWorkflowOptions): ThinDeployWorkflowFilePlan;
|