There are more AWS SDK examples available in the AWS Doc SDK Examples
Add HTTP security headers to a CloudFront Functions viewer response event
The following code example shows how to add HTTP security headers to a CloudFront Functions viewer response event.