From 4796b2404c10e0944812d2627d2fdb27ccfcdabd Mon Sep 17 00:00:00 2001 From: Hanwen Date: Thu, 1 Aug 2024 07:52:16 -0700 Subject: [PATCH] Fix Cfn-lint W1028 Example failures https://github.com/aws/aws-parallelcluster/actions/runs/10185517412/job/28175271776?pr=6372 Analysis https://github.com/aws-cloudformation/cfn-lint/issues/3551#issuecomment-2261534206 Signed-off-by: Hanwen --- .../networking/public-private.cfn.json | 20 ++----------------- cloudformation/networking/public.cfn.json | 20 ++----------------- 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/cloudformation/networking/public-private.cfn.json b/cloudformation/networking/public-private.cfn.json index 308e234315..b9430177fb 100644 --- a/cloudformation/networking/public-private.cfn.json +++ b/cloudformation/networking/public-private.cfn.json @@ -119,15 +119,7 @@ "Properties": { "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { - "Fn::If": [ - "CreateInternetGateway", - { - "Ref": "InternetGateway" - }, - { - "Ref": "InternetGatewayId" - } - ] + "Ref": "InternetGateway" }, "RouteTableId": { "Ref": "RouteTablePublic" @@ -140,15 +132,7 @@ "Properties": { "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { - "Fn::If": [ - "CreateInternetGateway", - { - "Ref": "InternetGateway" - }, - { - "Ref": "InternetGatewayId" - } - ] + "Ref": "InternetGatewayId" }, "RouteTableId": { "Ref": "RouteTablePublic" diff --git a/cloudformation/networking/public.cfn.json b/cloudformation/networking/public.cfn.json index 1813596979..f1cc72e27f 100644 --- a/cloudformation/networking/public.cfn.json +++ b/cloudformation/networking/public.cfn.json @@ -108,15 +108,7 @@ "Properties": { "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { - "Fn::If": [ - "CreateInternetGateway", - { - "Ref": "InternetGateway" - }, - { - "Ref": "InternetGatewayId" - } - ] + "Ref": "InternetGateway" }, "RouteTableId": { "Ref": "RouteTablePublic" @@ -129,15 +121,7 @@ "Properties": { "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { - "Fn::If": [ - "CreateInternetGateway", - { - "Ref": "InternetGateway" - }, - { - "Ref": "InternetGatewayId" - } - ] + "Ref": "InternetGatewayId" }, "RouteTableId": { "Ref": "RouteTablePublic"