@gradientedge/cdk-utils 8.122.0 → 8.123.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/dist/src/lib/aws/common/stack.js +5 -7
- package/dist/src/lib/aws/construct/api-to-any-target/main.js +24 -26
- package/dist/src/lib/aws/construct/api-to-eventbridge-target/main.js +85 -103
- package/dist/src/lib/aws/construct/api-to-eventbridge-target-with-sns/main.js +94 -120
- package/dist/src/lib/aws/construct/api-to-lambda-target/main.js +8 -10
- package/dist/src/lib/aws/construct/graphql-api-lambda/main.js +7 -3
- package/dist/src/lib/aws/construct/graphql-api-lambda-with-cache/main.js +5 -1
- package/dist/src/lib/aws/construct/lambda-with-iam-access/main.js +5 -1
- package/dist/src/lib/aws/construct/rest-api-lambda/main.js +7 -3
- package/dist/src/lib/aws/construct/rest-api-lambda-with-cache/main.js +5 -1
- package/dist/src/lib/aws/construct/site-with-ecs-backend/main.js +8 -6
- package/dist/src/lib/aws/construct/static-asset-deployment/main.js +5 -1
- package/dist/src/lib/aws/services/api-gateway/main.js +18 -10
- package/dist/src/lib/aws/services/cloudfront/main.js +11 -7
- package/dist/src/lib/aws/services/cloudwatch/logs.js +8 -4
- package/dist/src/lib/aws/services/cloudwatch/main.js +36 -78
- package/dist/src/lib/aws/services/dynamodb/main.js +6 -2
- package/dist/src/lib/aws/services/elastic-container-service/main.js +8 -4
- package/dist/src/lib/aws/services/elastic-file-system/main.js +5 -1
- package/dist/src/lib/aws/services/elasticache/main.js +6 -2
- package/dist/src/lib/aws/services/eventbridge/main.js +8 -4
- package/dist/src/lib/aws/services/lambda/main.js +7 -3
- package/dist/src/lib/aws/services/simple-notification-service/main.js +6 -2
- package/dist/src/lib/aws/services/simple-queue-service/main.js +6 -2
- package/dist/src/lib/aws/services/simple-storage-service/main.js +8 -4
- package/dist/src/lib/aws/services/step-function/main.js +52 -32
- package/dist/src/lib/aws/services/virtual-private-cloud/main.js +8 -4
- package/dist/src/lib/azure/common/stack.js +5 -7
- package/dist/src/lib/common/index.js +7 -3
- package/package.json +8 -8
- package/src/lib/aws/common/stack.ts +5 -7
- package/src/lib/aws/construct/api-to-any-target/main.ts +25 -27
- package/src/lib/aws/construct/api-to-eventbridge-target/main.ts +85 -103
- package/src/lib/aws/construct/api-to-eventbridge-target-with-sns/main.ts +94 -120
- package/src/lib/aws/construct/api-to-lambda-target/main.ts +8 -10
- package/src/lib/aws/construct/graphql-api-lambda/main.ts +4 -3
- package/src/lib/aws/construct/graphql-api-lambda-with-cache/main.ts +2 -1
- package/src/lib/aws/construct/lambda-with-iam-access/main.ts +2 -1
- package/src/lib/aws/construct/rest-api-lambda/main.ts +4 -3
- package/src/lib/aws/construct/rest-api-lambda-with-cache/main.ts +2 -1
- package/src/lib/aws/construct/site-with-ecs-backend/main.ts +8 -9
- package/src/lib/aws/construct/static-asset-deployment/main.ts +2 -1
- package/src/lib/aws/services/api-gateway/main.ts +9 -6
- package/src/lib/aws/services/cloudfront/main.ts +8 -7
- package/src/lib/aws/services/cloudwatch/logs.ts +6 -5
- package/src/lib/aws/services/cloudwatch/main.ts +35 -81
- package/src/lib/aws/services/dynamodb/main.ts +3 -2
- package/src/lib/aws/services/elastic-container-service/main.ts +5 -4
- package/src/lib/aws/services/elastic-file-system/main.ts +2 -1
- package/src/lib/aws/services/elasticache/main.ts +3 -2
- package/src/lib/aws/services/eventbridge/main.ts +5 -4
- package/src/lib/aws/services/lambda/main.ts +4 -3
- package/src/lib/aws/services/simple-notification-service/main.ts +3 -2
- package/src/lib/aws/services/simple-queue-service/main.ts +3 -2
- package/src/lib/aws/services/simple-storage-service/main.ts +5 -4
- package/src/lib/aws/services/step-function/main.ts +17 -16
- package/src/lib/aws/services/virtual-private-cloud/main.ts +5 -4
- package/src/lib/azure/common/stack.ts +7 -9
- package/src/lib/common/index.ts +5 -3
|
@@ -3,9 +3,10 @@ import { CommonAzureConstruct } from './construct'
|
|
|
3
3
|
import { CommonAzureStackProps } from './types'
|
|
4
4
|
|
|
5
5
|
import appRoot from 'app-root-path'
|
|
6
|
-
import {
|
|
7
|
-
import { isDevStage } from '../../common'
|
|
6
|
+
import { TerraformStack } from 'cdktf'
|
|
8
7
|
import { Construct } from 'constructs'
|
|
8
|
+
import _ from 'lodash'
|
|
9
|
+
import { isDevStage } from '../../common'
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* @classdesc Common stack to use as a base for all higher level constructs.
|
|
@@ -70,7 +71,7 @@ export class CommonAzureStack extends TerraformStack {
|
|
|
70
71
|
return
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
_.forEach(extraContexts, (context: string) => {
|
|
74
75
|
const extraContextPath = `${appRoot.path}/${context}`
|
|
75
76
|
|
|
76
77
|
/* scenario where extra context is configured in cdk.json but absent in file system */
|
|
@@ -84,7 +85,7 @@ export class CommonAzureStack extends TerraformStack {
|
|
|
84
85
|
const extraContextProps = JSON.parse(extraContextPropsBuffer.toString('utf-8'))
|
|
85
86
|
|
|
86
87
|
/* set each of the property into the cdk node context */
|
|
87
|
-
|
|
88
|
+
_.keys(extraContextProps).forEach((propKey: any) => {
|
|
88
89
|
this.node.setContext(propKey, extraContextProps[propKey])
|
|
89
90
|
})
|
|
90
91
|
})
|
|
@@ -120,13 +121,10 @@ export class CommonAzureStack extends TerraformStack {
|
|
|
120
121
|
const stageContextProps = JSON.parse(stageContextPropsBuffer.toString('utf-8'))
|
|
121
122
|
|
|
122
123
|
/* set each of the property into the cdk node context */
|
|
123
|
-
|
|
124
|
+
_.keys(stageContextProps).forEach((propKey: any) => {
|
|
124
125
|
/* handle object, array properties */
|
|
125
126
|
if (typeof stageContextProps[propKey] === 'object' && !Array.isArray(stageContextProps[propKey])) {
|
|
126
|
-
this.node.setContext(propKey,
|
|
127
|
-
...this.node.tryGetContext(propKey),
|
|
128
|
-
...stageContextProps[propKey],
|
|
129
|
-
})
|
|
127
|
+
this.node.setContext(propKey, _.merge(this.node.tryGetContext(propKey), stageContextProps[propKey]))
|
|
130
128
|
} else {
|
|
131
129
|
/* handle all other primitive properties */
|
|
132
130
|
this.node.setContext(propKey, stageContextProps[propKey])
|
package/src/lib/common/index.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import _ from 'lodash'
|
|
2
|
+
|
|
1
3
|
export * from './construct'
|
|
2
4
|
export * from './stack'
|
|
3
5
|
export * from './types'
|
|
4
6
|
export * from './utils'
|
|
5
7
|
|
|
6
8
|
export const applyMixins = (derivedCtor: any, constructors: any[]) => {
|
|
7
|
-
|
|
8
|
-
Object.getOwnPropertyNames(
|
|
9
|
+
_.forEach(constructors, baseConstructor => {
|
|
10
|
+
Object.getOwnPropertyNames(baseConstructor.prototype).forEach(name => {
|
|
9
11
|
Object.defineProperty(
|
|
10
12
|
derivedCtor.prototype,
|
|
11
13
|
name,
|
|
12
|
-
Object.getOwnPropertyDescriptor(
|
|
14
|
+
Object.getOwnPropertyDescriptor(baseConstructor.prototype, name) || Object.create(null)
|
|
13
15
|
)
|
|
14
16
|
})
|
|
15
17
|
})
|