I ran into a following requirement where I need to pass Terraform outputs or Terraform dynamically created resource ids as environment variables to the Lambda function which is in the same terraform template.
My terraform creates bunch of resources such as Lambda Functions, API Gateways, gateway Methods, gateway resources etc.. I need to send the API Gateway resource id as an environment variable to the Lambda function. Unfortunately I can not put "Depends on " in the Lambda function because it is create cycle dependency.
Anyway we can pass these dynamically created resource ids as input environment variables to lambda function?
Thanks