Skip to content

(cloudfront): allow setting autoPublish to false for CloudFront functions #30028

@mazyu36

Description

@mazyu36

Describe the feature

Enable setting of autoPublish in the L2 construct for CloudFront Function.
https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-autopublish

Use Case

In the current L2 Construct, autoPublish can only be set to true.
It would be helpful to have the ability to set autoPublish to false when deploying L2 Constructs, in order to facilitate testing on the management console before publishing.

Proposed Solution

new cloudfront.Function(this, 'Function', {
  code: cloudfront.FunctionCode.fromInline('function handler(event) { return event.request }'),
  runtime: cloudfront.FunctionRuntime.JS_2_0,
  autoPublish: false // Add
});

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.137.0

Environment details (OS name and version, etc.)

irrelevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-cloudfrontRelated to Amazon CloudFronteffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions