Skip to content

Commit

Permalink
fix: allow outbound on wso2api construct
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviostutz committed Jan 24, 2024
1 parent 069a641 commit caac4d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 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.

7 changes: 1 addition & 6 deletions lib/src/wso2/wso2-api/wso2-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Construct } from 'constructs';
import { CustomResource, Duration, RemovalPolicy, ScopedAws } from 'aws-cdk-lib/core';
import { IFunction, Runtime } from 'aws-cdk-lib/aws-lambda';
import { PolicyStatement } from 'aws-cdk-lib/aws-iam';
import { Peer, Port } from 'aws-cdk-lib/aws-ec2';
import { OpenAPIObject } from 'openapi3-ts/oas30';
import { RetentionDays } from 'aws-cdk-lib/aws-logs';
import { Provider } from 'aws-cdk-lib/custom-resources';
Expand Down Expand Up @@ -75,14 +74,10 @@ export class Wso2Api extends Construct {
}),
],
logGroupRetention,
allowAllOutbound: !props.customResourceConfig?.allowTLSOutboundTo,
...props.customResourceConfig,
});

// add default outbound rule for connecting to any host
if (!props.customResourceConfig?.allowTLSOutboundTo) {
customResourceFunction.defaultSecurityGroup?.addEgressRule(Peer.anyIpv4(), Port.allTraffic());
}

const customResourceProvider = new Provider(this, `${id}-wso2api-custom-provider`, {
onEventHandler: customResourceFunction.nodeJsFunction,
});
Expand Down

0 comments on commit caac4d3

Please sign in to comment.