File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
packages/cdk/lib/construct/closedNetwork Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 55 SecurityGroup ,
66 ISubnet ,
77 SubnetType ,
8- SubnetFilter ,
8+ Subnet ,
99} from 'aws-cdk-lib/aws-ec2' ;
1010import { CfnResolverEndpoint } from 'aws-cdk-lib/aws-route53resolver' ;
1111import { Construct } from 'constructs' ;
@@ -41,15 +41,13 @@ export class Resolver extends Construct {
4141 'DNS UDP'
4242 ) ;
4343
44- const subnets = props . vpc . selectSubnets (
45- props . subnetIds
46- ? {
47- subnetFilters : [ SubnetFilter . byIds ( props . subnetIds ) ] ,
48- }
49- : {
50- subnetType : SubnetType . PRIVATE_ISOLATED ,
51- }
52- ) . subnets ;
44+ const subnets = props . subnetIds
45+ ? props . subnetIds . map ( ( subnetId ) =>
46+ Subnet . fromSubnetId ( this , `ResolverSubnet-${ subnetId } ` , subnetId )
47+ )
48+ : props . vpc . selectSubnets ( {
49+ subnetType : SubnetType . PRIVATE_ISOLATED ,
50+ } ) . subnets ;
5351
5452 const ipAddresses : CfnResolverEndpoint . IpAddressRequestProperty [ ] =
5553 subnets . map ( ( s : ISubnet ) => ( { subnetId : s . subnetId } ) ) ;
You can’t perform that action at this time.
0 commit comments