feat(batch): add consumableResourceProperties to job definitions#35827
feat(batch): add consumableResourceProperties to job definitions#35827matoom-nomu wants to merge 5 commits intoaws:mainfrom
Conversation
…at/add-consumableResourceProperties-support
| }, | ||
| consumableResourceProperties: baseJobDefinition.consumableResourceProperties ? { | ||
| consumableResourceList: baseJobDefinition.consumableResourceProperties.consumableResourceList.map(req => ({ | ||
| consumableResource: req.consumableResource, |
There was a problem hiding this comment.
The property definition (docs) requires that this resource must match a pattern: arn:[a-z0-9-\.]{1,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:[^/].{0,1023}
There was a problem hiding this comment.
Thanks for review.
Sounds I'd prefer to make consumableResource L2 construct and pass IConsumableResource to job-definition, I'll make another PR to create consumableResource L2 construct first.
There was a problem hiding this comment.
Thanks for review. Sounds I'd prefer to make consumableResource L2 construct and pass
IConsumableResourceto job-definition, I'll make another PR to create consumableResource L2 construct first.
↑ I made PR about this.
#36971 feat(batch): add ConsumableResource L2 construct
| consumableResourceProperties: baseJobDefinition.consumableResourceProperties ? { | ||
| consumableResourceList: baseJobDefinition.consumableResourceProperties.consumableResourceList.map(req => ({ | ||
| consumableResource: req.consumableResource, | ||
| quantity: req.quantity, |
There was a problem hiding this comment.
This needs token resolution validation + input validation to ensure the quantity is > 0
if (!Token.isUnresolved(req.quantity)) {
if (req.quantity <= 0 || !Number.isInteger(req.quantity)) {
throw new Error(
`Consumable resource at index ${index} must have a positive integer quantity, got: ${req.quantity}`
);
}
}
|
The what's new post says
I don't see this limit specified in the service quotas though. Is it possible to create a job with more than 5 consumable resources locally and check if it succeeds? If the limit is 5, the CDK code should add this validation. |
i confirmed CR configuration is limited to 5 per job definition in the management console. |
|
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing To prevent automatic closure:
This PR will automatically close in 14 days if no action is taken. |
|
This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue None
Reason for this change
AWS Batch Job Definitions now support Consumable Resource Properties, which allow jobs to specify and consume shared resources like software licenses or API call quotas. This feature was missing from the CDK construct library.
Description of changes
Describe any new or updated permissions being added
None
Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license