You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Switch infra to SSM reads and remove T&C CDK infrastructure
Requires PR 1 (feat/ssm-cross-stack-sharing) to be deployed first so
the 14 SSM parameters exist when CloudFormation validates infra's
changeset.
Infrastructure stack:
- Reads all 14 shared values from SSM via valueForStringParameter()
- No longer accepts direct cross-stack props beyond baseStackName
- Eliminates all Fn::ImportValue dependencies on BaseStack
- IEventBus type used across all 11 domain constructs (compatible with
EventBus.fromEventBusArn() which returns IEventBus)
BaseStack:
- Removes T&C CloudFront distribution and S3 bucket (tacCdn)
- Retains all 14 SSM parameters from PR 1
Pipeline stage:
- Passes only baseStackName to DeepracerEventManagerStack
- MIGRATION ordering: baseStack.addDependency(stack) (infra first) so
infra drops Fn::ImportValue before base removes CfnOutput exports.
SSM params already exist from PR 1 so infra can resolve them.
Revert to stack.addDependency(baseStack) after this PR is deployed.
- Removes TermsAndConditionsDeployToS3 pipeline step
Also removes website-terms-and-conditions/ directory and all remaining
T&C CDK references from bin/drem.ts.
CDK tests: all 4 pass (SSM params in base, no Fn::ImportValue in infra,
SSM parameter types used in infra template).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,3 +80,20 @@ pytest # Run Python tests
80
80
### Public Frontends
81
81
-**Leaderboard** (`website-leaderboard/`) — unauthenticated, subscribes to AppSync via API key for live data; supports URL query params for display (lang, QR, track, format, flag)
82
82
-**Stream Overlays** (`website-stream-overlays/`) — unauthenticated, API key auth; uses D3.js for animated visualisations; supports chroma key background for broadcast use
83
+
84
+
### Cross-Stack Sharing Pattern
85
+
86
+
`BaseStack` and `DeepracerEventManagerStack` share values exclusively via **SSM Parameter Store** — there are no CloudFormation `Fn::ImportValue` / `CfnOutput` cross-stack references between them. This means either stack can be updated independently and in any order without CloudFormation blocking on export dependencies.
87
+
88
+
**How it works:**
89
+
-`BaseStack` writes all shared resource identifiers to SSM under `/${stackName}/<key>` at the end of its constructor
90
+
-`DeepracerEventManagerStack` reads them via `ssm.StringParameter.valueForStringParameter()` (resolved at CloudFormation deploy time, not synth time) and reconstructs CDK objects using `from*` static methods (`Role.fromRoleArn`, `EventBus.fromEventBusArn`, `Bucket.fromBucketName`, etc.)
91
+
-`DeepracerEventManagerStack` only takes `baseStackName: string` as a cross-stack prop
92
+
93
+
**When adding new resources to BaseStack that InfrastructureStack needs:**
94
+
1. Write the resource identifier to SSM in `BaseStack` constructor
95
+
2. Read it with `valueForStringParameter` in `DeepracerEventManagerStack` and reconstruct the CDK object
96
+
3. Do NOT pass it as a constructor prop — this would recreate the `Fn::ImportValue` dependency
97
+
98
+
**When removing resources from BaseStack:**
99
+
Because there are no `Fn::ImportValue` dependencies, you can remove a resource from `BaseStack` and deploy in a single pipeline run without the "cannot delete export in use" error. Ensure `InfrastructureStack` no longer reads the corresponding SSM parameter in the same commit.
0 commit comments