简体   繁体   English

从 cloudformation 堆栈中检索 lambda 函数的 arn

[英]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.

相关问题 从Lambda函数内部访问AWS CloudFormation ARN - Access AWS CloudFormation ARN from inside Lambda Function 定义 cloudFormation 脚本时,无法从 lambda function 中的环境访问 SNS_TOPIC_ARN 值 - Unable to get access to SNS_TOPIC_ARN value from environment in lambda function when defining a cloudFormation script 通过 API 从不同的 cloudformation 堆栈调用 lambda 函数 - Call lambda function from a different cloudformation stack via API 在 CloudFormation 堆栈删除上执行 Lambda Function - Execute Lambda Function on CloudFormation Stack delete 在 Cloudformation 模板中,如何在 IoT 规则中引用动态生成的 Lambda function ARN? - In a Cloudformation template, how do I reference a dynamically generated Lambda function ARN in an IoT Rule? 从 Lambda function 中更新 CloudFormation 堆栈的正确方法是什么? - What's the right way to update a CloudFormation stack from within a Lambda function? 如何在堆栈中存储和重用来自 CloudFormation 自定义资源 Lambda function 的响应数据? - How to store & reuse response data from a CloudFormation Custom Resource Lambda function within the stack? 如何使用一个CloudFormation堆栈中的SQS队列作为另一CloudFormation堆栈中的lambda函数的触发器? - How do I use an SQS queue in one CloudFormation stack as a trigger to a lambda function in another CloudFormation stack? CloudFormation !Select with !Split function with load balancer arn - CloudFormation !Select with !Split function with load balancer arn 创建Cloudformation堆栈后触发计划的Lambda函数 - Fire scheduled lambda function after cloudformation stack creation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM