File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,14 @@ resource "aws_cloudfront_distribution" "site" {
2424 allowed_methods = [" GET" , " HEAD" ]
2525 cached_methods = [" GET" , " HEAD" ]
2626 cache_policy_id = data. aws_cloudfront_cache_policy . default . id
27+
28+ dynamic "function_association" {
29+ for_each = var. function_associations
30+ content {
31+ event_type = function_association. value . event_type
32+ function_arn = function_association. value . function_arn
33+ }
34+ }
2735 }
2836
2937 restrictions {
Original file line number Diff line number Diff line change @@ -55,3 +55,13 @@ variable "extra_domain_prefixes" {
5555 description = " Prefixes for additional custom domains to be associated with the CloudFront distribution."
5656 nullable = false
5757}
58+
59+ variable "function_associations" {
60+ type = set (object ({
61+ event_type = string
62+ function_arn = string
63+ }))
64+ default = []
65+ description = " A config block that triggers a lambda function with specific actions (maximum 4)."
66+ nullable = false
67+ }
You can’t perform that action at this time.
0 commit comments