Extend an Abstract Stack
The framework’s stacks are abstract classes you extend. axs add stack scaffolds a subclass for you, but the shape is simple enough to write by hand: subclass the abstract stack and supply its project hooks.
The ApiStack hooks
Section titled “The ApiStack hooks”An ApiStack subclass supplies two hooks — the route list and the registry resources that resolve {{token}} env values:
export class AppApiStack<T extends BaseEnvConfig> extends ApiStack<T> { protected getLambdaConfigs(): ApiLambdaConfig[] { return apiLambdaConfigs; }
protected buildRegistryResources(): Omit<BuildRegistryProps, "stage"> { // Read ARNs from SSM (written by DataStack) and register handles so // lambda env tokens like {{dynamodb.mainTable.tableName}} resolve. return { app: { corsAllowedOrigins: this.envConfig.corsAllowedOrigins?.join(",") ?? "" } }; }}The DataStack hook
Section titled “The DataStack hook”A DataStack subclass passes its config arrays through super:
export class AppDataStack<T extends BaseEnvConfig> extends DataStack<T> { constructor(scope: Construct, id: string, props: DataStackProps<T>) { super(scope, id, { ...props, tables }); }}Generate one with the CLI
Section titled “Generate one with the CLI”axs add stack apiSee the axs add stack reference — it prints the exact bin/app.ts wiring snippet too.
Where to go next
Section titled “Where to go next”- Stacks & SSM Wiring for the cross-stack contract.
- Add Your Own Stack when a subclass isn’t enough.
© 2026 Axis Tech. Powered by axis-tech.co.