CloudFormation GetObject 错误。 S3 错误代码:NoSuchKey

问题描述 投票:0回答:1

我遇到 CloudFormation 问题,无法在我的 S3 存储桶中找到该对象。

GetObject. S3 Error Code: NoSuchKey
真正的问题是我不知道它试图找到什么键。我正在从 Parameter Store 读取部署文件夹,并尝试加入我的模板中的路径,如图所示。

SubscriptionApiVersonedPath:
Type: AWS::SSM::Parameter::Value<String>
Default: /
Description: The path of the versioned folder where the lambda zip files will be written


SubscriptionHealthCheckLambdaFunction:
  Type: AWS::Lambda::Function
  Properties:
    FunctionName: subscription-health-check
    Code: 
      S3Bucket: "bwotn-deployment-pipeline"
      S3Key: !Join [ delimiter, [ !Ref SubscriptionApiVersonedPath, "/subscription-health-check.zip" ] ]
    Runtime: nodejs18.x
    Handler: index.handler

我相信模板正在成功读取参数值,但我不知道如何确定。我也不确定这个 !Join 声明是否正确。

amazon-web-services amazon-s3 aws-cloudformation
1个回答
0
投票

这对我来说是一个愚蠢的错误。 “分隔符”一词不属于

!Join
语句。这应该是字面上的分隔符。 “/”用于连接字符串

© www.soinside.com 2019 - 2024. All rights reserved.