-
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
aws-cdk/aws-batch: Skip use of optimal instance type with graviton instances #31148
aws-cdk/aws-batch: Skip use of optimal instance type with graviton instances #31148
Comments
@jasonforte Good morning. Thanks for reporting the issue. I was able to reproduce the issue using the provided code, where the error is thrown by CloudFormation:
Here is an excerpt of template generated by CDK synthesis: ...
MyECSComputeEnvironment6A03089C:
Type: AWS::Batch::ComputeEnvironment
Properties:
ComputeResources:
AllocationStrategy: BEST_FIT_PROGRESSIVE
InstanceRole:
Fn::GetAtt:
- MyECSComputeEnvironmentInstanceProfile9F922264
- Arn
InstanceTypes:
- m6g
- optimal
MaxvCpus: 8
MinvCpus: 0
SecurityGroupIds:
- Fn::GetAtt:
- MyECSComputeEnvironmentSecurityGroup7C63B7FD
- GroupId
Subnets:
- subnet-045c5a5af92ce5bf5
- subnet-0552f61c30c94db58
- subnet-0b187fc322e757ab0
Type: EC2
ReplaceComputeEnvironment: false
State: ENABLED
Type: managed
UpdatePolicy: {}
Metadata:
aws:cdk:path: CdktestStack/MyECSComputeEnvironment/Resource
... The reason const vpc = ec2.Vpc.fromLookup(this, 'myVpc', { isDefault: true });
const computeEnvironment = new batch.ManagedEc2EcsComputeEnvironment(this, 'MyECSComputeEnvironment', {
vpc,
minvCpus: 0,
maxvCpus: 8,
instanceClasses: [ec2.InstanceClass.M6G],
useOptimalInstanceClasses: false
}); I'm unsure if it would be feasibly to check for instance type based on used instance class since it is an enum which gets updated as new instance classes are supported by EC2 service. Thanks, |
We probably could improve:
aws-cdk/packages/aws-cdk-lib/aws-batch/lib/managed-compute-environment.ts Lines 1134 to 1148 in 975df1f
|
Comments on closed issues and PRs are hard for our team to see. |
1 similar comment
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
I'm attempting to create an EC2 ECS compute environment using the AWS Batch constructs that makes use of only Graviton instances. When I deploy the stack I get the following error:
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
When encountering a know arm-based instance class, the construct should not append
optimal
as it's not supported for arm based instancesCurrent Behavior
When deploying a EC2 ECS Compute Environment, the error below is thrown.
Reproduction Steps
I'm declaring my compute environment as follows:
When deploying there is an error:
Possible Solution
When I inspect the synthesized CloudFormation Stack I can see that
optimal
has been appended to theInstanceTypes
list:Possible solution would be to fix logic in renderInstances to take into account the types of instances (Arm vs AMD).
Additional Information/Context
Workaround
I've found workaround by setting the
useOptimalInstanceClasses
tofalse
but this is not expected behavior because I've explicitly set the types of instances I want.CDK CLI Version
2.152.0 (build faa7d79)
Framework Version
No response
Node.js Version
v20.14.0
OS
ubuntu
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: