aws-cloudformation / community-registry-extensions

MIT No Attribution
86 stars 27 forks source link

VPC Bridge Lambda Resource #111

Open ericzbeard opened 1 year ago

ericzbeard commented 1 year ago

A limitation of resource types is that they cannot talk to a VPC, since the handler is not running in the same account as the deployed resources. I'd like to explore the idea of a resource design where we install a Lambda "locally" in the same account to act as a bridge to VPC resources. This would require an RPC mechanism to allow the handler to communicate with the local VPC lambda.

benbridts commented 1 year ago

The "invent-and-simplify" way to do this, is by having an ENI in each customers account (which might need big changes on the AWS side).

Either way this is solved, we should try to avoid creating a (lambda) bridge for every resource or stack (this re-introduces some lambda-backed custom resource problems). Maybe the bridge is create before out of band?

Other things beside lambda that can attach to a VPC:

ericzbeard commented 1 year ago

If we do this out of band, having a single bridge that could be used by many resources, how would we implement that in a generic way? One use case is a resource that allows you to create a database schema from a template, without relying on the data API. It would need to connect to an RDS instance using the native connector, which would need to be installed as part of the bridge.

Agree on the ENI solution, but that's a design change that will take significant time, so an interim workaround here might benefit customers who don't want to wait.

benbridts commented 1 year ago

If we do this out of band, having a single bridge that could be used by many resources, how would we implement that in a generic way? One use case is a resource that allows you to create a database schema from a template, without relying on the data API. It would need to connect to an RDS instance using the native connector, which would need to be installed as part of the bridge.

I would do it like this:

When you need to create a schema, you have the option to: