Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix: add sagemaker:AddTags to sfn execute role (#1206)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxkane authored Apr 18, 2023
1 parent c4944ad commit cb2ce46
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/lib/training-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,27 @@ export class TrainingStack extends NestedStack {
tracingEnabled: true,
});

pipeline.role.addToPrincipalPolicy(new PolicyStatement({
actions: ['sagemaker:AddTags'],
resources: [
Arn.format({
service: 'sagemaker',
resource: 'training-job',
resourceName: 'fraud-detection-model-*',
}, Stack.of(this)),
Arn.format({
service: 'sagemaker',
resource: 'model',
resourceName: 'fraud-detection-model-*',
}, Stack.of(this)),
Arn.format({
service: 'sagemaker',
resource: 'endpoint',
resourceName: this.endpointName,
}, Stack.of(this)),
],
}));

(pipeline.role.node.findChild('DefaultPolicy').node.defaultChild as CfnResource)
.addMetadata('cfn_nag', {
rules_to_suppress: [
Expand Down

0 comments on commit cb2ce46

Please sign in to comment.