I'm using a Lambda function URL as the origin for a CloudFront distribution. FYI the Lambda function uses Go 1.20 (on provided.al2 and Arm64). Seems to work fine, but I CANNOT retrieve query parameters in code when making request, for example "https://www.example.com?test=1234".
Sample of the Object I'm dumping the event into:
type Request struct {
Context Context `json:"context"`
Version string `json:"version"`
RouteKey string `json:"routeKey"`
RawPath string `json:"rawPath"`
RawQueryString string `json:"rawQueryString"`
Cookies []string `json:"cookies"`
Headers cli.StringMap `json:"headers"`
QueryStringParameters cli.StringMap `json:"queryStringParameters"`
QueryString cli.StringMap `json:"querystring"`
RequestContext RequestContext `json:"requestContext"`
Body string `json:"body"`
PathParameters interface{} `json:"pathParameters"`
IsBase64Encoded bool `json:"isBase64Encoded"`
StageVariables interface{} `json:"stageVariables"`
}
Though I should switch to this: https://github.com/aws/aws-lambda-go/blob/v1.41.0/events/lambda_function_urls.go#L14C39-L14C39
Yes I have allowed all query strings in my CloudFront Request policy:
I have also removed any CloudFront and Lambda@Edge functions until I get pass this.
Problem is that I'm not sure which event Request format is in use when CloudFront invokes the Lambda Function URL. Any AWS documentation I've read so far has not made it clear. I have multiple choices:
- https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html#urls-payloads
- https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-event-structure.html
I also don't see an official CloudFront event that I can use in the official AWS Lambda Go Package here at https://pkg.go.dev/github.com/aws/aws-lambda-go/events#section-readme.

