Skip to content

Commit

Permalink
fix: comment out the allowOutBound error condition to fix the duplica…
Browse files Browse the repository at this point in the history
…te error message for issue aws#9565
  • Loading branch information
bora-7 committed Oct 12, 2022
1 parent da181ba commit ce94768
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/@aws-cdk/aws-ec2/lib/security-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,13 +535,14 @@ export class SecurityGroup extends SecurityGroupBase {
const isIpv6 = peer.toEgressRuleConfig().hasOwnProperty('cidrIpv6');

if (!isIpv6 && this.allowAllOutbound) {
// In the case of "allowAllOutbound", we don't add any more rules. There
// is only one rule which allows all traffic and that subsumes any other
// rule.
if (!remoteRule) { // Warn only if addEgressRule() was explicitely called
Annotations.of(this).addWarning('Ignoring Egress rule since \'allowAllOutbound\' is set to true; To add customized rules, set allowAllOutbound=false on the SecurityGroup');
}
return;
// commented out lines 539 to 545 to fix issue #9565
// // In the case of "allowAllOutbound", we don't add any more rules. There
// // is only one rule which allows all traffic and that subsumes any other
// // rule.
// if (!remoteRule) { // Warn only if addEgressRule() was explicitely called
// Annotations.of(this).addWarning('Ignoring Egress rule since \'allowAllOutbound\' is set to true; To add customized rules, set allowAllOutbound=false on the SecurityGroup');
// }
// return;
} else if (!isIpv6 && !this.allowAllOutbound) {
// Otherwise, if the bogus rule exists we can now remove it because the
// presence of any other rule will get rid of EC2's implicit "all
Expand Down
6 changes: 6 additions & 0 deletions packages/aws-cdk-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@
"./aws-cognito": "./aws-cognito/index.js",
"./aws-config": "./aws-config/index.js",
"./aws-connect": "./aws-connect/index.js",
"./aws-connectcampaigns": "./aws-connectcampaigns/index.js",
"./aws-controltower": "./aws-controltower/index.js",
"./aws-cur": "./aws-cur/index.js",
"./aws-customerprofiles": "./aws-customerprofiles/index.js",
"./aws-databrew": "./aws-databrew/index.js",
Expand Down Expand Up @@ -512,6 +514,7 @@
"./aws-iotcoredeviceadvisor": "./aws-iotcoredeviceadvisor/index.js",
"./aws-iotevents": "./aws-iotevents/index.js",
"./aws-iotfleethub": "./aws-iotfleethub/index.js",
"./aws-iotfleetwise": "./aws-iotfleetwise/index.js",
"./aws-iotsitewise": "./aws-iotsitewise/index.js",
"./aws-iotthingsgraph": "./aws-iotthingsgraph/index.js",
"./aws-iottwinmaker": "./aws-iottwinmaker/index.js",
Expand Down Expand Up @@ -539,6 +542,7 @@
"./aws-lookoutequipment": "./aws-lookoutequipment/index.js",
"./aws-lookoutmetrics": "./aws-lookoutmetrics/index.js",
"./aws-lookoutvision": "./aws-lookoutvision/index.js",
"./aws-m2": "./aws-m2/index.js",
"./aws-macie": "./aws-macie/index.js",
"./aws-managedblockchain": "./aws-managedblockchain/index.js",
"./aws-mediaconnect": "./aws-mediaconnect/index.js",
Expand Down Expand Up @@ -572,6 +576,7 @@
"./aws-resiliencehub": "./aws-resiliencehub/index.js",
"./aws-resourcegroups": "./aws-resourcegroups/index.js",
"./aws-robomaker": "./aws-robomaker/index.js",
"./aws-rolesanywhere": "./aws-rolesanywhere/index.js",
"./aws-route53": "./aws-route53/index.js",
"./aws-route53-patterns": "./aws-route53-patterns/index.js",
"./aws-route53-targets": "./aws-route53-targets/index.js",
Expand Down Expand Up @@ -605,6 +610,7 @@
"./aws-sso": "./aws-sso/index.js",
"./aws-stepfunctions": "./aws-stepfunctions/index.js",
"./aws-stepfunctions-tasks": "./aws-stepfunctions-tasks/index.js",
"./aws-supportapp": "./aws-supportapp/index.js",
"./aws-synthetics": "./aws-synthetics/index.js",
"./aws-timestream": "./aws-timestream/index.js",
"./aws-transfer": "./aws-transfer/index.js",
Expand Down

0 comments on commit ce94768

Please sign in to comment.