Skip to content
New issue

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

[Bug]: aws_lambda_function: perpetual drift in log levels #35301

Closed
Michagogo opened this issue Jan 14, 2024 · 3 comments · Fixed by #35694
Closed

[Bug]: aws_lambda_function: perpetual drift in log levels #35301

Michagogo opened this issue Jan 14, 2024 · 3 comments · Fixed by #35694
Labels
bug Addresses a defect in current functionality. service/lambda Issues and PRs that pertain to the lambda service.
Milestone

Comments

@Michagogo
Copy link
Contributor

Terraform Core Version

1.6.6

AWS Provider Version

5.32.1

Affected Resource(s)

aws_lambda_function

Expected Behavior

The new logging_config block contains optional arguments {application,system}_log_level. When those arguments are left undefined, the default (or existing, presumably, in case of manual change, import, etc.) should be ignored/left as is, if that’s a possibility. In any case, a second consecutive terraform apply should, as always, return no changes.

Actual Behavior

On every apply, the plan will always propose the resource to be updated in-place, such as the following:

~ logging_config {
    - application_log_level = "INFO" -> null
    - system_log_level     = "INFO" -> null
       # (2 unchanged attributes hidden)
}

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_iam_role" "lambda" {
  # insert applicable policies here
}

resource "aws_cloudwatch_log_group" "lambda" {}

data "archive_file" "null" {
  type = "zip"
  output_path = "null.zip"
  source_content = "pass"
  source_content_filename = "null.py"
}

resource "aws_lambda_function" "test" {
  function_name = "test"
  role          = aws_iam_role.lambda.arn
  filename      = "null.zip"
  handler      = "null"
  runtime      = "python3.12"
  logging_config {
    log_format = "JSON"
    log_group  = aws_cloudwatch_log_group.lambda.id
  }
}

Steps to Reproduce

  1. terraform apply
  2. terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

Relates #35050

Would you like to implement a fix?

No

@Michagogo Michagogo added the bug Addresses a defect in current functionality. label Jan 14, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/iam Issues and PRs that pertain to the iam service. service/lambda Issues and PRs that pertain to the lambda service. service/logs Issues and PRs that pertain to the logs service. labels Jan 14, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 14, 2024
@gdavison gdavison removed the service/iam Issues and PRs that pertain to the iam service. label Jan 15, 2024
@justinretzolk justinretzolk removed needs-triage Waiting for first response or review from a maintainer. service/logs Issues and PRs that pertain to the logs service. labels Jan 16, 2024
@github-actions github-actions bot added this to the v5.36.0 milestone Feb 8, 2024
Copy link

github-actions bot commented Feb 8, 2024

This functionality has been released in v5.36.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/lambda Issues and PRs that pertain to the lambda service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants