Issue #1 resolved
Justin Abrahms
created an issue


I attempted to create a lambda with this service, but it complained about missing IAM permissions. I didn't see an IAM port listed for configuring those permissions. Perhaps I'm missing something about how to configure IAM roles?

Thanks, -justin

Comments (9)

  1. Waldemar Hummer


    Can you pull the latest version of LocalStack and then try this:

    • Create a file with the following content:
    def handler(event, context):
        return {'foo': 'bar'}
    • Create a Lambda zip file and upload it to the LocalStack API on localhost:4574:
    aws --endpoint-url=http://localhost:4574 lambda create-function --function-name=f1 --runtime=python2.7 --role=r1 --handler=lambda.handler --zip-file fileb://
    • Execute the Lambda function:
    aws lambda --endpoint-url=http://localhost:4574 invoke --function-name f1 result.log

    Then you should see the following:

    1. The aws command line prints a 200 status code message
    2. The terminal in which you have LocalStack running prints "test"
    3. A file results.log gets created with the return value of the Lambda function

    Please note that currently only Lambdas written in Python are supported.

  2. Adam White

    @w_hummer The code worked for me, but it broke the web interface.

    Is python currently the only available Lambda runtime? My attempt with nodejs43 only ended in failure. :(

  3. Waldemar Hummer

    Fixed the Lambda UI issue in this PR: The version hasn't been bumped yet, though. Will bump the version and push a new Docker image soon (probably tomorrow).

    @Adam White Unfortunately, Python is currently the only supported runtime. There has been a proposal here to use a Docker runtime environment that supports different languages: It is currently not high up in the priority list on our end, but if you get a chance to look into this - a pull request would be highly appreciated!

  4. Justin Abrahms reporter

    Confirmed that I now get a non-IAM oriented error. :) I have another error which is that "handler" is a hardcoded value for my function, which I've named lambda_handler in my code. I can just edit the source code to make this work on my end. Unfortunately, corporate OSS guidelines mean it will be unlikely I can contribute a fix for this.

  5. rsrestha


    I was trying to run a lambda on localstack.

    But when I enter the following command:

    aws --endpoint-url=http://localhost:4574 lambda create-function --function-name=f1 --runtime=python2.7 --role=r1 --handler=lambda.handler --zip-file fileb://

    (For uploading the lambda)

    It prompts the following: Unable to locate credentials. You can configure credentials by running "aws configure".

  6. Trung Ly

    @w_hummer Your sample is neat and straight forward. Everything looks good to me expect test isnt printed out in console. do you have any ideas?

  7. Log in to comment