Skip to content

aws-stepfunctions-tasks: state machine role is missing sagemaker:AddTags permission for SageMakerCreateTrainingJob task #32294

@historyandfun

Description

@historyandfun

Describe the bug

When a step function trigger a sagemaker training job, the step function fails with error is not authorized to perform: sagemaker:AddTags on resource: arn:aws:sagemaker:us-east-1:xxxx:training-job/xxxx because no identity-based policy allows the sagemaker:AddTags action. It could be a similar issue as #26012.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

If the permission is required, the step function should generate role with permission sagemaker:AddTags.

Current Behavior

The generated step function role for SageMakerCreateTrainingJob misses permission sagemaker:AddTags.

Reproduction Steps

const smStep = new tasks.SageMakerCreateTrainingJob(this, 'xxx', {
         integrationPattern: IntegrationPattern.RUN_JOB,
         ....
}

const stateMachine = new sfn.StateMachine(this, 'satemachine', {
            definition: smStep.next(xxx),
            ...
}

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.121.0

Framework Version

No response

Node.js Version

18

OS

linux

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions