-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(aws-apigatewayv2): apiEndpoint
returns incomplete URL
#16638
Comments
As documented, To get the domain URL, you will need to use You need to check your code on your end. One thing to note - |
Can you please point out where they are? I cannot find it. aws-cdk/packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts Lines 366 to 370 in b0752c5
aws-cdk/packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts Lines 15 to 65 in b0752c5
aws-cdk/packages/@aws-cdk/aws-apigatewayv2/lib/common/stage.ts Lines 8 to 26 in b0752c5
|
Here -
|
But However both |
Ah, I missed that. You are correct indeed. This needs to be fixed. |
The workaround would be to cast it to |
The `defaultStage` prop in `HttpApi` returns `IHttpStage`. The `domainUrl` getter was previously added only to `HttpStage`. Elevate this to the `IHttpStage` level so it's available from the `HttpApi`. closes #16638
This does indeed work! (this.defaultStage as HttpStage).domainUrl |
I have a fix prepared - #16854 |
…16854) The `defaultStage` prop in `HttpApi` returns `IHttpStage`. The `domainUrl` getter was previously added only to `HttpStage`. Elevate this to the `IHttpStage` level so it's available from the `HttpApi`. closes #16638 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…ws#16854) The `defaultStage` prop in `HttpApi` returns `IHttpStage`. The `domainUrl` getter was previously added only to `HttpStage`. Elevate this to the `IHttpStage` level so it's available from the `HttpApi`. closes aws#16638 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-apigatewayv2.HttpApi.html#apiendpointspan-classapi-icon-api-icon-experimental-titlethis-api-element-is-experimental-it-may-change-without-noticespan
Not sure if this is intentional, as the docs aren't clear.
But calling
apiEndpoint
on an API that has adomainName
andmappingKey
set will produce a wrong URL.Reproduction Steps
What did you expect to happen?
To have the following resolved value:
What actually happened?
The value resolves to the following:
Note that the domain name is not applied, and the mapping key is not present.
Environment
Other
Docs state:
https://docs.aws.amazon.com/cdk/api/latest/docs/aws-apigatewayv2-readme.html#defining-http-apis
However, I don't have this prop on the
defaultStage
.This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: