-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Describe the bug
When building a VPC stack, the following deprecation warning appears:
[WARNING] aws-cdk-lib.aws_ec2.InstanceProps#keyName is deprecated.
- Use
keyPairinstead - https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2-readme.html#using-an-existing-ec2-key-pair
This API will be removed in the next major release.
The stack does not reference any EC2 instance or InstanceProps or keyName or keyPair directly. I think this is coming from a call to aws_ec2.NatProvider.instance_v2, but I can't be certain because there appears to be no reference to keyName or key_name in that module, nor can I find any evidence that there is a default value for keyName.
Expected Behavior
- We should not get deprecation warnings for features we aren't using.
- We should get deprecation warnings with more context so that we can log more accurate bug reports.
Current Behavior
When building a VPC stack, the following deprecation warning appears:
[WARNING] aws-cdk-lib.aws_ec2.InstanceProps#keyName is deprecated.
- Use
keyPairinstead - https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2-readme.html#using-an-existing-ec2-key-pair
This API will be removed in the next major release.
Reproduction Steps
I'll attempt to provide one of these at a later time.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.148.0 (build e5740c0)
Framework Version
No response
Node.js Version
v18.20.3
OS
Linux (Ubuntu 24.04 LTS in docker)
Language
Python
Language Version
3.12.3
Other information
No response