@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.
@@ -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.useExistingVpc) {
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: string;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "8.156.0",
3
+ "version": "8.156.1",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -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.useExistingVpc) {
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: string
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(`${this.id}-${alias.aliasName}AliasArn`),
213
- `${Fn.importValue(`${this.id}-${alias.aliasName}AliasArn`)}*`,
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
  ],