-
Notifications
You must be signed in to change notification settings - Fork 232
No base path mapping is being set #57
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
Comments
Are you able to deploy endpoints normally without a base path? I haven't played much with the base path configuration but I'll take a look at it later when I get the chance. |
Yep! Using the regular API gateway random URL works properly. Handler setup is here: functions:
redirect:
handler: handler.redirect
events:
- http:
path: /
method: get
- http:
path: /{proxy+}
method: get
- schedule: rate(10 minutes) Thanks again. As I said, it's not urgent because I can just set it manually for now. But let me know what else I can provide! |
Hey @mrw, I'm unable to reproduce this error, the basePath seems to be configuring correctly when I create the domain. Could you provide the output of Two things that come to mind to check: The base path must be set when the domain is created, it can't be changed on deploy, and also your internal routing for the API must be aware of the base path as well. For example, setting the basePath in both the plugin configuration and the swagger file. |
To add to the above, if I set I guess the confusing thing here is that if you manually create base path mapping, you can set it to be empty. If you set |
One more update and then I'll see if I can't find the source of the problem and hopefully open a PR... If I change the config to have
When the config contained
|
The plugin adds The basePath is added to the CloudFormation template on deploy, so Given this config: custom:
customDomain:
domainName: "my.custom.domain.name"
basePath: ""
stage: ${opt:stage, 'dev'}
createRoute53Record: true The base path is going to be set to none.. is that not what you're expecting? |
@majones-amplify So let me first say that I think I was too hasty when I said that setting More to the point, though, when I deploy a Cloud Formation Template that contains The steps I'm performing are:
The result of the final command (and in the web UI) is consistently the same:
|
Ahh alright ok I see what you mean. Can you take a peek in the cloudformation-template-update-stack.json and post what's being created under the |
I'm thinking now that I would classify this as either an AWS issue or user error. After running the necessary commands so many times, it seems to me that if the resulting cloud formation template has no visible changes, then nothing is altered. Consider the following steps:
After following these steps, you can observe that:
|
My takeaway is that if I'm using serverless to deploy, I should basically just stay out of the aws console. |
Also, the stack json looks just like what I would expect it to
|
I'm a little confused here. So the base path is being created but then you're trying to change it?
I'm curious as to why/how you're doing this? |
Also, in our experience it's best never to go behind CloudFormation's back.. as more often than not it won't realize that changes have been made. If you do need to change the base path, I'd recommend removing it with |
I was trying to get started with this plugin while also doing a considerable amount of manual configuration in the AWS console around Route53, API Gateway, and CloudFront<->S3 setup. I can't point to a specific time or reason why I would have manually changed the API Gateway config in the console, but after trying to reproduce the issue in a number of different scenarios, I can only assume that that must have been what happened. That was the only way I could reproduce the issue. |
Ah gotcha, well if you do find anything, let us know! |
I'm encountering this issue as well. Did a serverless create_domain, checked in the config and deployed. No basepath seems to be set in the config. Wondering if the deploy came too soon before the domain was fully configured. Can't seem to figure out how to fix, going to try and remove the config, clean it up and try again. Will reach out if still stuck. |
Yeah, a bit confused. I do serverless create_domain, I wait. I then deploy with serverless deploy and when I go into the console and look at the base path mappings, I don't see anything there. Using Serverless v 1.10. Not sure if that matters for this or not. As far as I can tell, no basepath is getting added to my CF template during the serverless deploy. I have the following configuration, the names have been modified. The create_domain command worked fine. Like I said running with ServerLess 1.10.0, let me know if you can replicate or if anything in this setup jumps out at you. Thanks. ======= domains: |
I'm seeing this issue too on
|
I just encountered this problem in v2.5.6, but it seems that its caused by the cloudformation not doing a deploy when it doesn't detect a change. After changing the basePath to a random string, I was able to see the change. I then changed it back to the variable configuration and the plugin set it to the correct base path. |
+1 on this issue; been encountering the same thing and no |
+1
Only then it works |
The thing is that (if i remember correctly) the updated cloudformation (cloudformation-template-update-stack.json) has always the correct path mapping in the pathmapping resource but after deploying it doesnt reflect the change |
I tried several times, but could not find it anywhere in my update-stack.json
|
+1 I have the same issue. |
Same thing is happening to me |
+1 Encountering the same issue. |
+1 same issue. |
+1 same here. |
I've been able to replicate this issue per doing the following: sls create_domain
sls deploy
sls delete_domain
sls create_domain
sls deploy Now, this only happens if there have been no code changes to the lambda being deployed. |
Hello,
First, thanks for your great work on this! It makes a custom domain much easier.
I'm having a problem I can't figure out. No matter what I put into
basePath
andstage
, no path mapping are showing in the API Gateway custom domain configuration in AWS (and so all requests to the custom domain get 403s).My configuration is:
The custom domain and route53 dns record properly get made. The only thing is the "base path mappings" are totally blank. I tried putting anything into basePath, such as
'test'
, but still nothing. If I manually create it in AWS then everything works properly but obviously I don't want to have to do that.I'm sorry if I'm missing something obvious and this isn't urgent. But let me know how I can help debug. And thanks again for sharing this with the community!
The text was updated successfully, but these errors were encountered: