skip to Main Content

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


  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.

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search