内部cloudformation函数怎么来的!当我把它放在我的无服务器api模板的定义体内的Join函数中时,ImportValue不解析为字符串?
这个 Cloud 形态模板:
UserAPI:
Type: 'AWS::Serverless::Api'
Properties:
StageName: !ImportValue StageName
DefinitionBody:
'Fn::Transform':
Name: 'AWS::Include'
Parameters:
Location: !Join [ "", [ "s3://", !ImportValue S3APIBucket, "/api_user.yaml" ] ]
将生成以下错误:
Failed to create the changeset: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state Status: FAILED. Reason: The value of parameter Location under transform Include must resolve to a string, number, boolean or a list of any of these.
但是,如果我将最后一行替换为:
Location: !Join [ "", [ "s3://", !Ref S3APIBucket, "/api_user.yaml" ] ]
并将S3APIBucket作为参数,它工作正常 . 或者不使用!加入并只是硬编码s3存储桶名称,这也可以 .