Skip to content

Commit 4b4bd99

Browse files
fix(core): Add static routing to Customer Gateway and vpnConnection (#741)
* Fixing TGW Static Route * Fixing tgw routes * Add static routing to Customer Gateway and vpnConnection
1 parent c3ce485 commit 4b4bd99

File tree

1 file changed

+3
-1
lines changed
  • src/deployments/cdk/src/deployments/firewall/cluster

1 file changed

+3
-1
lines changed

src/deployments/cdk/src/deployments/firewall/cluster/step-2.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ async function createCustomerGateways(props: {
108108

109109
const firewallCgwName = firewallConfig['fw-cgw-name'];
110110
const firewallCgwAsn = firewallConfig['fw-cgw-asn'];
111+
const firewallCgwRouting = firewallConfig['fw-cgw-routing'].toLowerCase();
111112

112113
const addTagsDependencies = [];
113114
const addTagsToResources: AddTagsToResource[] = [];
@@ -127,13 +128,14 @@ async function createCustomerGateways(props: {
127128
customerGateway = new ec2.CfnCustomerGateway(scope, `${prefix}_cgw`, {
128129
type: 'ipsec.1',
129130
ipAddress: port.eipIpAddress,
130-
bgpAsn: firewallCgwAsn,
131+
bgpAsn: firewallCgwRouting === 'dynamic' ? firewallCgwAsn : 65000,
131132
});
132133

133134
vpnConnection = new ec2.CfnVPNConnection(scope, `${prefix}_vpn`, {
134135
type: 'ipsec.1',
135136
transitGatewayId: transitGateway.tgwId,
136137
customerGatewayId: customerGateway.ref,
138+
staticRoutesOnly: firewallCgwRouting === 'static' ? true : false,
137139
});
138140

139141
const options = new VpnTunnelOptions(scope, `VpnTunnelOptions${index}`, {

0 commit comments

Comments
 (0)