We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v1.7.0+
https://developer.hashicorp.com/terraform/language/tests/mocking#overrides-syntax
In the examples provided to support the explanation, you can find
# ./modules/s3_data/main.tf variable "data_bucket_name" { type = string } data "aws_s3_object" "data_bucket" { bucket = var.data_bucket_name key = "credentials.json" } output "data" { value = jsondecode(data.aws_s3_object.data_bucket.body) }
Once you run terraform test you get an error in some of the previous tests defined something like
terraform test
data.aws_s3_object.data_bucket.body is ....Call to function "jsondecode" failed: extraneous data after JSON object."
because 'data.aws_s3_object.data_bucket.body' is already a JSON string -> unneeded jsondecode
jsondecode
I would suggest to remove jsondecode
variable "data_bucket_name" { type = string } data "aws_s3_object" "data_bucket" { bucket = var.data_bucket_name key = "credentials.json" } output "data" { value = data.aws_s3_object.data_bucket.body }
No response
The text was updated successfully, but these errors were encountered:
Thanks for this report!
Sorry, something went wrong.
No branches or pull requests
Terraform Version
Affected Pages
https://developer.hashicorp.com/terraform/language/tests/mocking#overrides-syntax
What is the docs issue?
In the examples provided to support the explanation, you can find
Once you run
terraform test
you get an error in some of the previous tests defined something likebecause 'data.aws_s3_object.data_bucket.body' is already a JSON string -> unneeded
jsondecode
Proposal
I would suggest to remove
jsondecode
References
No response
The text was updated successfully, but these errors were encountered: