CfnTransitGatewayRouteTable: not returning the default routing table to add additional routes
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
In: `"aws-cdk": "2.46.0"`
When creating TransitGateway:
```
const securityCenterTransitGateway = new CfnTransitGateway(stack, 'Security-Center-Transit-Gateway', {
description: "Security Center TransitGateway",
vpnEcmpSupport: 'enable',
autoAcceptSharedAttachments: "enable",
defaultRouteTableAssociation: "enable",
defaultRouteTablePropagation: "enable",
tags: [{
key: 'Name',
value: "Security Center Transit Gateway"
}],
});
```
you get the following error:
`failed to deploy: UPDATE_ROLLBACK_COMPLETE: Resource handler returned message: "enable DefaultRouteTableAssociation conflicts with AssociationDefaultRouteTableId null`
Essentially the AssociationDefaultRouteTableId and PropagationDefaultRouteTableId are required. However in order to create a routing table you must have the transitGatewayID: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnTransitGatewayRouteTable.html
If you try to overwrite TransitGateway properties after you initialize a routing table you get a circular dependency error.
### Expected Behavior
You must be able to create a routing table and overwrite the TransitGateway params to enable default association and propagation.
### Current Behavior
It is impossible to configure default propagation and association routing table.
### Reproduction Steps
1. create a TWG:
```
// Creates Transit gateway
const securityCenterTransitGateway = new CfnTransitGateway(stack, 'Security-Center-Transit-Gateway', {
description: "Security Center TransitGateway",
vpnEcmpSupport: 'enable',
autoAcceptSharedAttachments: "enable",
defaultRouteTableAssociation: "enable",
defaultRouteTablePropagation: "enable",
tags: [{
key: 'Name',
value: "Security Center Transit Gateway"
}],
});
```
This will give you the error: `failed to deploy: UPDATE_ROLLBACK_COMPLETE: Resource handler returned message: "enable DefaultRouteTableAssociation conflicts with AssociationDefaultRouteTableId null`
2. create a TWG instance without the defaults:
```
// Creates Transit gateway
const securityCenterTransitGateway = new CfnTransitGateway(stack, 'Security-Center-Transit-Gateway', {
description: "Security Center TransitGateway",
vpnEcmpSupport: 'enable',
autoAcceptSharedAttachments: "enable",
tags: [{
key: 'Name',
value: "Security Center Transit Gateway"
}],
});
```
3. create a new route table:
```
const securityCenterDefaultTgwRouteTable = new CfnTransitGatewayRouteTable(stack, 'Security-Center-Default-Tgw-Route-Table', {
transitGatewayId: securityCenterTransitGateway.ref,
tags: [{
key: 'Name',
value: 'SecurityCenterDefaultTgwRouteTable',
}],
});
```
4. Try to overwrite the TWG property:
```
securityCenterTransitGateway.addOverride('Properties.associationDefaultRouteTableId', securityCenterDefaultTgwRouteTable.ref);
securityCenterTransitGateway.addOverride('Properties.defaultRouteTableAssociation', 'enable');
```
Get the error:
[[securityCenterDefaultTgwRouteTable](failed: Error [ValidationError]: Circular dependency between resources: [securityCenterDefaultTgwRouteTable, ....)
### Possible Solution
Remove circular dependency or create a custom resource to update once created.
### Additional Information/Context
_No response_
### CDK CLI Version
2.46.0
### Framework Version
_No response_
### Node.js Version
v16.15.0
### OS
13.1 (22C65)
### Language
Typescript
### Language Version
4.6.3
### Other information
_No response_
Contributor guide
Research direction
Start with the CfnTransitGateway and CfnTransitGatewayRouteTable entry points and reproduce the TypeScript sequence in the issue, including the default association and propagation properties. Investigate the generated dependency relationship and confirm a configuration that creates the route table without the reported circular dependency or deployment conflict.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100