Specify ImageUri in AWS::Lambda::Function throws CF error

Viewed 662

For some reason I'm unable to figure out why this is going wrong.

I've created a public ECR repository and I try to refer the image as ImageUri under the Code block in my AWS::Lambda::Function.

  SlackNotifierFunction:
    Type: AWS::Lambda::Function
    Properties:
      FunctionName: !Join ["-", [!Ref Name, "slack", "notifier"]]
      Role: !GetAtt LambdaRole.Arn
      Code:
        ImageUri: public.ecr.aws/g9c9m7n7/aws-cost-anomaly-slack-notifier:latest
      Timeout: 1
      MemorySize: 128
      PackageType: Image
      Architectures: ["arm64"]
      Environment:
        Variables:
          LOG_LEVEL: INFO
          SLACK_TOKEN: !Ref SlackToken
          SLACK_CHANNEL: !Ref SlackChannel

CloudFormation throws the following error whilst creating the Lambda function.

Resource handler returned message: "Source image public.ecr.aws/g9c9m7n7/aws-cost-anomaly-slack-notifier:latest is not valid. Provide a valid source image. (Service: Lambda, Status Code: 400, Request ID: 9150921d-4b35-44ae-a4eb-c137f2a779e9, Extended Request ID: null)" (RequestToken: 616bb226-a46b-faf1-c959-aad09880b137, HandlerErrorCode: InvalidRequest)

Here's the ECR public gallery link: https://gallery.ecr.aws/g9c9m7n7/aws-cost-anomaly-slack-notifier

1 Answers

It seems like providing an image uri referring to a public ECR gallery hosted image is not possible as of today.

Related