Skip to content

Commit e954506

Browse files
joshAtRulabryantbiggs
authored andcommitted
update examples and function location
1 parent cb2c1cc commit e954506

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ No modules.
261261
| Name | Description | Type | Default | Required |
262262
|------|-------------|------|---------|:--------:|
263263
| <a name="input_aliases"></a> [aliases](#input\_aliases) | Extra CNAMEs (alternate domain names), if any, for this distribution. | `list(string)` | `null` | no |
264-
| <a name="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, true)<br/> code = string<br/> key_value_store_associations = optional(list(string), null)<br/> }))</pre> | `{}` | no |
264+
| <a name="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 |
265265
| <a name="input_comment"></a> [comment](#input\_comment) | Any comments you want to include about the distribution. | `string` | `null` | no |
266266
| <a name="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 |
267267
| <a name="input_create_cloudfront_function"></a> [create\_cloudfront\_function](#input\_create\_cloudfront\_function) | Controls if CloudFront Functions should be created | `bool` | `false` | no |

examples/complete/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ module "cloudfront" {
351351
}
352352
}
353353
}
354-
355354
}
356355

357356
######

main.tf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,12 @@ resource "aws_cloudfront_response_headers_policy" "this" {
146146
resource "aws_cloudfront_function" "this" {
147147
for_each = var.create_cloudfront_function && var.cloudfront_functions != null ? var.cloudfront_functions : {}
148148

149-
name = try(coalesce(each.value.name, each.key))
150-
runtime = each.value.runtime
151-
comment = each.value.comment
152-
publish = each.value.publish
153-
code = each.value.code
154-
149+
code = each.value.code
150+
comment = each.value.comment
155151
key_value_store_associations = each.value.key_value_store_associations
152+
name = try(coalesce(each.value.name, each.key))
153+
publish = each.value.publish
154+
runtime = each.value.runtime
156155
}
157156

158157
resource "aws_cloudfront_origin_access_identity" "this" {

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ variable "cloudfront_functions" {
300300
name = optional(string)
301301
runtime = optional(string, "cloudfront-js-2.0")
302302
comment = optional(string)
303-
publish = optional(bool, true)
303+
publish = optional(bool)
304304
code = string
305-
key_value_store_associations = optional(list(string), null)
305+
key_value_store_associations = optional(list(string))
306306
}))
307307
default = {}
308308

0 commit comments

Comments
 (0)