I've got a working API Gateway with a hardcoded Lambda integration deployed using terraform. I want to replace the hardcoded Lambda ARN in the integration with a stage variable, which will open the door to canary usage and better flexibility. This seems to be well aligned with the intent of stage variables.
However when I implement I get a circular dependency I can't seem to break. It looks like:
The stage has the stage variable pointing to the Lambda and:
- Stage needs the deployment ID
- The Deployment needs the Lambda Integration
- The Lambda integration needs the stage
And round and round we go
Yet, as noted, this seems exactly what stage variables are for. Dual deploys won't do, need a seamless one pass deployment.
Has anyone solved this issue?