@gradientedge/cdk-utils 8.90.0 → 8.92.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/.eslintrc.json +40 -0
- package/app/api-destined-function/src/lib/lambda.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.d.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.js +6 -6
- package/dist/lib/lambda.d.ts +6 -6
- package/dist/lib/lambda.js +6 -6
- package/dist/lib/lambda.js.map +1 -1
- package/dist/src/lib/common/construct.d.ts +4 -7
- package/dist/src/lib/common/construct.js +4 -7
- package/dist/src/lib/common/stack.d.ts +9 -13
- package/dist/src/lib/common/stack.js +9 -13
- package/dist/src/lib/common/types.d.ts +0 -2
- package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +0 -27
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +41 -68
- package/dist/src/lib/construct/api-to-eventbridge-target/types.d.ts +13 -25
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +0 -37
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +44 -81
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.d.ts +1 -5
- package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +0 -14
- package/dist/src/lib/construct/api-to-lambda-target/main.js +7 -21
- package/dist/src/lib/construct/api-to-lambda-target/types.d.ts +7 -13
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +0 -18
- package/dist/src/lib/construct/graphql-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/graphql-api-lambda/types.d.ts +4 -8
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +1 -12
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +0 -12
- package/dist/src/lib/construct/lambda-with-iam-access/main.js +2 -14
- package/dist/src/lib/construct/rest-api-lambda/main.d.ts +0 -18
- package/dist/src/lib/construct/rest-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/rest-api-lambda/types.d.ts +7 -12
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +3 -14
- package/dist/src/lib/construct/rest-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +0 -25
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +32 -52
- package/dist/src/lib/construct/site-with-ecs-backend/types.d.ts +10 -11
- package/dist/src/lib/construct/static-asset-deployment/main.d.ts +0 -8
- package/dist/src/lib/construct/static-asset-deployment/main.js +0 -8
- package/dist/src/lib/construct/static-asset-deployment/types.d.ts +1 -1
- package/dist/src/lib/construct/static-site/main.d.ts +0 -17
- package/dist/src/lib/construct/static-site/main.js +1 -18
- package/dist/src/lib/construct/static-site/types.d.ts +9 -11
- package/dist/src/lib/services/aws/api-gateway/main.d.ts +21 -25
- package/dist/src/lib/services/aws/api-gateway/main.js +42 -46
- package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -2
- package/dist/src/lib/services/aws/appconfig/constants.d.ts +0 -6
- package/dist/src/lib/services/aws/appconfig/constants.js +26 -32
- package/dist/src/lib/services/aws/appconfig/main.d.ts +16 -19
- package/dist/src/lib/services/aws/appconfig/main.js +19 -22
- package/dist/src/lib/services/aws/appconfig/types.d.ts +1 -3
- package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -10
- package/dist/src/lib/services/aws/certificate-manager/main.js +5 -10
- package/dist/src/lib/services/aws/certificate-manager/types.d.ts +3 -5
- package/dist/src/lib/services/aws/cloudfront/main.d.ts +41 -47
- package/dist/src/lib/services/aws/cloudfront/main.js +56 -62
- package/dist/src/lib/services/aws/cloudfront/types.d.ts +1 -7
- package/dist/src/lib/services/aws/cloudtrail/main.d.ts +8 -12
- package/dist/src/lib/services/aws/cloudtrail/main.js +8 -12
- package/dist/src/lib/services/aws/cloudtrail/types.d.ts +0 -2
- package/dist/src/lib/services/aws/cloudwatch/logs.d.ts +11 -15
- package/dist/src/lib/services/aws/cloudwatch/logs.js +15 -19
- package/dist/src/lib/services/aws/cloudwatch/main.d.ts +80 -84
- package/dist/src/lib/services/aws/cloudwatch/main.js +116 -122
- package/dist/src/lib/services/aws/cloudwatch/types.d.ts +20 -42
- package/dist/src/lib/services/aws/codebuild/main.d.ts +0 -4
- package/dist/src/lib/services/aws/codebuild/main.js +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.js +13 -17
- package/dist/src/lib/services/aws/dynamodb/types.d.ts +0 -2
- package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +3 -7
- package/dist/src/lib/services/aws/elastic-container-registry/main.js +3 -7
- package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +19 -23
- package/dist/src/lib/services/aws/elastic-container-service/main.js +35 -39
- package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +1 -9
- package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +9 -13
- package/dist/src/lib/services/aws/elastic-file-system/main.js +14 -18
- package/dist/src/lib/services/aws/elastic-file-system/types.d.ts +1 -5
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +5 -9
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -12
- package/dist/src/lib/services/aws/elastic-kubernetes-service/types.d.ts +1 -3
- package/dist/src/lib/services/aws/elasticache/main.d.ts +14 -18
- package/dist/src/lib/services/aws/elasticache/main.js +35 -39
- package/dist/src/lib/services/aws/elasticache/types.d.ts +0 -4
- package/dist/src/lib/services/aws/eventbridge/main.d.ts +25 -29
- package/dist/src/lib/services/aws/eventbridge/main.js +34 -38
- package/dist/src/lib/services/aws/eventbridge/target.d.ts +6 -9
- package/dist/src/lib/services/aws/eventbridge/target.js +8 -10
- package/dist/src/lib/services/aws/eventbridge/types.d.ts +2 -10
- package/dist/src/lib/services/aws/evidently/main.d.ts +15 -19
- package/dist/src/lib/services/aws/evidently/main.js +19 -23
- package/dist/src/lib/services/aws/evidently/types.d.ts +0 -10
- package/dist/src/lib/services/aws/identity-access-management/main.d.ts +66 -70
- package/dist/src/lib/services/aws/identity-access-management/main.js +97 -101
- package/dist/src/lib/services/aws/key-management-service/main.d.ts +3 -7
- package/dist/src/lib/services/aws/key-management-service/main.js +6 -10
- package/dist/src/lib/services/aws/key-management-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/lambda/main.d.ts +42 -47
- package/dist/src/lib/services/aws/lambda/main.js +64 -69
- package/dist/src/lib/services/aws/lambda/types.d.ts +6 -16
- package/dist/src/lib/services/aws/route53/main.d.ts +17 -21
- package/dist/src/lib/services/aws/route53/main.js +19 -23
- package/dist/src/lib/services/aws/route53/types.d.ts +0 -2
- package/dist/src/lib/services/aws/secrets-manager/main.d.ts +6 -19
- package/dist/src/lib/services/aws/secrets-manager/main.js +6 -25
- package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +8 -12
- package/dist/src/lib/services/aws/simple-notification-service/main.js +10 -14
- package/dist/src/lib/services/aws/simple-notification-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +11 -15
- package/dist/src/lib/services/aws/simple-queue-service/main.js +19 -23
- package/dist/src/lib/services/aws/simple-queue-service/types.d.ts +4 -6
- package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +24 -32
- package/dist/src/lib/services/aws/simple-storage-service/main.js +32 -40
- package/dist/src/lib/services/aws/simple-storage-service/types.d.ts +2 -8
- package/dist/src/lib/services/aws/step-function/main.d.ts +55 -59
- package/dist/src/lib/services/aws/step-function/main.js +91 -95
- package/dist/src/lib/services/aws/step-function/types.d.ts +0 -32
- package/dist/src/lib/services/aws/systems-manager/main.d.ts +10 -16
- package/dist/src/lib/services/aws/systems-manager/main.js +13 -19
- package/dist/src/lib/services/aws/systems-manager/types.d.ts +0 -2
- package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +9 -12
- package/dist/src/lib/services/aws/virtual-private-cloud/main.js +10 -16
- package/dist/src/lib/services/aws/web-application-firewall/index.d.ts +1 -0
- package/dist/src/lib/services/aws/web-application-firewall/index.js +1 -0
- package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +6 -10
- package/dist/src/lib/services/aws/web-application-firewall/main.js +12 -16
- package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +0 -4
- package/dist/src/lib/types/aws/index.d.ts +0 -2
- package/dist/src/lib/utils/aws/index.d.ts +6 -9
- package/dist/src/lib/utils/aws/index.js +7 -10
- package/dist/src/lib/utils/index.d.ts +6 -13
- package/dist/src/lib/utils/index.js +4 -12
- package/package.json +5 -5
- package/src/lib/common/construct.ts +4 -7
- package/src/lib/common/stack.ts +9 -13
- package/src/lib/common/types.ts +0 -2
- package/src/lib/construct/api-to-eventbridge-target/api.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/event.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/main.ts +41 -68
- package/src/lib/construct/api-to-eventbridge-target/types.ts +13 -25
- package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +44 -81
- package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +1 -5
- package/src/lib/construct/api-to-lambda-target/api.ts +0 -3
- package/src/lib/construct/api-to-lambda-target/main.ts +7 -21
- package/src/lib/construct/api-to-lambda-target/types.ts +7 -13
- package/src/lib/construct/graphql-api-lambda/main.ts +1 -19
- package/src/lib/construct/graphql-api-lambda/types.ts +4 -8
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -12
- package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/lambda-with-iam-access/main.ts +2 -14
- package/src/lib/construct/rest-api-lambda/main.ts +1 -19
- package/src/lib/construct/rest-api-lambda/types.ts +7 -12
- package/src/lib/construct/rest-api-lambda-with-cache/main.ts +3 -14
- package/src/lib/construct/rest-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/site-with-ecs-backend/main.ts +31 -52
- package/src/lib/construct/site-with-ecs-backend/types.ts +10 -11
- package/src/lib/construct/static-asset-deployment/main.ts +0 -8
- package/src/lib/construct/static-asset-deployment/types.ts +1 -1
- package/src/lib/construct/static-site/main.ts +1 -18
- package/src/lib/construct/static-site/types.ts +9 -11
- package/src/lib/services/aws/api-gateway/main.ts +43 -47
- package/src/lib/services/aws/api-gateway/types.ts +0 -2
- package/src/lib/services/aws/appconfig/constants.ts +26 -32
- package/src/lib/services/aws/appconfig/main.ts +19 -22
- package/src/lib/services/aws/appconfig/types.ts +1 -3
- package/src/lib/services/aws/certificate-manager/main.ts +5 -10
- package/src/lib/services/aws/certificate-manager/types.ts +3 -5
- package/src/lib/services/aws/cloudfront/main.ts +56 -62
- package/src/lib/services/aws/cloudfront/types.ts +1 -7
- package/src/lib/services/aws/cloudtrail/main.ts +8 -12
- package/src/lib/services/aws/cloudtrail/types.ts +0 -2
- package/src/lib/services/aws/cloudwatch/logs.ts +15 -19
- package/src/lib/services/aws/cloudwatch/main.ts +116 -122
- package/src/lib/services/aws/cloudwatch/types.ts +20 -42
- package/src/lib/services/aws/codebuild/main.ts +3 -7
- package/src/lib/services/aws/dynamodb/main.ts +13 -17
- package/src/lib/services/aws/dynamodb/types.ts +0 -2
- package/src/lib/services/aws/elastic-container-registry/main.ts +3 -7
- package/src/lib/services/aws/elastic-container-service/main.ts +35 -39
- package/src/lib/services/aws/elastic-container-service/types.ts +1 -9
- package/src/lib/services/aws/elastic-file-system/main.ts +14 -18
- package/src/lib/services/aws/elastic-file-system/types.ts +1 -5
- package/src/lib/services/aws/elastic-kubernetes-service/main.ts +8 -12
- package/src/lib/services/aws/elastic-kubernetes-service/types.ts +1 -3
- package/src/lib/services/aws/elasticache/main.ts +35 -39
- package/src/lib/services/aws/elasticache/types.ts +0 -4
- package/src/lib/services/aws/eventbridge/main.ts +34 -38
- package/src/lib/services/aws/eventbridge/target.ts +8 -11
- package/src/lib/services/aws/eventbridge/types.ts +2 -10
- package/src/lib/services/aws/evidently/main.ts +19 -23
- package/src/lib/services/aws/evidently/types.ts +0 -10
- package/src/lib/services/aws/identity-access-management/main.ts +97 -101
- package/src/lib/services/aws/key-management-service/main.ts +6 -10
- package/src/lib/services/aws/key-management-service/types.ts +0 -2
- package/src/lib/services/aws/lambda/main.ts +64 -69
- package/src/lib/services/aws/lambda/types.ts +6 -16
- package/src/lib/services/aws/route53/main.ts +19 -23
- package/src/lib/services/aws/route53/types.ts +0 -2
- package/src/lib/services/aws/secrets-manager/main.ts +6 -28
- package/src/lib/services/aws/simple-notification-service/main.ts +10 -14
- package/src/lib/services/aws/simple-notification-service/types.ts +0 -2
- package/src/lib/services/aws/simple-queue-service/main.ts +19 -23
- package/src/lib/services/aws/simple-queue-service/types.ts +4 -6
- package/src/lib/services/aws/simple-storage-service/main.ts +32 -40
- package/src/lib/services/aws/simple-storage-service/types.ts +2 -8
- package/src/lib/services/aws/step-function/main.ts +91 -95
- package/src/lib/services/aws/step-function/types.ts +0 -32
- package/src/lib/services/aws/systems-manager/main.ts +13 -19
- package/src/lib/services/aws/systems-manager/types.ts +0 -2
- package/src/lib/services/aws/virtual-private-cloud/main.ts +10 -16
- package/src/lib/services/aws/web-application-firewall/index.ts +1 -0
- package/src/lib/services/aws/web-application-firewall/main.ts +12 -16
- package/src/lib/services/aws/web-application-firewall/types.ts +0 -4
- package/src/lib/types/aws/index.ts +0 -2
- package/src/lib/utils/aws/index.ts +7 -10
- package/src/lib/utils/index.ts +4 -12
|
@@ -31,7 +31,6 @@ const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
|
|
|
31
31
|
const common_1 = require("../../common");
|
|
32
32
|
const api_1 = require("./api");
|
|
33
33
|
/**
|
|
34
|
-
* @mixin
|
|
35
34
|
*/
|
|
36
35
|
class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
37
36
|
props;
|
|
@@ -70,21 +69,18 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
70
69
|
/**
|
|
71
70
|
* @summary Method to resolve secrets from SecretsManager
|
|
72
71
|
* - To be implemented in the overriding method in the implementation class
|
|
73
|
-
* @protected
|
|
74
72
|
*/
|
|
75
73
|
resolveSecrets() {
|
|
76
74
|
this.applicationSecrets = [];
|
|
77
75
|
}
|
|
78
76
|
/**
|
|
79
77
|
* @summary Method to resolve a hosted zone based on domain attributes
|
|
80
|
-
* @protected
|
|
81
78
|
*/
|
|
82
79
|
resolveHostedZone() {
|
|
83
80
|
this.apiToLambdaTargetRestApi.hostedZone = this.route53Manager.withHostedZoneFromFullyQualifiedDomainName(`${this.id}-hosted-zone`, this, this.props.useExistingHostedZone);
|
|
84
81
|
}
|
|
85
82
|
/**
|
|
86
83
|
* @summary Method to resolve a certificate based on attributes
|
|
87
|
-
* @protected
|
|
88
84
|
*/
|
|
89
85
|
resolveCertificate() {
|
|
90
86
|
if (this.props.api.useExisting)
|
|
@@ -98,38 +94,36 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
98
94
|
}
|
|
99
95
|
/**
|
|
100
96
|
* @summary Method to create api integration method response
|
|
101
|
-
* @protected
|
|
102
97
|
*/
|
|
103
98
|
createApiToLambdaTargetMethodResponse() {
|
|
104
99
|
if (!this.props.api.withResource)
|
|
105
100
|
return;
|
|
106
101
|
this.apiToLambdaTargetRestApi.methodResponse = {
|
|
107
102
|
...{
|
|
108
|
-
statusCode: '200',
|
|
109
103
|
responseParameters: {
|
|
110
|
-
'method.response.header.Content-Type': true,
|
|
111
|
-
'method.response.header.Access-Control-Allow-Origin': true,
|
|
112
104
|
'method.response.header.Access-Control-Allow-Credentials': true,
|
|
105
|
+
'method.response.header.Access-Control-Allow-Origin': true,
|
|
106
|
+
'method.response.header.Content-Type': true,
|
|
113
107
|
},
|
|
108
|
+
statusCode: '200',
|
|
114
109
|
},
|
|
115
110
|
...this.props.api.methodResponse,
|
|
116
111
|
};
|
|
117
112
|
}
|
|
118
113
|
/**
|
|
119
114
|
* @summary Method to create api integration method error response
|
|
120
|
-
* @protected
|
|
121
115
|
*/
|
|
122
116
|
createApiToLambdaTargetMethodErrorResponse() {
|
|
123
117
|
if (!this.props.api.withResource)
|
|
124
118
|
return;
|
|
125
119
|
this.apiToLambdaTargetRestApi.methodErrorResponse = {
|
|
126
120
|
...{
|
|
127
|
-
statusCode: '400',
|
|
128
121
|
responseParameters: {
|
|
129
|
-
'method.response.header.Content-Type': true,
|
|
130
|
-
'method.response.header.Access-Control-Allow-Origin': true,
|
|
131
122
|
'method.response.header.Access-Control-Allow-Credentials': true,
|
|
123
|
+
'method.response.header.Access-Control-Allow-Origin': true,
|
|
124
|
+
'method.response.header.Content-Type': true,
|
|
132
125
|
},
|
|
126
|
+
statusCode: '400',
|
|
133
127
|
},
|
|
134
128
|
...this.props.api.methodErrorResponse,
|
|
135
129
|
};
|
|
@@ -139,7 +133,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
139
133
|
}
|
|
140
134
|
/**
|
|
141
135
|
* @summary Method to create rest restApi for Api
|
|
142
|
-
* @protected
|
|
143
136
|
*/
|
|
144
137
|
createApiToLambdaTargetRestApi() {
|
|
145
138
|
if (this.props.api.useExisting && this.props.api.importedRestApiRef) {
|
|
@@ -170,7 +163,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
170
163
|
}
|
|
171
164
|
/**
|
|
172
165
|
* @summary Method to create api integration resource
|
|
173
|
-
* @protected
|
|
174
166
|
*/
|
|
175
167
|
createApiToLambdaTargetResource() {
|
|
176
168
|
if (!this.props.api.withResource)
|
|
@@ -178,9 +170,9 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
178
170
|
let rootResource;
|
|
179
171
|
if (this.props.api.withResource && this.props.api.importedRestApiRootResourceRef) {
|
|
180
172
|
rootResource = apig.Resource.fromResourceAttributes(this, `${this.id}-root-resource`, {
|
|
173
|
+
path: '/',
|
|
181
174
|
resourceId: cdk.Fn.importValue(this.props.api.importedRestApiRootResourceRef),
|
|
182
175
|
restApi: this.apiToLambdaTargetRestApi.api,
|
|
183
|
-
path: '/',
|
|
184
176
|
});
|
|
185
177
|
}
|
|
186
178
|
else {
|
|
@@ -198,7 +190,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
198
190
|
}
|
|
199
191
|
/**
|
|
200
192
|
* @summary Method to create a role for api integration
|
|
201
|
-
* @protected
|
|
202
193
|
*/
|
|
203
194
|
createApiToLambdaTargetRole() {
|
|
204
195
|
if (!this.apiToLambdaTargetRestApi.policy)
|
|
@@ -210,7 +201,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
210
201
|
}
|
|
211
202
|
/**
|
|
212
203
|
* @summary Method to create api integration resource method
|
|
213
|
-
* @protected
|
|
214
204
|
*/
|
|
215
205
|
createApiToLambdaTargetIntegration() {
|
|
216
206
|
this.apiToLambdaTargetRestApi.integration = new apig.LambdaIntegration(this.apiToLambdaTargetRestApi.lambda, {
|
|
@@ -220,7 +210,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
220
210
|
}
|
|
221
211
|
/**
|
|
222
212
|
* @summary Method to create api integration resource method
|
|
223
|
-
* @protected
|
|
224
213
|
*/
|
|
225
214
|
createApiToLambdaTargetResourceMethod() {
|
|
226
215
|
if (!this.props.api.withResource)
|
|
@@ -235,7 +224,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
235
224
|
}
|
|
236
225
|
/**
|
|
237
226
|
* @summary Method to create custom restApi domain for Api
|
|
238
|
-
* @protected
|
|
239
227
|
*/
|
|
240
228
|
createApiDomain() {
|
|
241
229
|
if (this.props.api.useExisting)
|
|
@@ -246,7 +234,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
246
234
|
}
|
|
247
235
|
/**
|
|
248
236
|
* @summary Method to create base path mappings for Api
|
|
249
|
-
* @protected
|
|
250
237
|
*/
|
|
251
238
|
createApiBasePathMapping() {
|
|
252
239
|
if (this.props.api.useExisting)
|
|
@@ -260,7 +247,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
260
247
|
}
|
|
261
248
|
/**
|
|
262
249
|
* @summary Method to create route53 records for Api
|
|
263
|
-
* @protected
|
|
264
250
|
*/
|
|
265
251
|
createApiRouteAssets() {
|
|
266
252
|
if (this.props.api.useExisting)
|
|
@@ -7,8 +7,6 @@ import { IFunction } from 'aws-cdk-lib/aws-lambda';
|
|
|
7
7
|
import { ITopic } from 'aws-cdk-lib/aws-sns';
|
|
8
8
|
import { PolicyDocument, Role } from 'aws-cdk-lib/aws-iam';
|
|
9
9
|
/**
|
|
10
|
-
* @category cdk-utils.api-to-lambda-target
|
|
11
|
-
* @subcategory Types
|
|
12
10
|
*/
|
|
13
11
|
export interface ApiToLambdaTargetRestApiType {
|
|
14
12
|
api: IRestApi;
|
|
@@ -31,35 +29,31 @@ export interface ApiToLambdaTargetRestApiType {
|
|
|
31
29
|
method: Method;
|
|
32
30
|
methodErrorResponse: MethodResponse;
|
|
33
31
|
methodResponse: MethodResponse;
|
|
32
|
+
policy?: PolicyDocument;
|
|
34
33
|
resource: Resource;
|
|
35
34
|
responseModel: Model;
|
|
36
|
-
topic?: ITopic;
|
|
37
35
|
role?: Role;
|
|
38
|
-
|
|
36
|
+
topic?: ITopic;
|
|
39
37
|
}
|
|
40
38
|
/**
|
|
41
|
-
* @category cdk-utils.api-to-lambda-target
|
|
42
|
-
* @subcategory Properties
|
|
43
39
|
*/
|
|
44
40
|
export interface ApiToLambdaTargetRestApiProps {
|
|
45
|
-
resource: string;
|
|
46
41
|
certificate: AcmProps;
|
|
47
|
-
restApi: LambdaRestApiProps;
|
|
48
42
|
importedRestApiRef?: string;
|
|
49
43
|
importedRestApiRootResourceRef?: string;
|
|
50
|
-
useExisting: boolean;
|
|
51
|
-
withResource?: boolean;
|
|
52
44
|
methodErrorResponse: MethodResponse;
|
|
53
45
|
methodResponse: MethodResponse;
|
|
46
|
+
resource: string;
|
|
47
|
+
restApi: LambdaRestApiProps;
|
|
48
|
+
useExisting: boolean;
|
|
49
|
+
withResource?: boolean;
|
|
54
50
|
}
|
|
55
51
|
/**
|
|
56
|
-
* @category cdk-utils.api-to-lambda-target
|
|
57
|
-
* @subcategory Properties
|
|
58
52
|
*/
|
|
59
53
|
export interface ApiToLambdaTargetProps extends CommonStackProps {
|
|
54
|
+
api: ApiToLambdaTargetRestApiProps;
|
|
60
55
|
apiRootPaths?: string[];
|
|
61
56
|
apiSubDomain: string;
|
|
62
|
-
api: ApiToLambdaTargetRestApiProps;
|
|
63
57
|
lambdaFunctionName: string;
|
|
64
58
|
logLevel: string;
|
|
65
59
|
nodeEnv: string;
|
|
@@ -9,13 +9,9 @@ import { CommonConstruct } from '../../common';
|
|
|
9
9
|
import { GraphQlApiLambdaEnvironment, GraphQlApiLambdaProps } from './types';
|
|
10
10
|
/**
|
|
11
11
|
* @deprecated Use RestApiLambda instead. This will be removed in a future release.
|
|
12
|
-
*
|
|
13
|
-
* @category cdk-utils.graphql-api-lambda
|
|
14
|
-
* @subcategory construct
|
|
15
12
|
* @classdesc Provides a construct to create and deploy a Graphql API as Lambda
|
|
16
13
|
*
|
|
17
14
|
* <b>Architecture</b><br/> 
|
|
18
|
-
*
|
|
19
15
|
* @example
|
|
20
16
|
* import { GraphQLApiLambda, GraphQlApiLambdaProps } '@gradientedge/cdk-utils'
|
|
21
17
|
* import { Construct } from 'constructs'
|
|
@@ -28,7 +24,6 @@ import { GraphQlApiLambdaEnvironment, GraphQlApiLambdaProps } from './types';
|
|
|
28
24
|
* this.initResources()
|
|
29
25
|
* }
|
|
30
26
|
* }
|
|
31
|
-
* @mixin
|
|
32
27
|
*/
|
|
33
28
|
export declare class GraphQLApiLambda extends CommonConstruct {
|
|
34
29
|
props: GraphQlApiLambdaProps;
|
|
@@ -47,68 +42,55 @@ export declare class GraphQLApiLambda extends CommonConstruct {
|
|
|
47
42
|
constructor(parent: Construct, id: string, props: GraphQlApiLambdaProps);
|
|
48
43
|
/**
|
|
49
44
|
* @summary Initialise and provision resources
|
|
50
|
-
* @protected
|
|
51
45
|
*/
|
|
52
46
|
protected initResources(): void;
|
|
53
47
|
/**
|
|
54
48
|
* @summary Method to resolve secrets from SecretsManager
|
|
55
49
|
* - To be implemented in the overriding method in the implementation class
|
|
56
|
-
* @protected
|
|
57
50
|
*/
|
|
58
51
|
protected resolveSecrets(): void;
|
|
59
52
|
/**
|
|
60
53
|
* @summary Method to resolve a hosted zone based on domain attributes
|
|
61
|
-
* @protected
|
|
62
54
|
*/
|
|
63
55
|
protected resolveHostedZone(): void;
|
|
64
56
|
/**
|
|
65
57
|
* @summary Method to resolve a certificate based on attributes
|
|
66
|
-
* @protected
|
|
67
58
|
*/
|
|
68
59
|
protected resolveCertificate(): void;
|
|
69
60
|
/**
|
|
70
61
|
* @summary Method to create iam policy for GraphQL Lambda function
|
|
71
|
-
* @protected
|
|
72
62
|
*/
|
|
73
63
|
protected createLambdaPolicy(): void;
|
|
74
64
|
/**
|
|
75
65
|
* @summary Method to create iam role for GraphQL Lambda function
|
|
76
|
-
* @protected
|
|
77
66
|
*/
|
|
78
67
|
protected createLambdaRole(): void;
|
|
79
68
|
/**
|
|
80
69
|
* @summary Method to create environment variables for GraphQL Lambda function
|
|
81
|
-
* @protected
|
|
82
70
|
*/
|
|
83
71
|
protected createLambdaEnvironment(): void;
|
|
84
72
|
/**
|
|
85
73
|
* @summary Method to create layers for GraphQL Lambda function
|
|
86
|
-
* @protected
|
|
87
74
|
*/
|
|
88
75
|
protected createLambdaLayers(): void;
|
|
89
76
|
/**
|
|
90
77
|
* @summary Method to create lambda function for GraphQL
|
|
91
|
-
* @protected
|
|
92
78
|
*/
|
|
93
79
|
protected createLambdaFunction(): void;
|
|
94
80
|
/**
|
|
95
81
|
* @summary Method to create rest restApi for GraphQL
|
|
96
|
-
* @protected
|
|
97
82
|
*/
|
|
98
83
|
protected createRestApi(): void;
|
|
99
84
|
/**
|
|
100
85
|
* @summary Method to create custom restApi domain for GraphQL API
|
|
101
|
-
* @protected
|
|
102
86
|
*/
|
|
103
87
|
protected createApiDomain(): void;
|
|
104
88
|
/**
|
|
105
89
|
* @summary Method to create base path mappings for GraphQL API
|
|
106
|
-
* @protected
|
|
107
90
|
*/
|
|
108
91
|
protected createApiBasePathMapping(): void;
|
|
109
92
|
/**
|
|
110
93
|
* @summary Method to create route53 records for GraphQL API
|
|
111
|
-
* @protected
|
|
112
94
|
*/
|
|
113
95
|
protected createApiRouteAssets(): void;
|
|
114
96
|
}
|
|
@@ -29,13 +29,9 @@ const iam = __importStar(require("aws-cdk-lib/aws-iam"));
|
|
|
29
29
|
const common_1 = require("../../common");
|
|
30
30
|
/**
|
|
31
31
|
* @deprecated Use RestApiLambda instead. This will be removed in a future release.
|
|
32
|
-
*
|
|
33
|
-
* @category cdk-utils.graphql-api-lambda
|
|
34
|
-
* @subcategory construct
|
|
35
32
|
* @classdesc Provides a construct to create and deploy a Graphql API as Lambda
|
|
36
33
|
*
|
|
37
34
|
* <b>Architecture</b><br/> 
|
|
38
|
-
*
|
|
39
35
|
* @example
|
|
40
36
|
* import { GraphQLApiLambda, GraphQlApiLambdaProps } '@gradientedge/cdk-utils'
|
|
41
37
|
* import { Construct } from 'constructs'
|
|
@@ -48,7 +44,6 @@ const common_1 = require("../../common");
|
|
|
48
44
|
* this.initResources()
|
|
49
45
|
* }
|
|
50
46
|
* }
|
|
51
|
-
* @mixin
|
|
52
47
|
*/
|
|
53
48
|
class GraphQLApiLambda extends common_1.CommonConstruct {
|
|
54
49
|
/* graphql restApi props */
|
|
@@ -73,7 +68,6 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
|
|
|
73
68
|
}
|
|
74
69
|
/**
|
|
75
70
|
* @summary Initialise and provision resources
|
|
76
|
-
* @protected
|
|
77
71
|
*/
|
|
78
72
|
initResources() {
|
|
79
73
|
this.resolveSecrets();
|
|
@@ -92,21 +86,18 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
|
|
|
92
86
|
/**
|
|
93
87
|
* @summary Method to resolve secrets from SecretsManager
|
|
94
88
|
* - To be implemented in the overriding method in the implementation class
|
|
95
|
-
* @protected
|
|
96
89
|
*/
|
|
97
90
|
resolveSecrets() {
|
|
98
91
|
this.applicationSecrets = [];
|
|
99
92
|
}
|
|
100
93
|
/**
|
|
101
94
|
* @summary Method to resolve a hosted zone based on domain attributes
|
|
102
|
-
* @protected
|
|
103
95
|
*/
|
|
104
96
|
resolveHostedZone() {
|
|
105
97
|
this.graphQLApiHostedZone = this.route53Manager.withHostedZoneFromFullyQualifiedDomainName(`${this.id}-hosted-zone`, this, this.props.useExistingHostedZone);
|
|
106
98
|
}
|
|
107
99
|
/**
|
|
108
100
|
* @summary Method to resolve a certificate based on attributes
|
|
109
|
-
* @protected
|
|
110
101
|
*/
|
|
111
102
|
resolveCertificate() {
|
|
112
103
|
if (this.props.graphQLApiCertificate.useExistingCertificate &&
|
|
@@ -118,7 +109,6 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
|
|
|
118
109
|
}
|
|
119
110
|
/**
|
|
120
111
|
* @summary Method to create iam policy for GraphQL Lambda function
|
|
121
|
-
* @protected
|
|
122
112
|
*/
|
|
123
113
|
createLambdaPolicy() {
|
|
124
114
|
this.graphQLApiLambdaPolicy = new iam.PolicyDocument({
|
|
@@ -127,25 +117,22 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
|
|
|
127
117
|
}
|
|
128
118
|
/**
|
|
129
119
|
* @summary Method to create iam role for GraphQL Lambda function
|
|
130
|
-
* @protected
|
|
131
120
|
*/
|
|
132
121
|
createLambdaRole() {
|
|
133
122
|
this.graphQLApiLambdaRole = this.iamManager.createRoleForLambda(`${this.id}-lambda-role`, this, this.graphQLApiLambdaPolicy);
|
|
134
123
|
}
|
|
135
124
|
/**
|
|
136
125
|
* @summary Method to create environment variables for GraphQL Lambda function
|
|
137
|
-
* @protected
|
|
138
126
|
*/
|
|
139
127
|
createLambdaEnvironment() {
|
|
140
128
|
this.graphQLApiLambdaEnvironment = {
|
|
141
|
-
NODE_ENV: this.props.nodeEnv,
|
|
142
129
|
LOG_LEVEL: this.props.logLevel,
|
|
130
|
+
NODE_ENV: this.props.nodeEnv,
|
|
143
131
|
TZ: this.props.timezone,
|
|
144
132
|
};
|
|
145
133
|
}
|
|
146
134
|
/**
|
|
147
135
|
* @summary Method to create layers for GraphQL Lambda function
|
|
148
|
-
* @protected
|
|
149
136
|
*/
|
|
150
137
|
createLambdaLayers() {
|
|
151
138
|
const layers = [];
|
|
@@ -158,21 +145,18 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
|
|
|
158
145
|
}
|
|
159
146
|
/**
|
|
160
147
|
* @summary Method to create lambda function for GraphQL
|
|
161
|
-
* @protected
|
|
162
148
|
*/
|
|
163
149
|
createLambdaFunction() {
|
|
164
150
|
this.graphQLApiLambdaFunction = this.lambdaManager.createLambdaFunction(`${this.id}-graphql-server`, this, this.props.graphqlApi, this.graphQLApiLambdaRole, this.graphQLApiLambdaLayers, this.props.graphQLApiSource, this.props.graphQLApiHandler || 'index.handler', this.graphQLApiLambdaEnvironment);
|
|
165
151
|
}
|
|
166
152
|
/**
|
|
167
153
|
* @summary Method to create rest restApi for GraphQL
|
|
168
|
-
* @protected
|
|
169
154
|
*/
|
|
170
155
|
createRestApi() {
|
|
171
156
|
this.graphQLApi = this.apiManager.createLambdaRestApi(`${this.id}-lambda-rest-api`, this, this.props.graphqlRestApi, this.graphQLApiLambdaFunction);
|
|
172
157
|
}
|
|
173
158
|
/**
|
|
174
159
|
* @summary Method to create custom restApi domain for GraphQL API
|
|
175
|
-
* @protected
|
|
176
160
|
*/
|
|
177
161
|
createApiDomain() {
|
|
178
162
|
this.graphQLApiDomain = this.apiManager.createApiDomain(`${this.id}-api-domain`, this, this.isProductionStage() || this.props.skipStageForARecords
|
|
@@ -181,7 +165,6 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
|
|
|
181
165
|
}
|
|
182
166
|
/**
|
|
183
167
|
* @summary Method to create base path mappings for GraphQL API
|
|
184
|
-
* @protected
|
|
185
168
|
*/
|
|
186
169
|
createApiBasePathMapping() {
|
|
187
170
|
const apiRootPaths = this.props.apiRootPaths;
|
|
@@ -205,7 +188,6 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
|
|
|
205
188
|
}
|
|
206
189
|
/**
|
|
207
190
|
* @summary Method to create route53 records for GraphQL API
|
|
208
|
-
* @protected
|
|
209
191
|
*/
|
|
210
192
|
createApiRouteAssets() {
|
|
211
193
|
this.route53Manager.createApiGatewayARecord(`${this.id}-custom-domain-a-record`, this, this.props.apiSubDomain, this.graphQLApiDomain, this.graphQLApiHostedZone, this.props.skipStageForARecords);
|
|
@@ -4,27 +4,23 @@ import { LambdaRestApiProps } from 'aws-cdk-lib/aws-apigateway';
|
|
|
4
4
|
import { AssetCode } from 'aws-cdk-lib/aws-lambda';
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated Use RestApiLambdaEnvironment instead. This will be removed in a future release.
|
|
7
|
-
* @category cdk-utils.graphql-api-lambda
|
|
8
|
-
* @subcategory Types
|
|
9
7
|
*/
|
|
10
8
|
export interface GraphQlApiLambdaEnvironment extends LambdaEnvironment {
|
|
11
9
|
}
|
|
12
10
|
/**
|
|
13
11
|
* @deprecated Use RestApiLambdaProps instead. This will be removed in a future release.
|
|
14
|
-
* @category cdk-utils.graphql-api-lambda
|
|
15
|
-
* @subcategory Properties
|
|
16
12
|
*/
|
|
17
13
|
export interface GraphQlApiLambdaProps extends CommonStackProps {
|
|
18
14
|
apiRootPaths?: string[];
|
|
19
15
|
apiSubDomain: string;
|
|
20
16
|
graphQLApiCertificate: AcmProps;
|
|
21
|
-
graphqlRestApi: LambdaRestApiProps;
|
|
22
|
-
graphqlApiLambdaLayerSources?: AssetCode[];
|
|
23
17
|
graphQLApiHandler: string;
|
|
24
18
|
graphQLApiSource: AssetCode;
|
|
25
19
|
graphqlApi: LambdaProps;
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
graphqlApiLambdaLayerSources?: AssetCode[];
|
|
21
|
+
graphqlRestApi: LambdaRestApiProps;
|
|
28
22
|
logLevel: string;
|
|
23
|
+
nodeEnv: string;
|
|
29
24
|
timezone: string;
|
|
25
|
+
useExistingHostedZone: boolean;
|
|
30
26
|
}
|
|
@@ -5,13 +5,9 @@ import { GraphQLApiLambda } from '..';
|
|
|
5
5
|
import { GraphQlApiLambdaWithCacheProps } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use RestApiLambdaWithCache instead. This will be removed in a future release.
|
|
8
|
-
*
|
|
9
|
-
* @category cdk-utils.graphql-api-lambda-with-cache
|
|
10
|
-
* @subcategory construct
|
|
11
8
|
* @classdesc Provides a construct to create and deploy a Graphql API as Lambda with Caching
|
|
12
9
|
*
|
|
13
10
|
* <b>Architecture</b><br/> 
|
|
14
|
-
*
|
|
15
11
|
* @example
|
|
16
12
|
* import { GraphQlApiLambdaWithCacheProps } '@gradientedge/cdk-utils'
|
|
17
13
|
* import { Construct } from 'constructs'
|
|
@@ -24,7 +20,6 @@ import { GraphQlApiLambdaWithCacheProps } from './types';
|
|
|
24
20
|
* this.initResources()
|
|
25
21
|
* }
|
|
26
22
|
* }
|
|
27
|
-
* @mixin
|
|
28
23
|
*/
|
|
29
24
|
export declare class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
|
|
30
25
|
props: GraphQlApiLambdaWithCacheProps;
|
|
@@ -37,32 +32,26 @@ export declare class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
|
|
|
37
32
|
protected initResources(): void;
|
|
38
33
|
/**
|
|
39
34
|
* Create VPC
|
|
40
|
-
* @protected
|
|
41
35
|
*/
|
|
42
36
|
protected setVpc(): void;
|
|
43
37
|
/**
|
|
44
38
|
* Resolve Security Group
|
|
45
|
-
* @protected
|
|
46
39
|
*/
|
|
47
40
|
protected setSecurityGroup(): void;
|
|
48
41
|
/**
|
|
49
42
|
* Create ElastiCache
|
|
50
|
-
* @protected
|
|
51
43
|
*/
|
|
52
44
|
protected createElastiCache(): void;
|
|
53
45
|
/**
|
|
54
46
|
* Create Lambda Role
|
|
55
|
-
* @protected
|
|
56
47
|
*/
|
|
57
48
|
protected createLambdaRole(): void;
|
|
58
49
|
/**
|
|
59
50
|
* @summary Method to create environment variables for GraphQL Lambda function
|
|
60
|
-
* @protected
|
|
61
51
|
*/
|
|
62
52
|
protected createLambdaEnvironment(): void;
|
|
63
53
|
/**
|
|
64
54
|
* @summary Method to create lambda function for GraphQL API
|
|
65
|
-
* @protected
|
|
66
55
|
*/
|
|
67
56
|
protected createLambdaFunction(): void;
|
|
68
57
|
}
|
|
@@ -31,13 +31,9 @@ const __1 = require("..");
|
|
|
31
31
|
const utils = __importStar(require("../../utils"));
|
|
32
32
|
/**
|
|
33
33
|
* @deprecated Use RestApiLambdaWithCache instead. This will be removed in a future release.
|
|
34
|
-
*
|
|
35
|
-
* @category cdk-utils.graphql-api-lambda-with-cache
|
|
36
|
-
* @subcategory construct
|
|
37
34
|
* @classdesc Provides a construct to create and deploy a Graphql API as Lambda with Caching
|
|
38
35
|
*
|
|
39
36
|
* <b>Architecture</b><br/> 
|
|
40
|
-
*
|
|
41
37
|
* @example
|
|
42
38
|
* import { GraphQlApiLambdaWithCacheProps } '@gradientedge/cdk-utils'
|
|
43
39
|
* import { Construct } from 'constructs'
|
|
@@ -50,7 +46,6 @@ const utils = __importStar(require("../../utils"));
|
|
|
50
46
|
* this.initResources()
|
|
51
47
|
* }
|
|
52
48
|
* }
|
|
53
|
-
* @mixin
|
|
54
49
|
*/
|
|
55
50
|
class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
|
|
56
51
|
/* graphql restApi props */
|
|
@@ -74,7 +69,6 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
|
|
|
74
69
|
}
|
|
75
70
|
/**
|
|
76
71
|
* Create VPC
|
|
77
|
-
* @protected
|
|
78
72
|
*/
|
|
79
73
|
setVpc() {
|
|
80
74
|
if (this.props.useExistingVpc) {
|
|
@@ -86,7 +80,6 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
|
|
|
86
80
|
}
|
|
87
81
|
/**
|
|
88
82
|
* Resolve Security Group
|
|
89
|
-
* @protected
|
|
90
83
|
*/
|
|
91
84
|
setSecurityGroup() {
|
|
92
85
|
if (this.props.securityGroupExportName) {
|
|
@@ -103,14 +96,12 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
|
|
|
103
96
|
}
|
|
104
97
|
/**
|
|
105
98
|
* Create ElastiCache
|
|
106
|
-
* @protected
|
|
107
99
|
*/
|
|
108
100
|
createElastiCache() {
|
|
109
101
|
this.graphQLElastiCache = this.elasticacheManager.createReplicatedElastiCache(`${this.id}-elasticache`, this, this.props.graphQLElastiCache, this.graphQLVpc.privateSubnets.map(subnet => subnet.subnetId), [this.graphQLSecurityGroup.securityGroupId]);
|
|
110
102
|
}
|
|
111
103
|
/**
|
|
112
104
|
* Create Lambda Role
|
|
113
|
-
* @protected
|
|
114
105
|
*/
|
|
115
106
|
createLambdaRole() {
|
|
116
107
|
super.createLambdaRole();
|
|
@@ -118,18 +109,16 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
|
|
|
118
109
|
}
|
|
119
110
|
/**
|
|
120
111
|
* @summary Method to create environment variables for GraphQL Lambda function
|
|
121
|
-
* @protected
|
|
122
112
|
*/
|
|
123
113
|
createLambdaEnvironment() {
|
|
124
114
|
this.graphQLApiLambdaEnvironment = {
|
|
125
|
-
NODE_ENV: this.props.nodeEnv,
|
|
126
115
|
LOG_LEVEL: this.props.logLevel,
|
|
116
|
+
NODE_ENV: this.props.nodeEnv,
|
|
127
117
|
TZ: this.props.timezone,
|
|
128
118
|
};
|
|
129
119
|
}
|
|
130
120
|
/**
|
|
131
121
|
* @summary Method to create lambda function for GraphQL API
|
|
132
|
-
* @protected
|
|
133
122
|
*/
|
|
134
123
|
createLambdaFunction() {
|
|
135
124
|
this.graphQLApiLambdaFunction = this.lambdaManager.createLambdaFunction(`${this.id}-graphql-server`, this, this.props.graphqlApi, this.graphQLApiLambdaRole, this.graphQLApiLambdaLayers, this.props.graphQLApiSource, this.props.graphQLApiHandler || 'index.handler', this.graphQLApiLambdaEnvironment, this.graphQLVpc, [this.graphQLSecurityGroup], undefined, undefined, this.graphQLVpc);
|
|
@@ -3,12 +3,10 @@ import { VpcProps } from 'aws-cdk-lib/aws-ec2';
|
|
|
3
3
|
import { ReplicatedElastiCacheProps } from '../../services';
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated Use RestApiLambdaWithCacheProps instead. This will be removed in a future release.
|
|
6
|
-
* @category cdk-utils.graphql-api-lambda-with-cache
|
|
7
|
-
* @subcategory Properties
|
|
8
6
|
*/
|
|
9
7
|
export interface GraphQlApiLambdaWithCacheProps extends GraphQlApiLambdaProps {
|
|
10
|
-
graphQLVpc: VpcProps;
|
|
11
8
|
graphQLElastiCache: ReplicatedElastiCacheProps;
|
|
9
|
+
graphQLVpc: VpcProps;
|
|
12
10
|
securityGroupExportName: string;
|
|
13
11
|
useExistingVpc: boolean;
|
|
14
12
|
vpcName?: string;
|
|
@@ -5,10 +5,7 @@ import * as iam from 'aws-cdk-lib/aws-iam';
|
|
|
5
5
|
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
6
6
|
import * as secretsManager from 'aws-cdk-lib/aws-secretsmanager';
|
|
7
7
|
/**
|
|
8
|
-
* @category cdk-utils.lambda-with-iam-access
|
|
9
|
-
* @subcategory construct
|
|
10
8
|
* @classdesc Provides a construct to create a lambda function with IAM access
|
|
11
|
-
*
|
|
12
9
|
* @example
|
|
13
10
|
* import { LambdaWithIamAccess, LambdaWithIamAccessProps } '@gradientedge/cdk-utils'
|
|
14
11
|
* import { Construct } from 'constructs'
|
|
@@ -21,7 +18,6 @@ import * as secretsManager from 'aws-cdk-lib/aws-secretsmanager';
|
|
|
21
18
|
* this.initResources()
|
|
22
19
|
* }
|
|
23
20
|
* }
|
|
24
|
-
* @mixin
|
|
25
21
|
*/
|
|
26
22
|
export declare class LambdaWithIamAccess extends CommonConstruct {
|
|
27
23
|
props: LambdaWithIamAccessProps;
|
|
@@ -37,42 +33,34 @@ export declare class LambdaWithIamAccess extends CommonConstruct {
|
|
|
37
33
|
constructor(parent: Construct, id: string, props: LambdaWithIamAccessProps);
|
|
38
34
|
/**
|
|
39
35
|
* @summary Initialise and provision resources
|
|
40
|
-
* @protected
|
|
41
36
|
*/
|
|
42
37
|
initResources(): void;
|
|
43
38
|
/**
|
|
44
39
|
* @summary Method to create iam policy for Lambda function
|
|
45
|
-
* @protected
|
|
46
40
|
*/
|
|
47
41
|
protected createLambdaPolicy(): void;
|
|
48
42
|
/**
|
|
49
43
|
* @summary Method to create iam role for Lambda function
|
|
50
|
-
* @protected
|
|
51
44
|
*/
|
|
52
45
|
protected createLambdaRole(): void;
|
|
53
46
|
/**
|
|
54
47
|
* @summary Method to create environment variables for Lambda function
|
|
55
|
-
* @protected
|
|
56
48
|
*/
|
|
57
49
|
protected createLambdaEnvironment(): void;
|
|
58
50
|
/**
|
|
59
51
|
* @summary Method to create layers for Lambda function
|
|
60
|
-
* @protected
|
|
61
52
|
*/
|
|
62
53
|
protected createLambdaLayers(): void;
|
|
63
54
|
/**
|
|
64
55
|
* @summary Method to create lambda function
|
|
65
|
-
* @protected
|
|
66
56
|
*/
|
|
67
57
|
protected createLambdaFunction(): void;
|
|
68
58
|
/**
|
|
69
59
|
* @summary Method to create iam user for the lambda function
|
|
70
|
-
* @protected
|
|
71
60
|
*/
|
|
72
61
|
protected createIamUserForLambdaFunction(): void;
|
|
73
62
|
/**
|
|
74
63
|
* @summary Method to create iam secret for the lambda function
|
|
75
|
-
* @protected
|
|
76
64
|
*/
|
|
77
65
|
protected createIamSecretForLambdaFunction(): void;
|
|
78
66
|
}
|