fix(batch): support repository credentials for private registries#37017
fix(batch): support repository credentials for private registries#37017matoom-nomu wants to merge 2 commits intoaws:mainfrom
Conversation
|
Exemption Request Unit test verify cfn template has |
There was a problem hiding this comment.
Ty!
#37017 (comment) It would be nice to have integration test coverage for the scenario.
| return { | ||
| image: this.imageConfig.imageName, | ||
| repositoryCredentials: this.imageConfig.repositoryCredentials ? { | ||
| credentialsParameter: this.imageConfig.repositoryCredentials.credentialsParameter!, |
There was a problem hiding this comment.
Since credentialsParameter is required if repositoryCredentials is set (docs), I'd add validation to verify such requirement to prevent unhandled exceptions.
There was a problem hiding this comment.
Thanks for the review!
I added validation to the constructor.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
|
||||||||||||||
|
|
||||||||||||||
I added integ-test and confirmed Credential is properly set in jobdfefinition cfn. |
Issue
Closes #37003
Reason for this change
AWS Batch ECS container definitions do not support repository credentials for pulling images from private registries other than ECR. The
credentialsparameter passed toContainerImage.fromRegistry()is currently ignored.Description of changes
I modified
EcsContainerDefinitionBase._renderContainerDefinition()to includerepositoryCredentialsproperty in the CloudFormation templateDescribe any new or updated permissions being added
None
Description of how you validated changes
Add unit test
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license