AWS CloudFormation ARN Access Inside Lambda Function

I have two lambda functions Lambda1 and Lambda2. Lambda1 does some work and sends several results to Lambda2 through an SNS topic called Topic1. Lambda2 then processes the results of Lambda1.

Lambda1 -> Topic1 -> Lambda2 

This all works well until I try to create a CloudFormation template that represents it. I can subscribe to Lambda2 on Topic1, but how can I tell Lambda1 what topic SNS needs to push messages to? After the ARN theme is created until the CloudFormation stack is created.

+5
source share
1 answer

You can use a single CloudFormation stack to create this scenario. The outputs of your stack can be used to configure Lambda 1 created on the stack to access Topic 1 , you just need to provide your Lambda cloudformation:DescribeStacks , and then access the outputs of the stack from your Lambda code.

+1
source

Source: https://habr.com/ru/post/1239836/


All Articles