-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved deployments #295
Comments
@ofhouse Hello! I've yet to try this awesome TF module however I'm just wondering about what you're suggesting with API Gateway and the future of it here. I'm designing a multi-tenant app in NextJS which can then be deployed into AWS using this module. The Tenant ID is take from the Domain and each tenant has a separate database Reading AWS's https://aws.amazon.com/blogs/apn/building-a-multi-tenant-saas-solution-using-aws-serverless-services/#:~:text=API%20Authorization%20and%20Tenant%20Isolation guide on SaaS solutions and multi-tenancy, it looks like they've written up how to achieve good tenant isolation by using an API Gateway Lambda Authoriser to set the context of the tenant and return a dynamic IAM policy based on this. So for instance I could return a set of temporary credentials from the Lambda Authoriser which the 'NextJS API Lambda' from this module could use to safely talk to a database and ensure good tenant isolation. This would mean that the developers cannot make a mistake and accidentally cross tenant domains in code. I think this is all only possible to achieve through keeping the API Gateway in place? I haven't tried this yet but I would like to somehow after deploying this module attach this Lambda Authoriser to the newly created API Gateway and achieve this setup. I'm not sure if this is possible without implementing inside the module an API Gateway ID as output so I can then attach something? I think there could be a good benefit to having the option of either using API Gateway or the Function URL as an option. To sum up what I would like to try achieve:
Thanks for this module , I look forward to using it! |
@Foralux Thanks for the input! Regarding the future of API Gateway in this project React 18 and the introduction of streaming SSR responses are another point why I think that function URLs will play an important role in the future. Regarding your plans
Could be possible when offering different CDK templates as explained above.
This is out of scope of the project, but can be archived by modifying the CloudFront distribution which allows to add more Lambda@Edge functions to the flow.
This is already built into this module, since we already use origin access identity.
Already looked into this (#27), but currently requires to sign each request in in the Lambda@Edge before forwarding it to API Gateway. Decided against it, since the risk of guessing the endpoint is minimal and would increase latency. |
RFC has now landed in the main branch. |
This is the groundwork to finally enable multiple deployments, but the goal of this issue is not to enable multiple deployments
Motivation
Deployments are currently handled by using a mix of CLI and Terraform.
Running
terraform apply
for every deployment is considered as a problematic.Infrastructure is mostly managed by IT departments (With Terraform) while deployments are managed by developers.
So for larger teams this could lead to responsibility issues.
Idea
Implementation
This has already been tested: playground-cdk-cloudformation
Further ideas
With the introduction of Function URLs the usage of API Gateway becomes obsolte.
Advantages:
Related issues
tf-next build
#245The text was updated successfully, but these errors were encountered: