在 AWS::Lambda::Function 中指定 ImageUri 会引发 CF 错误

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

出于某种原因,我无法弄清楚为什么会出错。

我创建了一个 public ECR 存储库,我尝试在我的 AWS::Lambda::Function.[=16= 中的 Code 块下将图像引用为 ImageUri ]

  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 在创建 Lambda 函数时抛出以下错误。

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)

这是 ECR public 图库 link:https://gallery.ecr.aws/g9c9m7n7/aws-cost-anomaly-slack-notifier

从今天开始,似乎无法提供引用 public ECR 画廊托管图像的图像 uri。