You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.**Dynamic Name Reference** (`function_name`): Reference module-managed functions by their map key
192
-
```hcl
193
-
function_association = {
194
-
viewer-request = {
195
-
function_name = "viewer-request-function" # Key from cloudfront_functions map
196
-
}
197
-
}
198
-
```
199
-
200
-
The module automatically resolves function ARNs using Terraform's `try()` function, checking for `function_arn` first, then falling back to `function_name` lookup in module-created functions. This eliminates circular dependency issues while maintaining flexibility.
201
-
202
160
## Examples
203
161
204
162
-[Complete](https://github.com/terraform-aws-modules/terraform-aws-cloudfront/tree/master/examples/complete) - Complete example which creates AWS CloudFront distribution and integrates it with other [terraform-aws-modules](https://github.com/terraform-aws-modules) to create additional resources: S3 buckets, Lambda Functions, CloudFront Functions, VPC Origins, ACM Certificate, Route53 Records.
@@ -208,7 +166,7 @@ The module automatically resolves function ARNs using Terraform's `try()` functi
208
166
-`Error: updating CloudFront Distribution (ETXXXXXXXXXXXX): InvalidArgument: The parameter ForwardedValues cannot be used when a cache policy is associated to the cache behavior.`
209
167
- When defining a behavior in `ordered_cache_behavior` and `default_cache_behavior` with a cache policy, you must specify `use_forwarded_values = false`.
210
168
211
-
```
169
+
```hcl
212
170
ordered_cache_behavior = [{
213
171
path_pattern = "/my/path"
214
172
target_origin_id = "my-origin"
@@ -261,7 +219,7 @@ No modules.
261
219
| Name | Description | Type | Default | Required |
| <aname="input_aliases"></a> [aliases](#input\_aliases)| Extra CNAMEs (alternate domain names), if any, for this distribution. |`list(string)`|`null`| no |
264
-
| <aname="input_cloudfront_functions"></a> [cloudfront\_functions](#input\_cloudfront\_functions)| Map of CloudFront Function configurations. Key is used as default function name if 'name' not specified. | <pre>map(object({<br/> name = optional(string)<br/> runtime = optional(string, "cloudfront-js-2.0")<br/> comment = optional(string)<br/> publish = optional(bool)<br/> code = string<br/> key_value_store_associations = optional(list(string))<br/> }))</pre> |`{}`| no |
222
+
| <aname="input_cloudfront_functions"></a> [cloudfront\_functions](#input\_cloudfront\_functions)| Map of CloudFront Function configurations. Key is used as default function name if 'name' not specified. | <pre>map(object({<br/> name = optional(string)<br/> runtime = optional(string, "cloudfront-js-2.0")<br/> comment = optional(string)<br/> publish = optional(bool)<br/> code = string<br/> key_value_store_associations = optional(list(string))<br/> }))</pre> |`null`| no |
265
223
| <aname="input_comment"></a> [comment](#input\_comment)| Any comments you want to include about the distribution. |`string`|`null`| no |
266
224
| <aname="input_continuous_deployment_policy_id"></a> [continuous\_deployment\_policy\_id](#input\_continuous\_deployment\_policy\_id)| Identifier of a continuous deployment policy. This argument should only be set on a production distribution. |`string`|`null`| no |
267
225
| <aname="input_create_cloudfront_function"></a> [create\_cloudfront\_function](#input\_create\_cloudfront\_function)| Controls if CloudFront Functions should be created |`bool`|`false`| no |
0 commit comments