@gradientedge/cdk-utils 8.156.0 → 8.156.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/aws/construct/event-handler/main.js +1 -4
- package/dist/src/lib/aws/construct/event-handler/types.d.ts +1 -2
- package/dist/src/lib/aws/construct/lambda-with-iam-access/main.js +2 -2
- package/package.json +1 -1
- package/src/lib/aws/construct/event-handler/main.ts +1 -3
- package/src/lib/aws/construct/event-handler/types.ts +1 -2
- package/src/lib/aws/construct/lambda-with-iam-access/main.ts +4 -2
|
@@ -55,12 +55,9 @@ class EventHandler extends common_1.CommonConstruct {
|
|
|
55
55
|
* @summary Method to resolve common vpc or create a new one.
|
|
56
56
|
*/
|
|
57
57
|
resolveVpc() {
|
|
58
|
-
if (this.props.
|
|
58
|
+
if (this.props.vpcName) {
|
|
59
59
|
this.vpc = this.vpcManager.retrieveCommonVpc(`${this.id}-vpc`, this, this.props.vpcName);
|
|
60
60
|
}
|
|
61
|
-
else {
|
|
62
|
-
this.vpc = this.vpcManager.createCommonVpc(this, this.props.vpc, this.props.vpc.vpcName);
|
|
63
|
-
}
|
|
64
61
|
}
|
|
65
62
|
/**
|
|
66
63
|
* @summary Method to resolve the exported security group.
|
|
@@ -14,9 +14,8 @@ export interface EventHandlerProps extends CommonStackProps {
|
|
|
14
14
|
eventRuleSchedule: string;
|
|
15
15
|
eventSqs: QueueProps;
|
|
16
16
|
securityGroupExportName: string;
|
|
17
|
-
useExistingVpc: boolean;
|
|
18
17
|
vpc: VpcProps;
|
|
19
|
-
vpcName
|
|
18
|
+
vpcName?: string;
|
|
20
19
|
workflow: SfnStateMachineProps;
|
|
21
20
|
workflowLog: LogProps;
|
|
22
21
|
workflowMapState: SfnMapProps;
|
|
@@ -164,8 +164,8 @@ class LambdaWithIamAccess extends common_1.CommonConstruct {
|
|
|
164
164
|
new aws_iam_1.PolicyStatement({
|
|
165
165
|
actions: ['lambda:InvokeFunction'],
|
|
166
166
|
resources: [
|
|
167
|
-
aws_cdk_lib_1.Fn.importValue(`${this.id}-${alias.aliasName}AliasArn`),
|
|
168
|
-
`${aws_cdk_lib_1.Fn.importValue(`${this.id}-${alias.aliasName}AliasArn`)}*`,
|
|
167
|
+
aws_cdk_lib_1.Fn.importValue(`${this.id}-${this.props.stage}-${lodash_1.default.camelCase(`${this.id}Lambda-${alias.aliasName}`)}AliasArn`),
|
|
168
|
+
`${aws_cdk_lib_1.Fn.importValue(`${this.id}-${this.props.stage}-${lodash_1.default.camelCase(`${this.id}Lambda-${alias.aliasName}`)}AliasArn`)}*`,
|
|
169
169
|
],
|
|
170
170
|
}),
|
|
171
171
|
],
|
package/package.json
CHANGED
|
@@ -55,10 +55,8 @@ export class EventHandler extends CommonConstruct {
|
|
|
55
55
|
* @summary Method to resolve common vpc or create a new one.
|
|
56
56
|
*/
|
|
57
57
|
protected resolveVpc() {
|
|
58
|
-
if (this.props.
|
|
58
|
+
if (this.props.vpcName) {
|
|
59
59
|
this.vpc = this.vpcManager.retrieveCommonVpc(`${this.id}-vpc`, this, this.props.vpcName)
|
|
60
|
-
} else {
|
|
61
|
-
this.vpc = this.vpcManager.createCommonVpc(this, this.props.vpc, this.props.vpc.vpcName)
|
|
62
60
|
}
|
|
63
61
|
}
|
|
64
62
|
|
|
@@ -15,9 +15,8 @@ export interface EventHandlerProps extends CommonStackProps {
|
|
|
15
15
|
eventRuleSchedule: string
|
|
16
16
|
eventSqs: QueueProps
|
|
17
17
|
securityGroupExportName: string
|
|
18
|
-
useExistingVpc: boolean
|
|
19
18
|
vpc: VpcProps
|
|
20
|
-
vpcName
|
|
19
|
+
vpcName?: string
|
|
21
20
|
workflow: SfnStateMachineProps
|
|
22
21
|
workflowLog: LogProps
|
|
23
22
|
workflowMapState: SfnMapProps
|
|
@@ -209,8 +209,10 @@ export class LambdaWithIamAccess extends CommonConstruct {
|
|
|
209
209
|
new PolicyStatement({
|
|
210
210
|
actions: ['lambda:InvokeFunction'],
|
|
211
211
|
resources: [
|
|
212
|
-
Fn.importValue(
|
|
213
|
-
|
|
212
|
+
Fn.importValue(
|
|
213
|
+
`${this.id}-${this.props.stage}-${_.camelCase(`${this.id}Lambda-${alias.aliasName}`)}AliasArn`
|
|
214
|
+
),
|
|
215
|
+
`${Fn.importValue(`${this.id}-${this.props.stage}-${_.camelCase(`${this.id}Lambda-${alias.aliasName}`)}AliasArn`)}*`,
|
|
214
216
|
],
|
|
215
217
|
}),
|
|
216
218
|
],
|