@worktif/runtime 0.3.0-edge.25 → 0.3.0-edge.26
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/out/dist/bin/templates/advanced/application/package.json +1 -1
- package/out/dist/bin/templates/advanced/cdk/bin/app.ts.template +1 -1
- package/out/dist/bin/templates/basic/application/package.json +1 -1
- package/out/dist/bin/templates/basic/cdk/bin/app.ts.template +37 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import 'reflect-metadata';
|
|
|
3
3
|
|
|
4
4
|
import * as cdk from 'aws-cdk-lib';
|
|
5
5
|
|
|
6
|
-
import { RuntimeInfraStack,
|
|
6
|
+
import { RuntimeInfraStack, RuntimeStack, RuntimeWebStack, sanitizeStackName } from '@worktif/runtime/infra';
|
|
7
7
|
import { getStage } from '@worktif/runtime/bin';
|
|
8
8
|
|
|
9
9
|
import { UsersTies } from '../../src/ties/users.ties';
|
|
@@ -3,7 +3,7 @@ import 'reflect-metadata';
|
|
|
3
3
|
|
|
4
4
|
import * as cdk from 'aws-cdk-lib';
|
|
5
5
|
|
|
6
|
-
import { RuntimeInfraStack, RuntimeStack, sanitizeStackName } from '@worktif/runtime/infra';
|
|
6
|
+
import { RuntimeInfraStack, RuntimeStack, RuntimeWebStack, sanitizeStackName } from '@worktif/runtime/infra';
|
|
7
7
|
import { getStage } from '@worktif/runtime/bin';
|
|
8
8
|
|
|
9
9
|
import runtimeConfig from '../../runtime.config';
|
|
@@ -91,6 +91,42 @@ const runtimeStack = new RuntimeStack(app, `${serviceName}-Runtime-${stage}`, {
|
|
|
91
91
|
// allowedOrigins: ['https://example.com', 'https://www.example.com'],
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
+
// Create the Runtime Web stack
|
|
95
|
+
// This stack maps high-level "register" configuration to concrete Lambda routes
|
|
96
|
+
// It reuses shared infrastructure from the Infrastructure stack via cross-stack references
|
|
97
|
+
const runtimeWebStack = new RuntimeWebStack(app, `${serviceName}-RuntimeWeb-${stage}`, {
|
|
98
|
+
// Stage name (dev, staging, prod)
|
|
99
|
+
// Must be consistent with other stacks in the same environment
|
|
100
|
+
stage: stage as 'dev' | 'staging' | 'prod',
|
|
101
|
+
|
|
102
|
+
// Service name for resource identification
|
|
103
|
+
// Used as a prefix for Runtime Web resources (Lambdas, logs, etc.)
|
|
104
|
+
serviceName,
|
|
105
|
+
|
|
106
|
+
// Reference to Infrastructure stack for shared resources (tables, buckets, queues, etc.)
|
|
107
|
+
infraStack,
|
|
108
|
+
|
|
109
|
+
// AWS environment configuration (account + region)
|
|
110
|
+
// Should match the env used in Infrastructure and Runtime stacks
|
|
111
|
+
env,
|
|
112
|
+
|
|
113
|
+
// Runtime Web "register" configuration:
|
|
114
|
+
// microservice registry with service definition
|
|
115
|
+
register: {},
|
|
116
|
+
|
|
117
|
+
// API mode – how Runtime Web exposes HTTP endpoints
|
|
118
|
+
// 'apiGateway' uses Amazon API Gateway (recommended for production)
|
|
119
|
+
apiMode: 'apiGateway',
|
|
120
|
+
|
|
121
|
+
// Default memory size (in MB) for Lambda functions managed by Runtime Web
|
|
122
|
+
// Tune per workload if needed for performance / cost optimization
|
|
123
|
+
lambdaMemorySize: 512,
|
|
124
|
+
|
|
125
|
+
// Default Lambda timeout (in seconds) for Runtime Web handlers
|
|
126
|
+
// Should cover typical request latency including external integrations
|
|
127
|
+
lambdaTimeout: 30,
|
|
128
|
+
});
|
|
129
|
+
|
|
94
130
|
// To add more stages (staging, prod), duplicate the stack instantiation:
|
|
95
131
|
// const infraStackStaging = new RuntimeInfraStack(app, 'RuntimeInfraStack-staging', {
|
|
96
132
|
// stage: 'staging',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@worktif/runtime",
|
|
3
|
-
"version": "0.3.0-edge.
|
|
3
|
+
"version": "0.3.0-edge.26",
|
|
4
4
|
"description": "Serverless web framework running on AWS Lambda with support for server-side rendering, caching, and CI/CD.",
|
|
5
5
|
"repository": "git@bitbucket.org:worktif/runtime-target.git",
|
|
6
6
|
"author": "Raman Marozau <raman@worktif.com>",
|