zappa / Zappa

Serverless Python
https://zappa.ws/zappa
MIT License
3.31k stars 363 forks source link

For Private API, Not able to find option to mention VPC Endpoint Id in Zappa settings JSON file #1024

Closed mrsan22 closed 6 months ago

mrsan22 commented 3 years ago

Context

I am using Zappa to build and deploy a Flask Web application to AWS Lambda and API Gateway. My goal is to create a private API and have the API and Lambda under a VPC.

I am able to find all the related property/attribute that we need (mentioned below in the Zappa settings JSON file) in order to create private API and Lambda function except a way to link VPC Endpoint Id to the API. After deployment, I had to go manually and add it under the API Gateway settings page.

Maybe this is not an issue and the option to provide VPC Endpoint Id is already there and it just me not able to find that option. Can someone pls guide me on this issue here?

I am running Zappa 0.52 and Python 3.7.4 in a virtualenv.

Thanks!

Expected Behavior

Option to provide VPCEndpoint ID in Zappa Settings JSON file related to the API. The VPC Endpoint Id is related to this: AWS Docs

When I provide the VPCEndpoint ID in Zappa Settings JSON file, it should update the API with this VPC Endpoint ID as shown below: Screen Shot 2021-08-10 at 1 37 51 PM

Actual Behavior

This VPC EndPoint ID is left blank.

My Environment

suriya commented 3 years ago

Your question is great. Very well crafted and specifies exactly what the issue is.

The way to provide VPC Endpoint IDs in EndpointConfiguration is specified in the Cloudformation documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-endpointconfiguration.html

Zappa does not set the VpcEndpointIds field of the EndpointConfiguration https://github.com/zappa/Zappa/blob/bb5834fa2f7c31f56cdc39fa883b96f9a99408e3/zappa/core.py#L1812

You will have to modify Zappa source and support it. It does not seem to be too difficult. You can maintain a fork of Zappa with these changes.

Question for Zappa Community. I am not sure who the "active" maintainers are. We are all duplicating effort maintaining different forks. Is there a proper mechanism for us to come together and review these changes and make them a part of Zappa master? I have 3 pull requests over the past 4 years that have never been merged and I keep maintaining them in my own fork. It is work for me to maintain them and neither does the community benefit. This is a lose-lose situation for others and me. I can volunteer time to maintain Zappa and merge the contributions into master.

khuston commented 3 years ago

I also need this, so I will make a pull request shortly that will allow endpoint_configuration to be specified as a dict consistent with the EndpointConfiguration property. It'll have to be backwards compatible with providing the list of endpoint types as endpoint_configuration rather than as the Types property of it.

mrsan22 commented 2 years ago

Thanks for creating a PR for this issue @khuston.

github-actions[bot] commented 7 months ago

Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

github-actions[bot] commented 6 months ago

Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.