Describe the feature
I want to enable the configuration of IP-based routing in Route 53 through the L2 construct.
Use Case
Currently, to configure IP-based routing in Route 53, it is necessary to use L1 constructs.
const locationName = 'myLocation'
// Create a CIDR collection
const cidrCollection = new route53.CfnCidrCollection(this, 'MyCidrCollection', {
name: 'MyCidrCollection',
locations: [
{
cidrList: ['192.168.1.0/24', '192.168.2.0/24'],
locationName,
}
]
});
// Create a RecordSet that uses the CIDR collection
new route53.CfnRecordSet(this, 'MyRecordSet', {
// ... other properties ...
// Reference the CIDR collection
cidrRoutingConfig: {
collectionId: cidrCollection.ref,
locationName,
},
});
Proposed Solution
I believe that generating CfnCidrCollection within the recordSet constructor allows for intuitive configuration.
However, additional handling is required when sharing the same collection across different RecordSets.
IP-based routing resource record sets reference a location in a collection, and all resource record sets for the same record set name and type must reference the same collection. For example, if you create websites in two Regions and want to direct DNS queries from two different CIDR locations to a specific website based on the originating IP addresses, then both of those locations must be listed in the same CIDR collection.
interface CidrRoutingConfig {
collectionName?: string;
locations: Location[];
// Define only if sharing the same collection with other RecordSets
collection?: CfnCidrCollection:
}
interface Location {
cidrList: string[];
locationName?: string;
}
const record1 = new route53.RecordSet(this, 'IPBasedRoutingRecordSet1', {
// ... other properties ...
cidrRoutingConfig: {
collectionName: 'MyCollection', // optional
locations: [
{
locationName: 'Location1', // optional
cidrList: ['192.168.1.0/24', '192.168.2.0/24'],
},
],
},
});
// By adding Location2 to the CfnCidrCollection created in record1, the same CidrCollection can be shared.
const record2 = new route53.RecordSet(this, 'IPBasedRoutingRecordSet2', {
// ... other properties ...
cidrRoutingConfig: {
collection: record1.cidrCollection,
locations: [
{
locationName: 'Location2', // optional
cidrList: ['192.168.3.0/24', '192.168.4.0/24'],
},
],
},
});
Other Information
No response
Acknowledgements
CDK version used
2.116.0
Environment details (OS name and version, etc.)
irrelevant
Describe the feature
I want to enable the configuration of IP-based routing in Route 53 through the L2 construct.
Use Case
Currently, to configure IP-based routing in Route 53, it is necessary to use L1 constructs.
Proposed Solution
I believe that generating CfnCidrCollection within the recordSet constructor allows for intuitive configuration.
However, additional handling is required when sharing the same collection across different RecordSets.
IP-based routing resource record sets reference a location in a collection, and all resource record sets for the same record set name and type must reference the same collection. For example, if you create websites in two Regions and want to direct DNS queries from two different CIDR locations to a specific website based on the originating IP addresses, then both of those locations must be listed in the same CIDR collection.Other Information
No response
Acknowledgements
CDK version used
2.116.0
Environment details (OS name and version, etc.)
irrelevant