user2761217
user2761217

Reputation: 25

How to expose ARN of resource created by the Serverless Framework to Terraform

We are planning to use the Serverless framework to create AWS lambda functions, and Terraform to provision other infrastructure in AWS. We use SSM parameters to get access in Serverless to resources created by Terraform.

However, I am wondering: is there any way to access in Terraform resources created by Serverless? The use case is as follows: in terraform we need to give explicit bucket permissions for a lambda created in Serverless. At the moment we need to hard code the ARN of the lambda. Is there any way to avoid that?

Upvotes: 1

Views: 707

Answers (1)

rkm
rkm

Reputation: 3141

Serverless uses CloudFormation under the hood and there is no direct way to share data between CloudFormation and terraform. Most common way is to use SSM to share data in both directions, so I think you are on the right track (you can use data source to fetch value from SSM).

There is an overview how to use Serverless framework with terraform in this blog post

Upvotes: 0

Related Questions