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

Lambda function cannot write logs to Cloudwatch #15

Open
viyullas opened this issue Feb 24, 2021 · 4 comments
Open

Lambda function cannot write logs to Cloudwatch #15

viyullas opened this issue Feb 24, 2021 · 4 comments
Assignees

Comments

@viyullas
Copy link

SUMMARY

Probably it has been some change on AWS, because a disclaimer shows asking to add a policy to the execution role used by the Lambda function: AWSLambdaBasicExecutionRole

ISSUE TYPE
  • Bug Report
TERRAFORM VERSION
Terraform v0.14.0
+ provider registry.terraform.io/hashicorp/archive v2.1.0
+ provider registry.terraform.io/hashicorp/aws v3.26.0
+ provider registry.terraform.io/hashicorp/local v2.0.0
+ provider registry.terraform.io/hashicorp/null v3.0.0
+ provider registry.terraform.io/hashicorp/random v3.0.1
+ provider registry.terraform.io/hashicorp/template v2.2.0
+ provider registry.terraform.io/terraform-providers/mysql v1.9.0

Your version of Terraform is out of date! The latest version
is 0.14.7. You can update by downloading from https://www.terraform.io/downloads.htm
STEPS TO REPRODUCE

If you deploy de terraform module as is a disclaimer appears when you try to see the logs from the lambda funcions page on aws web console

module "start_environment" {
  count                          = local.settings.schedulling_enabled == false ? 0 : 1
  source                         = "diodonfrost/lambda-scheduler-stop-start/aws"
  name                           = "ec2_start"
  cloudwatch_schedule_expression = local.settings.env_start
  aws_regions                    = [local.settings.aws_region]
  schedule_action                = "start"
  autoscaling_schedule           = "true"
  ec2_schedule                   = "true"
  rds_schedule                   = "true"
  resources_tag = {
    key   = "Environment"
    value = terraform.workspace
  }

  tags = local.tags
}
EXPECTED RESULTS

Be able to watch logs

ACTUAL RESULTS

No logs.
If you manually add the role everything works as expected

@diodonfrost
Copy link
Owner

Thanks for your report, I think you are right. I'm going to investigate and write a fix when applicable.

@diodonfrost
Copy link
Owner

Fixed in version 3.1.1
thanks for your input!

@diodonfrost diodonfrost self-assigned this Feb 25, 2021
@viyullas
Copy link
Author

Hello!
I am having extrange behaviours with the latest release.
It has stopped responding to my custom tags, it sets "tostop" whether I configure another tag or not.

I still get the warning on lambda monitoring screen, I have not been able to see any log on cloudwath.

@nk9
Copy link

nk9 commented Jul 28, 2022

This sounds like a different issue, which should probably be opened separately. Isn't this issue ready to be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants