From ce947682a071a10b388832ccc25528101ee17e71 Mon Sep 17 00:00:00 2001 From: Bora Akyuz Date: Wed, 12 Oct 2022 18:10:18 +0100 Subject: [PATCH] fix: comment out the allowOutBound error condition to fix the duplicate error message for issue #9565 --- packages/@aws-cdk/aws-ec2/lib/security-group.ts | 15 ++++++++------- packages/aws-cdk-lib/package.json | 6 ++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/@aws-cdk/aws-ec2/lib/security-group.ts b/packages/@aws-cdk/aws-ec2/lib/security-group.ts index c5c0ad3753df1..00b29ed12e413 100644 --- a/packages/@aws-cdk/aws-ec2/lib/security-group.ts +++ b/packages/@aws-cdk/aws-ec2/lib/security-group.ts @@ -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 diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index a6e0e6931dc18..fbe72d55700fc 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -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", @@ -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", @@ -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", @@ -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", @@ -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",