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
When executing terraform plan, I get the following error:
Error: Inconsistent conditional result types
│
│ on .terraform/modules/tf_next/main.tf line 192, in locals:
│ 192: cloudfront_custom_behaviors = var.cloudfront_custom_behaviors != null ? concat(
│ 193: local.next_image_custom_behavior,
│ 194: var.cloudfront_custom_behaviors
│ 195: ) : local.next_image_custom_behavior
│ ├────────────────
│ │ local.next_image_custom_behavior is list of object with 1 element
│ │ var.cloudfront_custom_behaviors is list of object with 1 element
│
│ The true and false result expressions must have consistent types. The given expressions are tuple and list of object, respectively.
My main.tf looks like this:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
# Main region where the resources should be created in
# Should be close to the location of your viewers
provider "aws" {
region = "ca-central-1"
}
# Provider used for creating the Lambda@Edge function which must be deployed
# to us-east-1 region (Should not be changed)
provider "aws" {
alias = "global_region"
region = "us-east-1"
}
resource "aws_cloudfront_function" "password_protection" {
name = "test-password-protection"
runtime = "cloudfront-js-1.0"
comment = "Basic Auth"
publish = true
code = file("${path.module}/path/to/file.js")
}
module "tf_next" {
source = "dealmore/next-js/aws"
providers = {
aws.global_region = aws.global_region
}
cloudfront_custom_behaviors = [{
function_association = {
event_type = "viewer-request"
function_arn = aws_cloudfront_function.password_protection.arn
}
}]
deployment_name = "test"
}
output "cloudfront_domain_name" {
value = module.tf_next.cloudfront_domain_name
}
Can somebody please help me getting it to work?
Thank you very much in advance!
The text was updated successfully, but these errors were encountered:
Adding functions to the internal CloudFront distribution is currently not possible since the values that can be passed in are limited.
We will lift this limitation in #55 which allows a fully customization of the CloudFront distribution.
We plan to release this feature this week with the upcoming 0.9.0 release.
I will post update on this issue how to integrate CloudFront functions once the release is done.
When executing terraform plan, I get the following error:
My main.tf looks like this:
Can somebody please help me getting it to work?
Thank you very much in advance!
The text was updated successfully, but these errors were encountered: