quidproquo-deploy-awscdk 0.0.74 → 0.0.75
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/lib/constructs/feature/core/queue/QpqCoreQueueConstruct.js +1 -1
- package/lib/constructs/feature/webserver/api/QpqWebserverApiConstruct.js +24 -0
- package/package.json +1 -1
- package/src/constructs/feature/core/queue/QpqCoreQueueConstruct.ts +1 -1
- package/src/constructs/feature/webserver/api/QpqWebserverApiConstruct.ts +27 -0
|
@@ -60,7 +60,7 @@ class QpqCoreQueueConstruct extends QpqCoreQueueConstructBase {
|
|
|
60
60
|
visibilityTimeout: cdk.Duration.seconds(props.queueConfig.ttRetryInSeconds),
|
|
61
61
|
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
62
62
|
deadLetterQueue: {
|
|
63
|
-
maxReceiveCount: props.queueConfig.
|
|
63
|
+
maxReceiveCount: props.queueConfig.maxTries,
|
|
64
64
|
queue: new aws_cdk_lib_1.aws_sqs.Queue(this, 'DeadLetterQueue', {
|
|
65
65
|
queueName: this.resourceName(`${props.queueConfig.name}-dead`),
|
|
66
66
|
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
@@ -58,6 +58,10 @@ class QpqWebserverApiConstruct extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
58
58
|
grantables.forEach((g) => {
|
|
59
59
|
g.grantAll(func.lambdaFunction);
|
|
60
60
|
});
|
|
61
|
+
// const routes = qpqWebServerUtils.getAllRoutesForApi(props.apiConfig.apiName, props.qpqConfig);
|
|
62
|
+
// const apiKeys = routes.reduce((acc, r) => {
|
|
63
|
+
// return [...acc, ...(r.options.routeAuthSettings?.apiKeys || [])];
|
|
64
|
+
// }, [] as ApiKey[]);
|
|
61
65
|
// Create a rest api
|
|
62
66
|
const api = new aws_cdk_lib_1.aws_apigateway.LambdaRestApi(this, 'lambda-rest-api', {
|
|
63
67
|
restApiName: this.resourceName(`${props.apiConfig.apiName}-rest-api`),
|
|
@@ -68,7 +72,27 @@ class QpqWebserverApiConstruct extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
68
72
|
},
|
|
69
73
|
binaryMediaTypes: ['*/*'],
|
|
70
74
|
proxy: true,
|
|
75
|
+
// defaultMethodOptions: {
|
|
76
|
+
// apiKeyRequired: apiKeys.length > 0,
|
|
77
|
+
// },
|
|
71
78
|
});
|
|
79
|
+
// const usagePlan = api.addUsagePlan(this.qpqResourceName(props.apiConfig.apiName, 'usagePlan'), {
|
|
80
|
+
// apiStages: [
|
|
81
|
+
// {
|
|
82
|
+
// api,
|
|
83
|
+
// stage: api.deploymentStage,
|
|
84
|
+
// },
|
|
85
|
+
// ],
|
|
86
|
+
// });
|
|
87
|
+
// apiKeys.forEach((apiKey) => {
|
|
88
|
+
// const name = `${props.apiConfig.apiName}-${apiKey.name}`;
|
|
89
|
+
// usagePlan.addApiKey(
|
|
90
|
+
// api.addApiKey(this.qpqResourceName(name, 'apiKey'), {
|
|
91
|
+
// description: apiKey.description,
|
|
92
|
+
// apiKeyName: this.resourceName(name),
|
|
93
|
+
// }),
|
|
94
|
+
// );
|
|
95
|
+
// });
|
|
72
96
|
// Map all requests to this service to /serviceName/*
|
|
73
97
|
new aws_cdk_lib_1.aws_apigateway.BasePathMapping(this, 'rest-bpm', {
|
|
74
98
|
domainName: subdomain.domainName,
|
package/package.json
CHANGED
|
@@ -65,7 +65,7 @@ export class QpqCoreQueueConstruct extends QpqCoreQueueConstructBase {
|
|
|
65
65
|
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
66
66
|
|
|
67
67
|
deadLetterQueue: {
|
|
68
|
-
maxReceiveCount: props.queueConfig.
|
|
68
|
+
maxReceiveCount: props.queueConfig.maxTries,
|
|
69
69
|
queue: new aws_sqs.Queue(this, 'DeadLetterQueue', {
|
|
70
70
|
queueName: this.resourceName(`${props.queueConfig.name}-dead`),
|
|
71
71
|
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
@@ -59,6 +59,11 @@ export class QpqWebserverApiConstruct extends QpqConstructBlock {
|
|
|
59
59
|
g.grantAll(func.lambdaFunction);
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
+
// const routes = qpqWebServerUtils.getAllRoutesForApi(props.apiConfig.apiName, props.qpqConfig);
|
|
63
|
+
// const apiKeys = routes.reduce((acc, r) => {
|
|
64
|
+
// return [...acc, ...(r.options.routeAuthSettings?.apiKeys || [])];
|
|
65
|
+
// }, [] as ApiKey[]);
|
|
66
|
+
|
|
62
67
|
// Create a rest api
|
|
63
68
|
const api = new aws_apigateway.LambdaRestApi(this, 'lambda-rest-api', {
|
|
64
69
|
restApiName: this.resourceName(`${props.apiConfig.apiName}-rest-api`),
|
|
@@ -69,8 +74,30 @@ export class QpqWebserverApiConstruct extends QpqConstructBlock {
|
|
|
69
74
|
},
|
|
70
75
|
binaryMediaTypes: ['*/*'],
|
|
71
76
|
proxy: true,
|
|
77
|
+
// defaultMethodOptions: {
|
|
78
|
+
// apiKeyRequired: apiKeys.length > 0,
|
|
79
|
+
// },
|
|
72
80
|
});
|
|
73
81
|
|
|
82
|
+
// const usagePlan = api.addUsagePlan(this.qpqResourceName(props.apiConfig.apiName, 'usagePlan'), {
|
|
83
|
+
// apiStages: [
|
|
84
|
+
// {
|
|
85
|
+
// api,
|
|
86
|
+
// stage: api.deploymentStage,
|
|
87
|
+
// },
|
|
88
|
+
// ],
|
|
89
|
+
// });
|
|
90
|
+
|
|
91
|
+
// apiKeys.forEach((apiKey) => {
|
|
92
|
+
// const name = `${props.apiConfig.apiName}-${apiKey.name}`;
|
|
93
|
+
// usagePlan.addApiKey(
|
|
94
|
+
// api.addApiKey(this.qpqResourceName(name, 'apiKey'), {
|
|
95
|
+
// description: apiKey.description,
|
|
96
|
+
// apiKeyName: this.resourceName(name),
|
|
97
|
+
// }),
|
|
98
|
+
// );
|
|
99
|
+
// });
|
|
100
|
+
|
|
74
101
|
// Map all requests to this service to /serviceName/*
|
|
75
102
|
new aws_apigateway.BasePathMapping(this, 'rest-bpm', {
|
|
76
103
|
domainName: subdomain.domainName,
|