milliHQ / terraform-aws-next-js

Terraform module for building and deploying Next.js apps to AWS. Supports SSR (Lambda), Static (S3) and API (Lambda) pages.
https://registry.terraform.io/modules/milliHQ/next-js/aws
Apache License 2.0
1.47k stars 151 forks source link

Fix: functions name when basePath is setup #345

Open framled opened 2 years ago

framled commented 2 years ago

Terraform failed when basePath is set, this is because lambda functions name can not have a special character.

issues related to this are #288 #310

ofhouse commented 2 years ago

Hey, thanks for submitting this PR. Unfortunately the target branch you selected (release-v0.x) is managed by our CI system and not meant for opening PRs against it. You need to rebase your changes to the v0.x branch instead. I've already changed the target branch, you need to rebase/cherry-pick and force push your commits to make it work.

If it's too confusing, please allow me to make the necessary changes, by Enabling repository maintainer permissions on existing pull requests.

framled commented 2 years ago

Hi @ofhouse I've already rebase and cherry pick... reigncl/v0.x branch is already up to date... But I didn´t find the option in the PR... :/

I've just create a new PR #351, that is ok?

sumantapakira commented 2 years ago

Hi @framled I think this is not about only the fixing the Lambda function name, it also requires the change in proxy. Have you got success to test end to end flow only by changing Lambda function name?

framled commented 2 years ago

@sumantapakira Yes it works

sumantapakira commented 2 years ago

ok, but with your change when I tried to create new infra then it fails -

Error: error putting S3 Bucket Notification Configuration: InvalidArgument: Unable to validate the following destination configurations status code: 400, request id: 0Y96VW1JYZT35NNG, host id: 6LM/nRmfUTxNLAMrJAqjHEjkPUhtD0FxIthh5qkFcwWgGTAQ2EJ/6k1oAq2RdKfGWtnGJgq354o=

with module.tf_next.module.statics_deploy.aws_s3_bucket_notification.on_create, on ../original_source/modules/statics-deploy/main.tf line 31, in resource "aws_s3_bucket_notification" "on_create": 31: resource "aws_s3_bucket_notification" "on_create" {