-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata-plane-stack.ts
More file actions
36 lines (29 loc) · 1.46 KB
/
Copy pathdata-plane-stack.ts
File metadata and controls
36 lines (29 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { CfnOutput, Stack, StackProps, Tags } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { DueWorkTable } from './due-work-table';
import { EnvName } from './env';
import { TenantTable } from './tenant-table';
export interface DataPlaneStackProps extends StackProps {
readonly envName: EnvName;
}
/**
* The data plane (roadmap architecture diagram; AD1/AD3/AD4). DynamoDB tables backing the
* `openjobradar.tenancy`/`openjobradar.scheduling` Python storage protocols — no compute lives
* here yet. This stack's whole job is making ADR-0016/ADR-0018's storage contracts deployable,
* one table per protocol, matching those interfaces exactly. See ADR-0021 for the single-table
* decision and the due-work GSI design.
*/
export class DataPlaneStack extends Stack {
public readonly tenantTable: TenantTable;
public readonly dueWorkTable: DueWorkTable;
constructor(scope: Construct, id: string, props: DataPlaneStackProps) {
super(scope, id, props);
const retain = props.envName === 'prod';
this.tenantTable = new TenantTable(this, 'TenantTable', { retain });
this.dueWorkTable = new DueWorkTable(this, 'DueWorkTable', { retain });
Tags.of(this).add('openjobradar:env', props.envName);
Tags.of(this).add('openjobradar:stack', 'data-plane');
new CfnOutput(this, 'TenantTableName', { value: this.tenantTable.table.tableName });
new CfnOutput(this, 'DueWorkTableName', { value: this.dueWorkTable.table.tableName });
}
}