cloudformation-cli icon indicating copy to clipboard operation
cloudformation-cli copied to clipboard

Document how to access Vpc resources

Open serverhorror opened this issue 4 years ago • 0 comments

I'm working on a provider that will require access to resources within a VPC.

The current case is that I have an RDS database within a private VPC. I can create and register the resource provider and it tries to execute the code correctly. Because the Lambda from the provider can not run in a specific VPC (or can it?) it fails miserably:

Exception caught could not connect to server: Connection timed out
	Is the server running on host "rds-endpoint.example.com" (192.0.2.1) and accepting
	TCP/IP connections on port 5432?
Traceback (most recent call last):
  File "/var/task/cloudformation_cli_python_lib/resource.py", line 210, in __call__
    raise error
  File "/var/task/cloudformation_cli_python_lib/resource.py", line 203, in __call__
    progress = self._invoke_handler(caller_sess, request, action, callback)
  File "/var/task/cloudformation_cli_python_lib/resource.py", line 84, in _invoke_handler
    progress = handler(session, request, callback_context)
  File "/var/task/boehringer_rds_database/handlers.py", line 70, in create_handler
    region=request.region,
  File "/var/task/boehringer_rds_database/db.py", line 37, in create
    host=endpointAddress, port=endpointPort, database="postgres", user=user, password=password, sslmode="require"
  File "/var/task/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: Connection timed out
	Is the server running on host "rds-endpoint.example.com" (192.0.2.1) and accepting
	TCP/IP connections on port 5432?

Document a way how to create a resource provider that has access to VPC resources.

serverhorror avatar Sep 29 '21 15:09 serverhorror