(lambda): Add domain
helper prop to FunctionUrl
#23005
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
The lambda.FunctionUrl construct currently returns the Function URL as a full URL including the scheme + trailing
/
.https://*******.lambda-url.ap-southeast-2.on.aws/
In many cases, it's preferable to have just the domain name.
*******.lambda-url.ap-southeast-2.on.aws
Use Case
When serving a Function URL through a Cloudfront Distribution. The following workaround is required to remove the URL Scheme and path from
fn_url.url
so it can be consumed byCloudfront.HttpOrigin
Proposed Solution
The above code be added as a helper function on FunctionUrl construct:
Other Information
Happy to implement this one if it's a wanted change. Open to any suggestions on code or property names etc.
Acknowledgements
CDK version used
2.50.0
Environment details (OS name and version, etc.)
MacOS 13
The text was updated successfully, but these errors were encountered: