opengovsg / terraform-template

Repo to get a terraform infra running for OGP products
MIT License
1 stars 0 forks source link

Enable log streaming for Elastic Beanstalk #6

Open liangyuanruo opened 2 years ago

liangyuanruo commented 2 years ago

Is your feature request related to a problem? Please describe. Elastic Beanstalk logs are not being streamed to Cloudwatch. Deployment issues or runtime bugs cannot be investigated.

Describe the solution you'd like Have EB export logs to Cloudwatch.

Additional context This was discovered when troubleshooting EB deployment issues with @timotheeg on QuizSG.

yong-jie commented 2 years ago

to try in https://github.com/opengovsg/terraform-template/blob/059ada248cf2951046bd250a5146850d7240b73a/simple-elastic-beanstalk/main.tf#L188:

additional_settings = [
  ...,
  {
      namespace = "aws:elasticbeanstalk:cloudwatch:logs"
      name      = "StreamLogs"
      value     = true
  },
  {
      namespace = "aws:elasticbeanstalk:cloudwatch:logs"
      name      = "RetentionInDays"
      value     = 365
  },
]
timotheeg commented 2 years ago

Thank you @yong-jie, I will try that and report!