Amazon web services AWS CloudFormation,自定义资源的输出值

Amazon web services AWS CloudFormation,自定义资源的输出值,amazon-web-services,amazon-cloudformation,Amazon Web Services,Amazon Cloudformation,我想输出从CloudFormation自定义资源中获得的值。我肯定会返回值,但我不确定如何在输出中引用它 这是我的模板。yml: Outputs: customresourceoutput: Value: !GetAtt creates3bucketlambda.myvalue Resources: creates3bucketlambda: Type: AWS::Serverless::Function Properties: Hand

我想输出从CloudFormation自定义资源中获得的值。我肯定会返回值,但我不确定如何在输出中引用它

这是我的
模板。yml

Outputs:
  customresourceoutput:
    Value:
      !GetAtt creates3bucketlambda.myvalue

Resources:
  creates3bucketlambda:
    Type: AWS::Serverless::Function
    Properties:
      Handler: index.handler
      Runtime: nodejs6.10
      CodeUri: setups3bucket
      MemorySize: 512
      Timeout: 300
      Policies:
        - AWSLambdaBasicExecutionRole
        - AmazonS3FullAccess

  Creates3BucketLoginPage:
    Type: Custom::AppConfiguration
    Properties:
      ServiceToken: !GetAtt creates3bucketlambda.Arn
      aOrg:
        !Ref aOrg
我得到的错误是:

Failed to create the changeset: Waiter 
ChangeSetCreateComplete failed: Waiter encountered a terminal failure 
state Status: FAILED. Reason: Template error: resource 
creates3bucketlambda does not support attribute type myvalue in 
Fn::GetAtt

我不确定我是否使用了
!子
!Ref

因此基本上您可以从
AWS::Serverless::函数中返回两个内容

  customresourceoutput:
    Value:
      !GetAtt creates3bucketlambda.Arn -> arn of lambda function

有关无服务器函数输出的更多详细信息

如果您对AWS::CloudFormation::CustomResource感兴趣,还有一个解决方案

您可以像这样使用
Fn::GetAtt

  customresourceoutput:
    Value:
      !GetAtt customerResource.responseKeyName -> name of the key from the response

这不是自定义资源。这是一个SAM函数。“使用
AWS::CloudFormation::CustomResource
Custom::*String*
资源类型在模板中定义自定义资源。”是的,我无意中遗漏了自定义资源。很抱歉。好吧,我想出来了,我需要引用自定义资源,这将返回我想要的值。。。值:!GetAtt Creates3BucketLoginPage.keyHi,在哪里可以在日志中找到lambda支持的自定义资源??Hi@ColossusMark1的响应键。您如何运行您的cloudformation?在cloudforemation向导上运行,我找到了responsekey,它位于lambda响应:D再次感谢
  customresourceoutput:
    Value:
      !GetAtt customerResource.responseKeyName -> name of the key from the response