diff --git a/README.md b/README.md index ef256f5..b644ea3 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ ordered_cache_behavior = [{ | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 0.13.1 | +| [terraform](#requirement\_terraform) | >= 1.5.7 | | [aws](#requirement\_aws) | >= 5.83 | ## Providers @@ -154,7 +154,7 @@ No modules. | [logging\_config](#input\_logging\_config) | The logging configuration that controls how logs are written to your distribution (maximum one). | `any` | `{}` | no | | [ordered\_cache\_behavior](#input\_ordered\_cache\_behavior) | An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0. | `any` | `[]` | no | | [origin](#input\_origin) | One or more origins for this distribution (multiples allowed). | `any` | `null` | no | -| [origin\_access\_control](#input\_origin\_access\_control) | Map of CloudFront origin access control |
map(object({
description = string
origin_type = string
signing_behavior = string
signing_protocol = string
}))
|
{
"s3": {
"description": "",
"origin_type": "s3",
"signing_behavior": "always",
"signing_protocol": "sigv4"
}
}
| no | +| [origin\_access\_control](#input\_origin\_access\_control) | Map of CloudFront origin access control |
map(object({
name = optional(string)
description = string
origin_type = string
signing_behavior = string
signing_protocol = string
}))
|
{
"s3": {
"description": "",
"origin_type": "s3",
"signing_behavior": "always",
"signing_protocol": "sigv4"
}
}
| no | | [origin\_access\_identities](#input\_origin\_access\_identities) | Map of CloudFront origin access identities (value as a comment) | `map(string)` | `{}` | no | | [origin\_group](#input\_origin\_group) | One or more origin\_group for this distribution (multiples allowed). | `any` | `{}` | no | | [price\_class](#input\_price\_class) | The price class for this distribution. One of PriceClass\_All, PriceClass\_200, PriceClass\_100 | `string` | `null` | no | diff --git a/main.tf b/main.tf index 1e03a3b..f773d7e 100644 --- a/main.tf +++ b/main.tf @@ -17,7 +17,7 @@ resource "aws_cloudfront_origin_access_identity" "this" { resource "aws_cloudfront_origin_access_control" "this" { for_each = local.create_origin_access_control ? var.origin_access_control : {} - name = each.key + name = try(each.value.name, null) != null ? each.value.name : each.key description = each.value["description"] origin_access_control_origin_type = each.value["origin_type"] diff --git a/variables.tf b/variables.tf index 75a2c27..afeec33 100644 --- a/variables.tf +++ b/variables.tf @@ -25,6 +25,7 @@ variable "create_origin_access_control" { variable "origin_access_control" { description = "Map of CloudFront origin access control" type = map(object({ + name = optional(string) description = string origin_type = string signing_behavior = string diff --git a/versions.tf b/versions.tf index e6e9705..5ce9aba 100644 --- a/versions.tf +++ b/versions.tf @@ -1,5 +1,5 @@ terraform { - required_version = ">= 0.13.1" + required_version = ">= 1.5.7" required_providers { aws = { diff --git a/wrappers/versions.tf b/wrappers/versions.tf index e6e9705..5ce9aba 100644 --- a/wrappers/versions.tf +++ b/wrappers/versions.tf @@ -1,5 +1,5 @@ terraform { - required_version = ">= 0.13.1" + required_version = ">= 1.5.7" required_providers { aws = {