gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 07:12:15 25 4
gpt4 key购买 nike

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

这是我的template.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

我不确定是否使用 !Sub!Ref

最佳答案

所以基本上你可以从AWS::Serverless::Function返回两件事

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

  customresourceoutput:
Value:
!Ref creates3bucketlambda -> name of lambda function

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

如果您对 AWS::CloudFormation::CustomResource 感兴趣,还有 documentation为此。

您可以使用Fn::GetAtt,例如:

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

关于amazon-web-services - AWS CloudFormation,自定义资源的输出值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51351764/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com