-
-
Notifications
You must be signed in to change notification settings - Fork 275
Closed
Description
Description
- It is inferred as a tuple type, resulting in an error.
Error: Inconsistent conditional result types
│
│ on .terraform/modules/cloudfront/main.tf line 538, in locals:
│ 538: cache_behaviors = var.ordered_cache_behavior != null ? concat([var.default_cache_behavior], var.ordered_cache_behavior) : [var.default_cache_behavior]
│ ├────────────────
│ │ var.default_cache_behavior is object with 23 attributes
│ │ var.ordered_cache_behavior is list of object with 1 element
│
│ The true and false result expressions must have consistent types. The 'true' tuple has length 2, but the 'false' tuple has length 1.
Versions
Module version: 6.0.1
Terraform version:
v1.14.0
Provider version(s):
6.23.0
Reproduction Code [Required]
items = {
xxxxx-builds = {
create_origin_access_control = true # This is removed in version 6.0.0
default_root_object = "index.html"
comment = "xxxxxx"
create_origin_s3_bucket = true
origin_s3_bucket = "xxxxxxx-${local.aws_region}-xxxxx"
origin_access_control = {
s3-origin-xxxx = {
description = "CloudFront access to S3"
origin_type = "s3"
signing_behavior = "always"
signing_protocol = "sigv4"
}
}
origin = {
s3-origin-xxxxx = {
domain_name = xxxxxxx-${local.aws_region}-builds.s3.${local.aws_region}.amazonaws.com"
origin_access_control = "s3-origin-xxxxxxx"
}
}
default_cache_behavior = {
target_origin_id = "s3-origin-xxxxxxx"
viewer_protocol_policy = "redirect-to-https"
allowed_methods = ["GET", "HEAD", "OPTIONS"]
cached_methods = ["GET", "HEAD"]
compress = true
query_string = true
cache_policy_id = "658327ea-f89d-4fab-a63d-7e88639e58f6"
}
ordered_cache_behavior = [
{
target_origin_id = "s3-origin-2-xxxxxxx"
viewer_protocol_policy = "redirect-to-https"
allowed_methods = ["GET", "HEAD", "OPTIONS"]
cached_methods = ["GET", "HEAD"]
compress = true
query_string = true
cache_policy_id = "658327ea-f89d-4fab-a63d-7e88639e58f6"
}
]
custom_error_response = [
{
error_code = 403
response_code = 200
response_page_path = "/index.html"
error_caching_min_ttl = 10
},
{
error_code = 404
response_code = 200
response_page_path = "/index.html"
error_caching_min_ttl = 10
}
]
}
}
}
ionutbalutoiu, igor-pinchuk, afr5 and jjosef
Metadata
Metadata
Assignees
Labels
No labels