@@ -10,16 +10,16 @@ import { CfnSleep } from '@aws-accelerator/custom-resource-cfn-sleep';
1010export interface FirewallVpnTunnelOptions {
1111 cgwTunnelInsideAddress1 : string ;
1212 cgwTunnelOutsideAddress1 : string ;
13- cgwBgpAsn1 : string ;
1413 vpnTunnelInsideAddress1 : string ;
1514 vpnTunnelOutsideAddress1 : string ;
16- vpnBgpAsn1 : string ;
1715 preSharedSecret1 : string ;
1816 preSharedSecret2 : string ;
1917 vpnTunnelInsideAddress2 : string ;
2018 vpnTunnelOutsideAddress2 : string ;
2119 cgwTunnelInsideAddress2 : string ;
2220 cgwTunnelOutsideAddress2 : string ;
21+ cgwBgpAsn1 ?: string ;
22+ vpnBgpAsn1 ?: string ;
2323}
2424
2525export interface FirewallConfigurationProps {
@@ -171,10 +171,14 @@ export class FirewallInstance extends cdk.Construct {
171171 if ( vpnTunnelOptions ) {
172172 this . template . addReplacement ( `\${${ name } CgwTunnelOutsideAddress1}` , vpnTunnelOptions ?. cgwTunnelOutsideAddress1 ) ;
173173 this . template . addReplacement ( `\${${ name } CgwTunnelInsideAddress1}` , vpnTunnelOptions ?. cgwTunnelInsideAddress1 ) ;
174- this . template . addReplacement ( `\${${ name } CgwBgpAsn1}` , vpnTunnelOptions ?. cgwBgpAsn1 ) ;
174+ if ( vpnTunnelOptions ?. cgwBgpAsn1 ) {
175+ this . template . addReplacement ( `\${${ name } CgwBgpAsn1}` , vpnTunnelOptions ?. cgwBgpAsn1 ) ;
176+ }
175177 this . template . addReplacement ( `\${${ name } VpnTunnelOutsideAddress1}` , vpnTunnelOptions ?. vpnTunnelOutsideAddress1 ) ;
176178 this . template . addReplacement ( `\${${ name } VpnTunnelInsideAddress1}` , vpnTunnelOptions ?. vpnTunnelInsideAddress1 ) ;
177- this . template . addReplacement ( `\${${ name } VpnBgpAsn1}` , vpnTunnelOptions ?. vpnBgpAsn1 ) ;
179+ if ( vpnTunnelOptions ?. vpnBgpAsn1 ) {
180+ this . template . addReplacement ( `\${${ name } VpnBgpAsn1}` , vpnTunnelOptions ?. vpnBgpAsn1 ) ;
181+ }
178182 this . template . addReplacement ( `\${${ name } PreSharedSecret1}` , vpnTunnelOptions ?. preSharedSecret1 ) ;
179183 this . template . addReplacement ( `\${${ name } CgwTunnelOutsideAddress2}` , vpnTunnelOptions ?. cgwTunnelOutsideAddress2 ) ;
180184 this . template . addReplacement ( `\${${ name } CgwTunnelInsideAddress2}` , vpnTunnelOptions ?. cgwTunnelInsideAddress2 ) ;
0 commit comments