I was running an earlier version of terraform succesfully with the same code before upgrading to Terraform 0.14.3. I am able to now generate these errors with the same code. I would like to know if anyone knows of a change I we may have missed that is causing this. Thanks!
Error: "policy" contains an invalid JSON: unexpected end of JSON input
on ../ses-forwarder/lambda.tf line 23, in resource "aws_iam_policy" "iam_policy":
23: policy = data.template_file.iam_policy.rendered
Error: "policy" contains an invalid JSON: unexpected end of JSON input
on ../ses-forwarder/s3.tf line 4, in resource "aws_s3_bucket" "bucket":
4: policy = data.template_file.bucket_policy.rendered
Error: "template_body" contains an invalid JSON: unexpected end of JSON input
on ../ses-forwarder/sns.tf line 11, in resource "aws_cloudformation_stack" "sns_topic":
11: template_body = data.template_file.cloudformation_sns_stack.rendered
Line 23: policy = data.template_file.iam_policy.rendered
Line 4: template_body = data.template_file.cloudformation_sns_stack.rendered
Line 11: policy = data.template_file.bucket_policy.rendered
I was reading about 0.14. issues and was wondering if anyone sees: Terraform’s HTTP client code is now slightly stricter than before in HTTP header parsing, but in ways that should not affect typical server implementations: Terraform now trims only ASCII whitespace characters, and does not allow Transfer-Encoding: identity
. (#26357) as a potential issue here?? Since I am passing some whitespace and json from the provider not sure if the below would be affected…
data "template_file" "cloudformation_sns_stack" {
template = file("${path.module}/local/sns_topic.json")
vars = {
sns_display_name = var.sns_display_name
subscription = join(",", formatlist("{ \"Endpoint\": \"%s\", \"Protocol\": \"%s\" }", var.sns_email_address, var.sns_protocol))
}
}
resource "aws_cloudformation_stack" "sns_topic" {
name = var.lambda_name
template_body = data.template_file.cloudformation_sns_stack.rendered
tags = merge(map("Name", var.lambda_name), local.common_tags)
}
Thanks!