[英]Retrieve the arn of a lambda function from a cloudformation stack
I was wondering if there is a way to retrieve lambda function metadata during the cloudformation stack creation?我想知道是否有办法在创建 cloudformation 堆栈期间检索 lambda 函数元数据? We are looking to use the lambda function ARN to further build out other parts of the cloudformation template by storing it in an env variable.
我们希望使用 lambda 函数 ARN 通过将其存储在 env 变量中来进一步构建 cloudformation 模板的其他部分。
Is this even possible?这甚至可能吗? How do others reference arn when they are unknown until stack creation?
其他人在创建堆栈之前未知时如何引用 arn?
ed编辑
You can use the intrinsic functions , specifically Fn::GetAtt
to get the lambda function's arn.您可以使用内部函数,特别是
Fn::GetAtt
来获取 lambda 函数的 arn。
See: Fn::GetAtt - AWS CloudFormation请参阅: Fn::GetAtt - AWS CloudFormation
As per this cheatsheet , you would use the following:根据此备忘单,您将使用以下内容:
json json
"MyFieldName": "Fn::GetAtt": ["MyLambdaFunc","Arn"]
yaml雅姆
MyFieldName: !GetAtt MyLambdaFunc.Arn
您能否提供上述情况的工作示例
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.