-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ec2: "[WARNING] aws-cdk-lib.aws_ec2.InstanceProps#keyName is deprecated" appears when there are no references to keyName in the stack #30806
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Comments
paulgear
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Jul 9, 2024
github-actions
bot
added
the
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
label
Jul 9, 2024
Here is a minimal reproducer stack:
|
ashishdhingra
added
needs-reproduction
This issue needs reproduction.
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Jul 10, 2024
Reproducible using below TypeScript CDK code: import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
export class Issue30806Stack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const natGatewayProvider = ec2.NatProvider.instanceV2({
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3_AMD, ec2.InstanceSize.MICRO),
defaultAllowedTraffic: ec2.NatTrafficDirection.OUTBOUND_ONLY
});
const vpc = new ec2.Vpc(this, 'testvpc', {
ipAddresses: ec2.IpAddresses.cidr('10.1.0.0/16'),
maxAzs: 1,
natGatewayProvider: natGatewayProvider,
subnetConfiguration: [
{
name: 'public',
subnetType: ec2.SubnetType.PUBLIC,
cidrMask: 24
},
{
name: 'private',
subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,
cidrMask: 24
}
]
});
}
} Running [WARNING] aws-cdk-lib.aws_ec2.InstanceProps#keyName is deprecated.
- Use `keyPair` instead - 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. Initial Analysis:
|
ashishdhingra
added
p2
effort/small
Small work item – less than a day of effort
and removed
needs-reproduction
This issue needs reproduction.
labels
Jul 10, 2024
This was referenced Jul 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Describe the bug
When building a VPC stack, the following deprecation warning appears:
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 tokeyName
orkey_name
in that module, nor can I find any evidence that there is a default value forkeyName
.Expected Behavior
Current Behavior
When building a VPC stack, the following deprecation warning appears:
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
The text was updated successfully, but these errors were encountered: