1

In the AWS console there is an option to change the lambda log format between text and JSON under Configuration > Monitoring and operations tools > Logging configuration > Log format. It appears to be defaulting to Text and I want to update it to JSON for all my lambda functions. The functions are currently completely managed with Terraform but I don't see any option in the provider documentation for this setting in Terraform. Am I missing something or does Terraform not support this setting? Any other options besides something like explicitly setting it using the API?

I reviewed terraform provider lambda documentation and terraform provider cloudwatch log group documentation. I did not find any relevant settings.

2 Answers 2

3

You can use the awscc provider for that, it seems it is already available:

application_log_level (String) Application log granularity level, can only be used when LogFormat is set to JSON

log_format (String) Log delivery format for the lambda function

log_group (String) The log group name.

system_log_level (String) System log granularity level, can only be used when LogFormat is set to JSON

EDIT: This has been added to the AWS provider.

Sign up to request clarification or add additional context in comments.

Comments

1

Amazon added this log configuration feature to AWS Lambda only 5 days ago. The Terraform AWS Provider does not support this new feature yet. There is an issue you can upvote and track here, to add the feature.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.