Skip to content

Commit a81a0a4

Browse files
authored
docs(ec2): remove references to deprecated allowAllTraffic parameter (#18970)
allowAllTraffic is not available in CDK v2 (and it has been deprecated in CDK v1), so the example code snippets should refer to the newer parameter defaultAllowedTraffic instead. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 3d71e44 commit a81a0a4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/@aws-cdk/aws-ec2/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,16 @@ MachineImage.genericLinux({ ... })` and configure the right AMI ID for the
199199
regions you want to deploy to.
200200

201201
By default, the NAT instances will route all traffic. To control what traffic
202-
gets routed, pass `allowAllTraffic: false` and access the
203-
`NatInstanceProvider.connections` member after having passed it to the VPC:
202+
gets routed, pass a custom value for `defaultAllowedTraffic` and access the
203+
`NatInstanceProvider.connections` member after having passed the NAT provider to
204+
the VPC:
204205

205206
```ts
206207
declare const instanceType: ec2.InstanceType;
207208

208209
const provider = ec2.NatProvider.instance({
209210
instanceType,
210-
allowAllTraffic: false,
211+
defaultAllowedTraffic: ec2.NatTrafficDirection.OUTBOUND_ONLY,
211212
});
212213
new ec2.Vpc(this, 'TheVPC', {
213214
natGatewayProvider: provider,

0 commit comments

Comments
 (0)