0

I've been trying to deploy and AWS CDK stack that builds a SageMaker Pipeline with Lambda step, however I keep getting "Invalid request provided: Step[xyz]: Lambda function ARN cannot be null.

No matter what I do I can't get CDK and CloudFormation to work with the SDK. I've read this might be an issues specifically with Lambda Steps in SageMaker Pipelines, is this true?

3
  • 1st create lambda func and then refer.. it would be good if you post a question with tried code here Commented May 28 at 3:30
  • @AshishKamble that doesn’t work. I’m really trying to see if anyone here has ever successfully deployed a lambda step within Sagwmaker pipelines via cdk. Commented May 29 at 10:29
  • +1 to the above, can you post the sample code snippet? How are you creating the Lambda function? is that through CDK/CFN? where does the SDK come into play - are you using it to define the pipeline and CFN to deploy it? Commented Jun 5 at 19:18

1 Answer 1

0

I struggled with the same problem for a good part of a workday. You don't give any insights, but I'll post what worked for me in case it can help other people with a similar issue.

"Invalid request provided: Step[xyz]: Lambda function ARN cannot be null.

Most likely, you are not defining the property FunctionArn in your step. According to the documentation, FunctionArn is required.

I have successfully deployed a SageMaker pipeline with Lambda. My pipeline is very basic, and includes 2 steps:

  1. Registering a model (Type: RegisterModel)

  2. Approve model (Type: Lambda)

Step 2 depends on step 1. Concretely, I need the Model Package Arn of the model registered in step 1. Thus, in step 2 I define Arguments.

const pipelineDefinition = {
    Version: '2020-12-01',
    Parameters: {
       ...
    },
    Steps: [
        {
            Name: 'RegisterMyModel',
            Type: 'RegisterModel',
            Arguments: {
                ...
            },
        },
        {
            Name: 'ApproveMyModel',
            Type: 'Lambda',
            DependsOn: ['RegisterMyModel'], // Note that this must be an array
            FunctionArn: myfunction.functionArn, // This is what you are potentially missing
            Arguments: {
                'model_package_arn': { 'Get': 'Steps.RegisterMyModel.ModelPackageArn'}
            }
        }
    ]
};

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.