@aws/nx-plugin 0.95.0 → 0.96.0
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/package.json +1 -1
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +14 -12
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +8 -6
- package/src/terraform/project/generator.js +3 -0
- package/src/terraform/project/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +24 -18
- package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +6 -8
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +6 -8
package/package.json
CHANGED
|
@@ -491,15 +491,16 @@ export class TestApi<
|
|
|
491
491
|
timeout: Duration.seconds(30),
|
|
492
492
|
tracing: Tracing.ACTIVE,
|
|
493
493
|
snapStart: SnapStartConf.ON_PUBLISHED_VERSIONS,
|
|
494
|
-
environment: {
|
|
495
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
496
|
-
PORT: '8000',
|
|
497
|
-
AWS_LWA_INVOKE_MODE: 'buffered',
|
|
498
|
-
AWS_LAMBDA_EXEC_WRAPPER: '/opt/bootstrap',
|
|
499
|
-
},
|
|
500
494
|
},
|
|
501
495
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
502
496
|
const handler = new Function(scope, \`TestApi\${op}Handler\`, props);
|
|
497
|
+
handler.addEnvironment(
|
|
498
|
+
'RUNTIME_CONFIG_APP_ID',
|
|
499
|
+
rc.appConfigApplicationId,
|
|
500
|
+
);
|
|
501
|
+
handler.addEnvironment('PORT', '8000');
|
|
502
|
+
handler.addEnvironment('AWS_LWA_INVOKE_MODE', 'buffered');
|
|
503
|
+
handler.addEnvironment('AWS_LAMBDA_EXEC_WRAPPER', '/opt/bootstrap');
|
|
503
504
|
rc.grantReadAppConfig(handler);
|
|
504
505
|
const stack = Stack.of(scope);
|
|
505
506
|
handler.addLayers(
|
|
@@ -1276,15 +1277,16 @@ export class TestApi<
|
|
|
1276
1277
|
timeout: Duration.seconds(30),
|
|
1277
1278
|
tracing: Tracing.ACTIVE,
|
|
1278
1279
|
snapStart: SnapStartConf.ON_PUBLISHED_VERSIONS,
|
|
1279
|
-
environment: {
|
|
1280
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
1281
|
-
PORT: '8000',
|
|
1282
|
-
AWS_LWA_INVOKE_MODE: 'response_stream',
|
|
1283
|
-
AWS_LAMBDA_EXEC_WRAPPER: '/opt/bootstrap',
|
|
1284
|
-
},
|
|
1285
1280
|
},
|
|
1286
1281
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
1287
1282
|
const handler = new Function(scope, \`TestApi\${op}Handler\`, props);
|
|
1283
|
+
handler.addEnvironment(
|
|
1284
|
+
'RUNTIME_CONFIG_APP_ID',
|
|
1285
|
+
rc.appConfigApplicationId,
|
|
1286
|
+
);
|
|
1287
|
+
handler.addEnvironment('PORT', '8000');
|
|
1288
|
+
handler.addEnvironment('AWS_LWA_INVOKE_MODE', 'response_stream');
|
|
1289
|
+
handler.addEnvironment('AWS_LAMBDA_EXEC_WRAPPER', '/opt/bootstrap');
|
|
1288
1290
|
rc.grantReadAppConfig(handler);
|
|
1289
1291
|
const stack = Stack.of(scope);
|
|
1290
1292
|
handler.addLayers(
|
|
@@ -122,12 +122,13 @@ export class TestApi<
|
|
|
122
122
|
),
|
|
123
123
|
timeout: Duration.seconds(30),
|
|
124
124
|
tracing: Tracing.ACTIVE,
|
|
125
|
-
environment: {
|
|
126
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
127
|
-
},
|
|
128
125
|
},
|
|
129
126
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
130
127
|
const handler = new Function(scope, \`TestApi\${op}Handler\`, props);
|
|
128
|
+
handler.addEnvironment(
|
|
129
|
+
'RUNTIME_CONFIG_APP_ID',
|
|
130
|
+
rc.appConfigApplicationId,
|
|
131
|
+
);
|
|
131
132
|
rc.grantReadAppConfig(handler);
|
|
132
133
|
return {
|
|
133
134
|
handler,
|
|
@@ -295,12 +296,13 @@ export class TestApi<
|
|
|
295
296
|
),
|
|
296
297
|
timeout: Duration.seconds(30),
|
|
297
298
|
tracing: Tracing.ACTIVE,
|
|
298
|
-
environment: {
|
|
299
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
300
|
-
},
|
|
301
299
|
},
|
|
302
300
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
303
301
|
const handler = new Function(scope, \`TestApi\${op}Handler\`, props);
|
|
302
|
+
handler.addEnvironment(
|
|
303
|
+
'RUNTIME_CONFIG_APP_ID',
|
|
304
|
+
rc.appConfigApplicationId,
|
|
305
|
+
);
|
|
304
306
|
rc.grantReadAppConfig(handler);
|
|
305
307
|
return {
|
|
306
308
|
handler,
|
|
@@ -74,6 +74,9 @@ async function terraformProjectGenerator(tree, schema) {
|
|
|
74
74
|
build: {
|
|
75
75
|
dependsOn: ['fmt', 'test', `${sharedTfProjectName}:build`],
|
|
76
76
|
},
|
|
77
|
+
deploy: {
|
|
78
|
+
dependsOn: ['apply'],
|
|
79
|
+
},
|
|
77
80
|
destroy: {
|
|
78
81
|
executor: 'nx:run-commands',
|
|
79
82
|
defaultConfiguration: 'dev',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/terraform/project/generator.ts"],"names":[],"mappings":";;;AA2CA,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/terraform/project/generator.ts"],"names":[],"mappings":";;;AA2CA,8DAuQC;AAlTD;;;GAGG;AACH,uCAcoB;AAEpB,sDAAyD;AACzD,+BAAsC;AACtC,+CAAoD;AACpD,uCAIwB;AACxB,yCAAkD;AAClD,mDAAoD;AACpD,iDAAsE;AACtE,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EAAE,EAAE;YAC/C,WAAW,CAAC,SAAS,GAAG;gBACtB,GAAG,WAAW,CAAC,SAAS;gBACxB,GAAG,IAAA,uBAAY,EAAC,CAAC,YAAY,CAAC,CAAC;aAChC,CAAC;YACF,OAAO,WAAW,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC;AACD,kBAAe,yBAAyB,CAAC"}
|
|
@@ -442,12 +442,13 @@ export class TestApi<
|
|
|
442
442
|
),
|
|
443
443
|
timeout: Duration.seconds(30),
|
|
444
444
|
tracing: Tracing.ACTIVE,
|
|
445
|
-
environment: {
|
|
446
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
447
|
-
},
|
|
448
445
|
},
|
|
449
446
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
450
447
|
const handler = new Function(scope, \`TestApi\${op}Handler\`, props);
|
|
448
|
+
handler.addEnvironment(
|
|
449
|
+
'RUNTIME_CONFIG_APP_ID',
|
|
450
|
+
rc.appConfigApplicationId,
|
|
451
|
+
);
|
|
451
452
|
rc.grantReadAppConfig(handler);
|
|
452
453
|
return {
|
|
453
454
|
handler,
|
|
@@ -643,12 +644,13 @@ export class TestApi<
|
|
|
643
644
|
),
|
|
644
645
|
timeout: Duration.seconds(30),
|
|
645
646
|
tracing: Tracing.ACTIVE,
|
|
646
|
-
environment: {
|
|
647
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
648
|
-
},
|
|
649
647
|
},
|
|
650
648
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
651
649
|
const handler = new Function(scope, \`TestApi\${op}Handler\`, props);
|
|
650
|
+
handler.addEnvironment(
|
|
651
|
+
'RUNTIME_CONFIG_APP_ID',
|
|
652
|
+
rc.appConfigApplicationId,
|
|
653
|
+
);
|
|
652
654
|
rc.grantReadAppConfig(handler);
|
|
653
655
|
return {
|
|
654
656
|
handler,
|
|
@@ -848,12 +850,13 @@ export class TestApi<
|
|
|
848
850
|
),
|
|
849
851
|
timeout: Duration.seconds(30),
|
|
850
852
|
tracing: Tracing.ACTIVE,
|
|
851
|
-
environment: {
|
|
852
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
853
|
-
},
|
|
854
853
|
},
|
|
855
854
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
856
855
|
const handler = new Function(scope, \`TestApi\${op}Handler\`, props);
|
|
856
|
+
handler.addEnvironment(
|
|
857
|
+
'RUNTIME_CONFIG_APP_ID',
|
|
858
|
+
rc.appConfigApplicationId,
|
|
859
|
+
);
|
|
857
860
|
rc.grantReadAppConfig(handler);
|
|
858
861
|
return {
|
|
859
862
|
handler,
|
|
@@ -1037,12 +1040,13 @@ export class TestApi<
|
|
|
1037
1040
|
),
|
|
1038
1041
|
timeout: Duration.seconds(30),
|
|
1039
1042
|
tracing: Tracing.ACTIVE,
|
|
1040
|
-
environment: {
|
|
1041
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
1042
|
-
},
|
|
1043
1043
|
},
|
|
1044
1044
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
1045
1045
|
const handler = new Function(scope, \`TestApi\${op}Handler\`, props);
|
|
1046
|
+
handler.addEnvironment(
|
|
1047
|
+
'RUNTIME_CONFIG_APP_ID',
|
|
1048
|
+
rc.appConfigApplicationId,
|
|
1049
|
+
);
|
|
1046
1050
|
rc.grantReadAppConfig(handler);
|
|
1047
1051
|
return {
|
|
1048
1052
|
handler,
|
|
@@ -1361,12 +1365,13 @@ export class TestApi<
|
|
|
1361
1365
|
),
|
|
1362
1366
|
timeout: Duration.seconds(30),
|
|
1363
1367
|
tracing: Tracing.ACTIVE,
|
|
1364
|
-
environment: {
|
|
1365
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
1366
|
-
},
|
|
1367
1368
|
},
|
|
1368
1369
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
1369
1370
|
const handler = new Function(scope, \`TestApi\${op}Handler\`, props);
|
|
1371
|
+
handler.addEnvironment(
|
|
1372
|
+
'RUNTIME_CONFIG_APP_ID',
|
|
1373
|
+
rc.appConfigApplicationId,
|
|
1374
|
+
);
|
|
1370
1375
|
rc.grantReadAppConfig(handler);
|
|
1371
1376
|
return {
|
|
1372
1377
|
handler,
|
|
@@ -2204,12 +2209,13 @@ export class TestApi<
|
|
|
2204
2209
|
),
|
|
2205
2210
|
timeout: Duration.seconds(30),
|
|
2206
2211
|
tracing: Tracing.ACTIVE,
|
|
2207
|
-
environment: {
|
|
2208
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
2209
|
-
},
|
|
2210
2212
|
},
|
|
2211
2213
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
2212
2214
|
const handler = new Function(scope, \`TestApi\${op}Handler\`, props);
|
|
2215
|
+
handler.addEnvironment(
|
|
2216
|
+
'RUNTIME_CONFIG_APP_ID',
|
|
2217
|
+
rc.appConfigApplicationId,
|
|
2218
|
+
);
|
|
2213
2219
|
rc.grantReadAppConfig(handler);
|
|
2214
2220
|
return {
|
|
2215
2221
|
handler,
|
|
@@ -137,19 +137,17 @@ export class <%= apiNameClassName %><
|
|
|
137
137
|
<%_ if (backend.type === 'fastapi') { _%>
|
|
138
138
|
snapStart: SnapStartConf.ON_PUBLISHED_VERSIONS,
|
|
139
139
|
<%_ } _%>
|
|
140
|
-
environment: {
|
|
141
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
142
|
-
<%_ if (backend.type === 'fastapi') { _%>
|
|
143
|
-
PORT: '8000',
|
|
144
|
-
AWS_LWA_INVOKE_MODE: 'buffered',
|
|
145
|
-
AWS_LAMBDA_EXEC_WRAPPER: '/opt/bootstrap',
|
|
146
|
-
<%_ } _%>
|
|
147
|
-
},
|
|
148
140
|
},
|
|
149
141
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
150
142
|
<%_ const lambdaTarget = backend.type === 'fastapi' ? 'handler.currentVersion' : 'handler'; _%>
|
|
151
143
|
<%_ const integrationOptions = backend.integrationPattern === 'shared' ? ', { scopePermissionToRoute: false }' : ''; _%>
|
|
152
144
|
const handler = new Function(scope, `<%= apiNameClassName %>${op}Handler`, props);
|
|
145
|
+
handler.addEnvironment('RUNTIME_CONFIG_APP_ID', rc.appConfigApplicationId);
|
|
146
|
+
<%_ if (backend.type === 'fastapi') { _%>
|
|
147
|
+
handler.addEnvironment('PORT', '8000');
|
|
148
|
+
handler.addEnvironment('AWS_LWA_INVOKE_MODE', 'buffered');
|
|
149
|
+
handler.addEnvironment('AWS_LAMBDA_EXEC_WRAPPER', '/opt/bootstrap');
|
|
150
|
+
<%_ } _%>
|
|
153
151
|
rc.grantReadAppConfig(handler);
|
|
154
152
|
<%_ if (backend.type === 'fastapi') { _%>
|
|
155
153
|
const stack = Stack.of(scope);
|
|
@@ -138,14 +138,6 @@ export class <%= apiNameClassName %><
|
|
|
138
138
|
<%_ if (backend.type === 'fastapi') { _%>
|
|
139
139
|
snapStart: SnapStartConf.ON_PUBLISHED_VERSIONS,
|
|
140
140
|
<%_ } _%>
|
|
141
|
-
environment: {
|
|
142
|
-
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
143
|
-
<%_ if (backend.type === 'fastapi') { _%>
|
|
144
|
-
PORT: '8000',
|
|
145
|
-
AWS_LWA_INVOKE_MODE: 'response_stream',
|
|
146
|
-
AWS_LAMBDA_EXEC_WRAPPER: '/opt/bootstrap',
|
|
147
|
-
<%_ } _%>
|
|
148
|
-
},
|
|
149
141
|
},
|
|
150
142
|
buildDefaultIntegration: (op, props: FunctionProps) => {
|
|
151
143
|
<%_ const lambdaTarget = backend.type === 'fastapi' ? 'handler.currentVersion' : 'handler'; _%>
|
|
@@ -164,6 +156,12 @@ export class <%= apiNameClassName %><
|
|
|
164
156
|
: '';
|
|
165
157
|
_%>
|
|
166
158
|
const handler = new Function(scope, `<%= apiNameClassName %>${op}Handler`, props);
|
|
159
|
+
handler.addEnvironment('RUNTIME_CONFIG_APP_ID', rc.appConfigApplicationId);
|
|
160
|
+
<%_ if (backend.type === 'fastapi') { _%>
|
|
161
|
+
handler.addEnvironment('PORT', '8000');
|
|
162
|
+
handler.addEnvironment('AWS_LWA_INVOKE_MODE', 'response_stream');
|
|
163
|
+
handler.addEnvironment('AWS_LAMBDA_EXEC_WRAPPER', '/opt/bootstrap');
|
|
164
|
+
<%_ } _%>
|
|
167
165
|
rc.grantReadAppConfig(handler);
|
|
168
166
|
<%_ if (backend.type === 'fastapi') { _%>
|
|
169
167
|
const stack = Stack.of(scope);
|