-
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
fix(stepfunctions-tasks): state machine role is missing sagemaker:AddTags permission for SageMakerCreateTransformJob task #27264
Conversation
…:AddTags permission for SageMakerCreateTransformJob task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Exemption Request: There is no change against existing snapshots. Also, this is a small fix, so I didn't add a new integ test at this point. Please let me know if it's needed. |
@tam0ri I believe an integ test here would be useful. |
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks (and sorry for the late review) 👍
Looks good, just some minor adjustments are needed.
); | ||
policyStatements.push( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
); | |
policyStatements.push( |
A single push
call can be used for both statements.
@@ -306,3 +308,215 @@ test('create transform job with instance type supplied as JsonPath', () => { | |||
}, | |||
}); | |||
}); | |||
|
|||
test('required permmisions are granted to service role if RUN_JOB is supplied as service integration pattern', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test('required permmisions are granted to service role if RUN_JOB is supplied as service integration pattern', () => { | |
test('required permissions are granted to service role if RUN_JOB is supplied as service integration pattern', () => { |
}); | ||
}); | ||
|
||
test('required permmisions are granted to service role if REQUEST_RESPONSE is supplied as service integration pattern', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test('required permmisions are granted to service role if REQUEST_RESPONSE is supplied as service integration pattern', () => { | |
test('required permissions are granted to service role if REQUEST_RESPONSE is supplied as service integration pattern', () => { |
super(scope, id, props); | ||
const batch_inference_job = new SageMakerCreateTransformJob(this, 'Batch Inference', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super(scope, id, props); | |
const batch_inference_job = new SageMakerCreateTransformJob(this, 'Batch Inference', { | |
super(scope, id, props); | |
const task = new SageMakerCreateTransformJob(this, 'BatchInferenceTask', { |
}); | ||
|
||
new StateMachine(this, 'SimpleStateMachine', { | ||
definitionBody: DefinitionBody.fromChainable(batch_inference_job), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitionBody: DefinitionBody.fromChainable(batch_inference_job), | |
definitionBody: DefinitionBody.fromChainable(task), |
@lpizzinidev Thank you for your review! I pushed changes according to your comment. Could you review when you have some time? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks 👍
Signed-off-by: Vinayak Kukreja <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @tam0ri , apologies for the delay. Thank you for contributing to AWS CDK.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
If we specified RUN_JOB as IntegrationPattern prop for SageMakerCreateTransformJob construct, StepFunctions executes SageMaker batch transform job synchronously. In this case, StepFunctions add a tag (key: MANAGED_BY_AWS, value: STARTED_BY_STEP_FUNCTIONS) to the job, so state machine role needs the permission to do that. However, currently CDK does not add the permission automatically.
This PR solves the issue by adding
sagemaker:AddTags
permission to state machine role when RUN_JOB is specified as IntegrationPattern prop.Closes #26012
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license