Error while deploying Function from ECR Image

Hi All,

I am trying to deploy a function using a container image from ECR and I understand this is a new feature to the framework. I am attempting to construct the ImageURI from variables in my serverless.yml file, but it doesn’t seem to be working. Here is the section of the yml file for the function:

functions:
  <function_name>:
    image:
      - !Join
        - "."
        - - !Ref AWS::AccountId
          - "dkr.ecr"
          - !Ref AWS::Region
          - "amazonaws.com/<repository_name>@<digest>"
    events:
      - http:
          method: post
          path: /<endpoint>
          cors: true
    role: <role_name>

However, I receive this error when I try to deploy:

TypeError: image.split is not a function

I am able to deploy successfully when I hard-code whole thing as a single string, but not when I use a Join. Is this something I am doing wrong or is there a bug with this new feature?

Thank you!

Hello @jahorwitz,

at the moment it’s not possible to define images with CF functions, you have to supply already resolved uri. If you feel like it would be useful to support such use cases, please create a proposal here: Issues · serverless/serverless · GitHub

Best,
Piotr