-
Notifications
You must be signed in to change notification settings - Fork 4k
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
aws-autoscaling: The specified instance m7i.xlarge is not valid #28459
Comments
Are you able to select that instance type from AWS EC2 console? I am able to deploy m7x.large in // get autoscaling group
export function getAutoScalingGroup(scope: Construct, instanceType?: ec2.InstanceType, machineImage?: ec2.MachineImage): autoscaling.AutoScalingGroup {
return new autoscaling.AutoScalingGroup(scope, 'AutoScalingGroup', {
instanceType: instanceType ?? ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.LARGE),
machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2023 }),
vpc: getDefaultVpc(scope),
})
}
export class DemoStack extends MyStack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props);
getAutoScalingGroup(this, new ec2.InstanceType('m7i.xlarge'))
}
} And I saw this in my synthesized launch template "AutoScalingGroupLaunchTemplateCE2B3AFE": {
"Type": "AWS::EC2::LaunchTemplate",
"Properties": {
"LaunchTemplateData": {
"IamInstanceProfile": {
"Arn": {
"Fn::GetAtt": [
"AutoScalingGroupInstanceProfile342FAC7C",
"Arn"
]
}
},
"ImageId": {
"Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter"
},
"InstanceType": "m7i.xlarge",
"Monitoring": {
"Enabled": false
}, |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
I am trying to switch from t2.small to c7a.medium/m7a.medium, It throws the same error, but when trying to switch from t2.small to c5a.large, it works fine. And my region is us-east-1. Has anybody found any solution to this? |
Having this issue w/ Terraform, too. Trying to move an autoscaling lauch configuration from
|
I ran into this issue today and couldn't find the solution anywhere. Wish they made the error more clear. For me it was because I was still using AutoScaling Launch configurations instead of launch templates. "EC2 Auto Scaling no longer supports new EC2 features or new EC2 instance types released after December 31, 2022 through launch configurations. We recommended that you use launch templates to create new Auto Scaling groups and migrate any existing launch configurations to launch templates." I use cloud formation so I had to replace my AWS::AutoScaling::LaunchConfiguration resource with an AWS::EC2::LaunchTemplate resource and update my autoscaling group. So not an issue with the cdk, just an issue of trying to create/update a deprecated resource using an instance type newer than 2022. |
Thank you @logrus1 ! I was having this issue using Elastic Beanstalk, which must be using that old style resource in the background. |
Describe the bug
When trying to create an autoscaling group with instance type
m7i.xlarge
and machineImageec2.MachineImage.latestAmazonLinux2023()
I receive the following error:Expected Behavior
The autoscaling group is able to be created with m7i.xlarge
Current Behavior
The autoscaling group fails creation with the above error. Interestingly, this same configuration will work in aws-cdk-lib/ec2 and m6i will work if specified in the autoscaling group, but m7I does not
Reproduction Steps
Create an autoscaling group like so:
Possible Solution
No response
Additional Information/Context
aws-cdk-lib version: 2.115.0
constructs: 10.3.0
CDK CLI Version
2.115
Framework Version
No response
Node.js Version
14.21.3
OS
Amazon Linux
Language
TypeScript
Language Version
Typescript (5.0.4)
Other information
No response
The text was updated successfully, but these errors were encountered: