@gradientedge/cdk-utils 4.13.0 → 4.14.1
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/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +1 -1
- package/dist/src/lib/manager/aws/cloudfront-manager.js +2 -0
- package/dist/src/lib/manager/aws/lambda-manager.js +43 -41
- package/package.json +10 -10
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -1
- package/src/lib/manager/aws/cloudfront-manager.ts +2 -0
- package/src/lib/manager/aws/lambda-manager.ts +43 -41
|
@@ -95,7 +95,7 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
|
|
|
95
95
|
securityGroupName: `${this.id}-security-group-${this.props.stage}`,
|
|
96
96
|
vpc: this.graphQLVpc,
|
|
97
97
|
});
|
|
98
|
-
this.graphQLSecurityGroup.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.
|
|
98
|
+
this.graphQLSecurityGroup.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.allTraffic(), 'All Traffic');
|
|
99
99
|
utils.createCfnOutput(`${this.id}-security-group-id`, this, this.graphQLSecurityGroup.securityGroupId);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -140,6 +140,7 @@ class CloudFrontManager {
|
|
|
140
140
|
origin: origin,
|
|
141
141
|
originRequestPolicy: props.defaultBehavior ? props.defaultBehavior.originRequestPolicy : undefined,
|
|
142
142
|
functionAssociations: defaultFunctionAssociations ?? undefined,
|
|
143
|
+
viewerProtocolPolicy: props.defaultBehavior ? props.defaultBehavior.viewerProtocolPolicy : undefined,
|
|
143
144
|
},
|
|
144
145
|
additionalBehaviors: props.additionalBehaviors,
|
|
145
146
|
defaultRootObject: props.defaultRootObject,
|
|
@@ -181,6 +182,7 @@ class CloudFrontManager {
|
|
|
181
182
|
origin: origin,
|
|
182
183
|
originRequestPolicy: props.defaultBehavior ? props.defaultBehavior.originRequestPolicy : undefined,
|
|
183
184
|
functionAssociations: defaultFunctionAssociations ?? undefined,
|
|
185
|
+
viewerProtocolPolicy: props.defaultBehavior ? props.defaultBehavior.viewerProtocolPolicy : undefined,
|
|
184
186
|
},
|
|
185
187
|
additionalBehaviors: props.additionalBehaviors,
|
|
186
188
|
defaultRootObject: props.defaultRootObject,
|
|
@@ -105,28 +105,29 @@ class LambdaManager {
|
|
|
105
105
|
throw `Lambda props undefined`;
|
|
106
106
|
const functionName = `${props.functionName}-${scope.props.stage}`;
|
|
107
107
|
const lambdaFunction = new pylambda.PythonFunction(scope, `${id}`, {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
...props,
|
|
109
|
+
...{
|
|
110
|
+
allowPublicSubnet: !!vpc,
|
|
111
|
+
functionName: functionName,
|
|
112
|
+
index: index,
|
|
113
|
+
handler: handler,
|
|
114
|
+
runtime: lambda.Runtime.PYTHON_3_8,
|
|
115
|
+
entry: entry,
|
|
116
|
+
environment: {
|
|
117
|
+
REGION: scope.props.region,
|
|
118
|
+
...environment,
|
|
119
|
+
},
|
|
120
|
+
filesystem: accessPoint
|
|
121
|
+
? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg')
|
|
122
|
+
: undefined,
|
|
123
|
+
layers: layers,
|
|
124
|
+
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
125
|
+
role: role instanceof iam.Role ? role : undefined,
|
|
126
|
+
securityGroups: securityGroups,
|
|
127
|
+
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
128
|
+
vpc: vpc,
|
|
129
|
+
vpcSubnets: vpcSubnets,
|
|
117
130
|
},
|
|
118
|
-
filesystem: accessPoint ? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
|
|
119
|
-
layers: layers,
|
|
120
|
-
logRetention: props.logRetention,
|
|
121
|
-
memorySize: props.memorySize,
|
|
122
|
-
onFailure: props.onFailure,
|
|
123
|
-
onSuccess: props.onSuccess,
|
|
124
|
-
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
125
|
-
role: role instanceof iam.Role ? role : undefined,
|
|
126
|
-
securityGroups: securityGroups,
|
|
127
|
-
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
128
|
-
vpc: vpc,
|
|
129
|
-
vpcSubnets: vpcSubnets,
|
|
130
131
|
});
|
|
131
132
|
utils.createCfnOutput(`${id}-lambdaArn`, scope, lambdaFunction.functionArn);
|
|
132
133
|
utils.createCfnOutput(`${id}-lambdaName`, scope, lambdaFunction.functionName);
|
|
@@ -153,27 +154,28 @@ class LambdaManager {
|
|
|
153
154
|
throw `Lambda props undefined`;
|
|
154
155
|
const functionName = `${props.functionName}-${scope.props.stage}`;
|
|
155
156
|
const lambdaFunction = new lambda.Function(scope, `${id}`, {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
157
|
+
...props,
|
|
158
|
+
...{
|
|
159
|
+
allowPublicSubnet: !!vpc,
|
|
160
|
+
functionName: functionName,
|
|
161
|
+
handler: handler || 'index.lambda_handler',
|
|
162
|
+
runtime: lambda.Runtime.NODEJS_14_X,
|
|
163
|
+
code: code,
|
|
164
|
+
environment: {
|
|
165
|
+
REGION: scope.props.region,
|
|
166
|
+
...environment,
|
|
167
|
+
},
|
|
168
|
+
filesystem: accessPoint
|
|
169
|
+
? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg')
|
|
170
|
+
: undefined,
|
|
171
|
+
layers: layers,
|
|
172
|
+
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
173
|
+
role: role instanceof iam.Role ? role : undefined,
|
|
174
|
+
securityGroups: securityGroups,
|
|
175
|
+
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
176
|
+
vpc: vpc,
|
|
177
|
+
vpcSubnets: vpcSubnets,
|
|
164
178
|
},
|
|
165
|
-
filesystem: accessPoint ? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
|
|
166
|
-
layers: layers,
|
|
167
|
-
logRetention: props.logRetention,
|
|
168
|
-
memorySize: props.memorySize,
|
|
169
|
-
onFailure: props.onFailure,
|
|
170
|
-
onSuccess: props.onSuccess,
|
|
171
|
-
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
172
|
-
role: role instanceof iam.Role ? role : undefined,
|
|
173
|
-
securityGroups: securityGroups,
|
|
174
|
-
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
175
|
-
vpc: vpc,
|
|
176
|
-
vpcSubnets: vpcSubnets,
|
|
177
179
|
});
|
|
178
180
|
utils.createCfnOutput(`${id}-lambdaArn`, scope, lambdaFunction.functionArn);
|
|
179
181
|
utils.createCfnOutput(`${id}-lambdaName`, scope, lambdaFunction.functionName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.14.1",
|
|
4
4
|
"description": "Utilities for AWS CDK provisioning",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@aws-cdk/aws-lambda-python-alpha": "2.
|
|
48
|
+
"@aws-cdk/aws-lambda-python-alpha": "2.17.0-alpha.0",
|
|
49
49
|
"@types/lodash": "^4.14.180",
|
|
50
|
-
"@types/node": "^17.0.
|
|
50
|
+
"@types/node": "^17.0.22",
|
|
51
51
|
"app-root-path": "^3.0.0",
|
|
52
|
-
"aws-cdk-lib": "^2.
|
|
53
|
-
"aws-sdk": "^2.
|
|
54
|
-
"constructs": "^10.0.
|
|
52
|
+
"aws-cdk-lib": "^2.17.0",
|
|
53
|
+
"aws-sdk": "^2.1097.0",
|
|
54
|
+
"constructs": "^10.0.91",
|
|
55
55
|
"lodash": "^4.17.21",
|
|
56
56
|
"moment": "^2.29.1",
|
|
57
57
|
"nconf": "^0.11.3",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
63
63
|
"@types/jest": "^27.4.1",
|
|
64
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
65
|
-
"@typescript-eslint/parser": "^5.
|
|
64
|
+
"@typescript-eslint/eslint-plugin": "^5.16.0",
|
|
65
|
+
"@typescript-eslint/parser": "^5.16.0",
|
|
66
66
|
"aws-cdk": "*",
|
|
67
67
|
"babel-eslint": "^10.1.0",
|
|
68
68
|
"better-docs": "^2.7.2",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"jsdoc-babel": "^0.5.0",
|
|
81
81
|
"jsdoc-mermaid": "^1.0.0",
|
|
82
82
|
"lerna": "^4.0.0",
|
|
83
|
-
"prettier": "^2.
|
|
83
|
+
"prettier": "^2.6.0",
|
|
84
84
|
"prettier-plugin-organize-imports": "^2.3.4",
|
|
85
85
|
"rimraf": "^3.0.2",
|
|
86
86
|
"semantic-release": "^19.0.2",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"typescript": "4.6.2"
|
|
90
90
|
},
|
|
91
91
|
"optionalDependencies": {
|
|
92
|
-
"@babel/core": "^7.17.
|
|
92
|
+
"@babel/core": "^7.17.8",
|
|
93
93
|
"prop-types": "^15.8.1",
|
|
94
94
|
"react": "^17.0.2",
|
|
95
95
|
"react-dom": "^17.0.2"
|
|
@@ -82,7 +82,7 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
|
|
|
82
82
|
vpc: this.graphQLVpc,
|
|
83
83
|
})
|
|
84
84
|
|
|
85
|
-
this.graphQLSecurityGroup.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.
|
|
85
|
+
this.graphQLSecurityGroup.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.allTraffic(), 'All Traffic')
|
|
86
86
|
|
|
87
87
|
utils.createCfnOutput(`${this.id}-security-group-id`, this, this.graphQLSecurityGroup.securityGroupId)
|
|
88
88
|
}
|
|
@@ -144,6 +144,7 @@ export class CloudFrontManager {
|
|
|
144
144
|
origin: origin,
|
|
145
145
|
originRequestPolicy: props.defaultBehavior ? props.defaultBehavior.originRequestPolicy : undefined,
|
|
146
146
|
functionAssociations: defaultFunctionAssociations ?? undefined,
|
|
147
|
+
viewerProtocolPolicy: props.defaultBehavior ? props.defaultBehavior.viewerProtocolPolicy : undefined,
|
|
147
148
|
},
|
|
148
149
|
additionalBehaviors: props.additionalBehaviors,
|
|
149
150
|
defaultRootObject: props.defaultRootObject,
|
|
@@ -197,6 +198,7 @@ export class CloudFrontManager {
|
|
|
197
198
|
origin: origin,
|
|
198
199
|
originRequestPolicy: props.defaultBehavior ? props.defaultBehavior.originRequestPolicy : undefined,
|
|
199
200
|
functionAssociations: defaultFunctionAssociations ?? undefined,
|
|
201
|
+
viewerProtocolPolicy: props.defaultBehavior ? props.defaultBehavior.viewerProtocolPolicy : undefined,
|
|
200
202
|
},
|
|
201
203
|
additionalBehaviors: props.additionalBehaviors,
|
|
202
204
|
defaultRootObject: props.defaultRootObject,
|
|
@@ -106,28 +106,29 @@ export class LambdaManager {
|
|
|
106
106
|
|
|
107
107
|
const functionName = `${props.functionName}-${scope.props.stage}`
|
|
108
108
|
const lambdaFunction = new pylambda.PythonFunction(scope, `${id}`, {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
109
|
+
...props,
|
|
110
|
+
...{
|
|
111
|
+
allowPublicSubnet: !!vpc,
|
|
112
|
+
functionName: functionName,
|
|
113
|
+
index: index,
|
|
114
|
+
handler: handler,
|
|
115
|
+
runtime: lambda.Runtime.PYTHON_3_8,
|
|
116
|
+
entry: entry,
|
|
117
|
+
environment: {
|
|
118
|
+
REGION: scope.props.region,
|
|
119
|
+
...environment,
|
|
120
|
+
},
|
|
121
|
+
filesystem: accessPoint
|
|
122
|
+
? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg')
|
|
123
|
+
: undefined,
|
|
124
|
+
layers: layers,
|
|
125
|
+
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
126
|
+
role: role instanceof iam.Role ? role : undefined,
|
|
127
|
+
securityGroups: securityGroups,
|
|
128
|
+
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
129
|
+
vpc: vpc,
|
|
130
|
+
vpcSubnets: vpcSubnets,
|
|
118
131
|
},
|
|
119
|
-
filesystem: accessPoint ? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
|
|
120
|
-
layers: layers,
|
|
121
|
-
logRetention: props.logRetention,
|
|
122
|
-
memorySize: props.memorySize,
|
|
123
|
-
onFailure: props.onFailure,
|
|
124
|
-
onSuccess: props.onSuccess,
|
|
125
|
-
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
126
|
-
role: role instanceof iam.Role ? role : undefined,
|
|
127
|
-
securityGroups: securityGroups,
|
|
128
|
-
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
129
|
-
vpc: vpc,
|
|
130
|
-
vpcSubnets: vpcSubnets,
|
|
131
132
|
})
|
|
132
133
|
|
|
133
134
|
utils.createCfnOutput(`${id}-lambdaArn`, scope, lambdaFunction.functionArn)
|
|
@@ -171,27 +172,28 @@ export class LambdaManager {
|
|
|
171
172
|
|
|
172
173
|
const functionName = `${props.functionName}-${scope.props.stage}`
|
|
173
174
|
const lambdaFunction = new lambda.Function(scope, `${id}`, {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
175
|
+
...props,
|
|
176
|
+
...{
|
|
177
|
+
allowPublicSubnet: !!vpc,
|
|
178
|
+
functionName: functionName,
|
|
179
|
+
handler: handler || 'index.lambda_handler',
|
|
180
|
+
runtime: lambda.Runtime.NODEJS_14_X,
|
|
181
|
+
code: code,
|
|
182
|
+
environment: {
|
|
183
|
+
REGION: scope.props.region,
|
|
184
|
+
...environment,
|
|
185
|
+
},
|
|
186
|
+
filesystem: accessPoint
|
|
187
|
+
? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg')
|
|
188
|
+
: undefined,
|
|
189
|
+
layers: layers,
|
|
190
|
+
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
191
|
+
role: role instanceof iam.Role ? role : undefined,
|
|
192
|
+
securityGroups: securityGroups,
|
|
193
|
+
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
194
|
+
vpc: vpc,
|
|
195
|
+
vpcSubnets: vpcSubnets,
|
|
182
196
|
},
|
|
183
|
-
filesystem: accessPoint ? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
|
|
184
|
-
layers: layers,
|
|
185
|
-
logRetention: props.logRetention,
|
|
186
|
-
memorySize: props.memorySize,
|
|
187
|
-
onFailure: props.onFailure,
|
|
188
|
-
onSuccess: props.onSuccess,
|
|
189
|
-
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
190
|
-
role: role instanceof iam.Role ? role : undefined,
|
|
191
|
-
securityGroups: securityGroups,
|
|
192
|
-
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
193
|
-
vpc: vpc,
|
|
194
|
-
vpcSubnets: vpcSubnets,
|
|
195
197
|
})
|
|
196
198
|
|
|
197
199
|
utils.createCfnOutput(`${id}-lambdaArn`, scope, lambdaFunction.functionArn)
|