Score:0

Cannot create aws lambda function. error: the following arguments are required: --runtime, --handler

jp flag

I am trying to deploy an image to be run in aws lambda at a scheduled interval. I have built and tested the image using RIE and locally it runs as it should. Next I have pushed the image to aws ecr to be stored. My next step is to create a aws lambda function and this is where my troubles begin. As per the docs:

If the deployment package is a container image , then you set the package type to Image . For a container image, the code property must include the URI of a container image in the Amazon ECR registry. You do not need to specify the handler and runtime properties.

And when I try to create my lambda function which is:

aws lambda create-function --region <REGION> --function-name tft-image-test \
    --package-type Image  \
    --code ImageUri=<ACCOUNT-ID>.dkr.ecr.<REGION>.amazonaws.com/<REPOSITORY-NAME>:test-image   \
    --role <VALID-ROLE>

I get the following error:

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help
aws: error: the following arguments are required: --runtime, --handler

The exact properties that I was not needed to specify are throwing me an error.

This is my first time using aws services, any help towards resolving this issue is appreciated.

EDIT:

awscli version: 1.18.69

palvarez avatar
ki flag
What CLI version are you using?
ptushev avatar
jp flag
@palvarez I've updated the question
Score:0
ki flag

The usage of containers with Lambda was introduced in CLI version >=2.2.0. You need to update your CLI version in order to make it work.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.