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

CloudFront Lambda function created when insertHttpSecurityHeaders is false #1061

Open
jlosito opened this issue Jan 26, 2024 · 3 comments
Open
Labels
bug Something isn't working needs-triage The issue or PR still needs to be triaged

Comments

@jlosito
Copy link

jlosito commented Jan 26, 2024

I have a website being served with the CloudFrontToS3 construct, and I noticed that even if I set the insertHttpSecurityHeaders to false, the SetHttpSecurityHeaders lambda is still created. I would like if the lambda was not created if I'm not using it.


This is 🐛 Bug Report

@jlosito jlosito added bug Something isn't working needs-triage The issue or PR still needs to be triaged labels Jan 26, 2024
@biffgaut
Copy link
Contributor

Thanks, we'll take a look

@biffgaut
Copy link
Contributor

biffgaut commented Feb 9, 2024

Can you share a code sample and version information where you are seeing this behavior. When we run he code below there is no Lambda function created using v2.51.0 of the construct.

import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { CloudFrontToS3, CloudFrontToS3Props} from '@aws-solutions-constructs/aws-cloudfront-s3';

export class Issue1061Stack extends cdk.Stack {
  constructor(scope: Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const issueProps: CloudFrontToS3Props = {
      insertHttpSecurityHeaders: false
    }

    new CloudFrontToS3(this, 'issue1061test', issueProps);
  }
}

@jlosito
Copy link
Author

jlosito commented Feb 14, 2024

@biffgaut I recognize I owe you some code. I plan on deploying something this week and upload some screenshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage The issue or PR still needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants