Skip to content

Commit 3d07a79

Browse files
committed
update README of cloudfront-origins to reflect PrefixList.fromLookup()
1 parent 5e053e2 commit 3d07a79

File tree

1 file changed

+4
-2
lines changed
  • packages/aws-cdk-lib/aws-cloudfront-origins

1 file changed

+4
-2
lines changed

packages/aws-cdk-lib/aws-cloudfront-origins/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,10 @@ You can allow the traffic from the CloudFront managed prefix list named **com.am
678678
``` ts
679679
declare const alb: elbv2.ApplicationLoadBalancer;
680680

681-
const peer = ec2.Peer.prefixList('pl-xxxxxxxx'); // See the management console to find actual PrefixList Id.
682-
alb.connections.allowFrom(peer, ec2.Port.HTTP);
681+
const cfOriginFacing = ec2.PrefixList.fromLookup(this, 'CloudFrontOriginFacing', {
682+
prefixListName: 'com.amazonaws.global.cloudfront.origin-facing',
683+
});
684+
alb.connections.allowFrom(cfOriginFacing, ec2.Port.HTTP);
683685
```
684686

685687
#### The VPC origin service security group

0 commit comments

Comments
 (0)