Skip to content
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

Amplify Access logs always show no Cookies #3948

Open
3 tasks done
shivennn opened this issue Jul 11, 2024 · 1 comment
Open
3 tasks done

Amplify Access logs always show no Cookies #3948

shivennn opened this issue Jul 11, 2024 · 1 comment
Labels
feature-request New feature or request

Comments

@shivennn
Copy link

shivennn commented Jul 11, 2024

Before opening, please confirm:

Amplify Hosting feature

Access logs, Custom headers

Is your feature request related to a problem? Please describe:

I am using Amplify hosting with custom domain and flow of request is as under.

Custom Cloud Front Distribution ----> Amplify App Origin

In Lambda Edge Function logs I observed cookies values passed from my custom Cloud Front Distribution but in Amplify Access logs of domain shows no cookies.

export const handler = (event, context, callback) => {
console.log("function invoked");
const request = event.Records[0].cf.request;
const uri = request.uri;
console.log(uri);
// Log the Cookie header
const headers = request.headers;
if (headers.cookie) {
    const cookies = headers.cookie.map(header => header.value).join('; ');
    console.log("Cookies: ", cookies);
} else {
    console.log("No Cookie header found");
}

console.log(request.uri);
return callback(null, request);
};

As discussed with AWS support team members Amplify managed Cloud Front Distribution has below settings which preventing cookie logging in Access Logs.

Headers : Accept , CloudFront-Viewer-Country , Host
Cookie logging : Off

workaround :

  • Use "S3+Cloud Front" Hosting but my application is Next JS SSR application and manual hosting not supported for Next JS SSR application in Amplify.

Describe how you'd like this feature to work

Provide Support for cookie logging in Amplify managed Cloud Front Distribution.

@shivennn shivennn added the feature-request New feature or request label Jul 11, 2024
Copy link

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant