-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Feature Request: CloudFront Functions #19225
Comments
We have been working with AWS on the private preview here, the above functionality creates the function, but what we urgently need is the ability to assign a function to a CloudFront Behaviour. We wouldn't use the above suggestion as our functions are deployed and published by a deployment pipeline. Currently we need to do the Function -> Behaviour assignment manually, but this is the perfect job for Terraform (which currently unassociates the functions every time an apply is made affecting a distribution) |
Cloudfront Functions basically get associated to distribution behaviour(s) like Lambda@Edge In addition to the proposed new resource is a change is required to So taking inspiration from the existing config block for Lambda@Edge: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_distribution#lambda-function-association this feature requires the following ordered_cache_behavior {
# ... other configuration ...
# zero or more of
function_association {
event_type = "viewer-request"
# the specific event to trigger this function. Valid values: viewer-request, viewer-response
arn = aws_cloudfront_function.default.arn
# e.g. arn:aws:cloudfront::000000000001:function/test
}
} Some might say Alternatively the config block could be made generic to handle both the association of Lambda@Edge functions AND Cloudfront Functions fuctions and deprecate |
Is someone working on this? I could give it a go next week. |
Is there any work around in the meantime that I can use to stop terraform from removing the cloudfront functions from my distributions? Right now every time my cloudfront distribution is modified it removes the functions without warning me. Even something that warns me would be good. |
The best you can get, without using a |
This has been released in version 3.41.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Description
Please add support for CloudFront Functions
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: