Skip to content

Commit

Permalink
chore: enhancing property removal
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviostutz committed Nov 8, 2024
1 parent 4b75772 commit 988d3a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions lib/src/wso2/utils-cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export const addLambdaAndProviderForWso2Operations = (args: {

const { accountId, region } = new ScopedAws(args.scope);

// never use network configuration, only explicit VPC from previous step
const { network, ...customResourceConfig } = args.props.customResourceConfig ?? {};

// resolve the entry file from workspace (.ts file), or
// from the dist dir (.js file) when being used as a lib
let wso2LambdaEntry = `${args.baseDir}/handler/index.ts`;
Expand All @@ -35,18 +38,13 @@ export const addLambdaAndProviderForWso2Operations = (args: {

// vpc is undefined if no network is defined
let vpc: IVpc | undefined;
const { customResourceConfig } = args.props;

const securityGroups = [];

// Create security group for custom resource if VPC is defined and no security group is defined
if (args.props.customResourceConfig?.network) {
vpc = vpcFromConfig(args.scope, args.props.customResourceConfig.network);

// never use network configuration, only explicit VPC from previous step
// eslint-disable-next-line fp/no-delete
delete customResourceConfig?.network;

if (
!customResourceConfig?.securityGroups ||
customResourceConfig?.securityGroups.length === 0
Expand Down

0 comments on commit 988d3a9

Please sign in to comment.