-
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
(batch): Batch Compute on Fargate with CfnComputeEnvironment requires instance_role and instance_types #12028
Comments
Confirming this bug. Fields that are not required when selecting Fargate are failing the deployment. To mitigate the issue, we had to fallback to using See https://docs.aws.amazon.com/cdk/latest/guide/cfn_layer.html compute_resources = core.CfnResource(
self,
'RdsBatchCompute',
type='AWS::Batch::ComputeEnvironment',
properties={
'Type': 'Managed',
'ServiceRole': batch_service_role.role_name,
'ComputeResources': {
'Type': 'FARGATE',
'MaxvCpus': 50,
'SecurityGroupIds': ['sg-0b80c5a2090102d9f'],
'Subnets': [
vpc.private_subnets[0].subnet_id
]
}
}
) |
@nagmesh Thanks for reporting this. The underlying problem is that the CloudFormation schema says its required at the same time it says it shouldn't be supplied when using fargate. We will address it. In the meantime, you can remove those two properties: batch_cfn_compute.add_property_deletion_override('ComputeResources.InstanceRole')
batch_cfn_compute.add_property_deletion_override('ComputeResources.InstanceTypes') cc @dsudduth |
Really appreciate the help. Thanks for the workaround! |
Hello,
and still i get:
|
@abdullahodibat You still need to use |
Should be resolved once we merge #12204. |
|
AWS Batch on Fargate does not allow instanceRole and instanceType in the API. However, CDK requires this parameter to be present.
Reproduction Steps
The above will fail on synth/diff
However, if you uncomment instance_Type and instance_role it will deploy but fail at CFN level.
What did you expect to happen?
Allow Fargate task to get created without need for instance_type or instance_role
What actually happened?
CDK stack deployed but failed in CloudFormation console with
An error occurred (ClientException) when calling the CreateComputeEnvironment operation: Error executing request, Exception : instanceRole is not applicable for Fargate.,
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: