feat: Add support for task and execution role ARNs in action.yml and …#293
feat: Add support for task and execution role ARNs in action.yml and …#293DMEvanCT wants to merge 6 commits intoaws-actions:masterfrom
Conversation
|
Hi @DMEvanCT, thank you so much for your contribution. Apologies on the delay. We will be working on reviewing Pull Requests on the repositories. In the mean time please ensure that below steps, if not already done, are taken care of in your PR:
|
| } | ||
| containerDef.image = imageURI; | ||
|
|
||
|
|
There was a problem hiding this comment.
nit: could you remove unnecessary whitespace?
| const command = core.getInput('command', { required: false }); | ||
| const taskRoleArn = core.getInput('task-role-arn', { required: false }); | ||
| const executionRoleArn = core.getInput('execution-role-arn', { required: false }); | ||
|
|
There was a problem hiding this comment.
nit: could you remove unnecessary whitespace?
| description: 'The ARN of the IAM role that the ECS container will assume' | ||
| required: false | ||
| execution-role-arn: | ||
| description: 'The ARN of the IAM role that the ECS task execution role will assume' |
There was a problem hiding this comment.
This description can be made more explicit, as it could confuse some users since it's self-referencing.
Suggested reword: 'The ARN of the IAM role that the task definition will assume to run the task'
| } | ||
|
|
||
| if (taskRoleArn) { | ||
| taskDefContents.taskRoleArn = taskRoleArn; |
There was a problem hiding this comment.
Can we add a regex validation for the arn? Need appropriate unit tests as well for these changes.
There was a problem hiding this comment.
ECS actually allows name-only format (if the role is in the same account as the task definition), and we rely on that to deploy the same task definition across multiple accounts.
| taskDefContents.taskRoleArn = taskRoleArn; | ||
| } | ||
|
|
||
| if (executionRoleArn) { |
There was a problem hiding this comment.
Can we add a regex validation for the arn? Need appropriate unit tests as well for these changes.
There was a problem hiding this comment.
ECS actually allows name-only format (if the role is in the same account as the task definition), and we rely on that to deploy the same task definition across multiple accounts.
…index.js
Issue #, if available:
Description of changes:
Adding the ability to do set task role arn and the execution role arn. This may be different from account to account so setting it would provide a little flexibility.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.