cloudposse / terraform-aws-ssm-patch-manager

Terraform module to provision AWS SSM Patch Manager maintenance window tasks, targets, patch baseline, patch groups and an s3 bucket for storing patch task logs
https://cloudposse.com/accelerate
Apache License 2.0
25 stars 17 forks source link

Add cloudwatch logging options for runCommand patch manager tasks #48

Closed gpapakyriakopoulos closed 6 months ago

gpapakyriakopoulos commented 7 months ago

Based on AWS documentation [1] runCommand executions support directly logging to cloudwatch instead of an S3 bucket.

To that end we introduce 3 extra module variables, the first 2 (cloudwatch_log_output_enabled & cloudwatch_log_group_name) to configure whether cloudwatch logging is enabled and whether a custom cloudwatch log group name should be provided (if not a default is created, see [2]). The 3rd variable (s3_log_output_enabled) is introduced to optionally disable supplying an S3 bucket for logging, since cloudwatch logging should be enough for some use cases.

[1] https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-rc-setting-up-cwlogs.html [2] https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_maintenance_window_task#cloudwatch_log_group_name

gberenice commented 7 months ago

/terratest

gberenice commented 7 months ago

/terratest

gpapakyriakopoulos commented 7 months ago

I was not able to update the readme as the make command failed for me on MacOS. If you would be so kind as to generate the README files correctly yourselves and update the PR I would appreciate it

gberenice commented 7 months ago

I was not able to update the readme as the make command failed for me on MacOS. If you would be so kind as to generate the README files correctly yourselves and update the PR I would appreciate it

@gpapakyriakopoulos thanks for your contribution! The issue with README generation will be fixed today, I'll re-run tests when it's done.

gberenice commented 7 months ago

/terratest

gberenice commented 7 months ago

@gpapakyriakopoulos could you please run again the following commands locally?

  make init
  make readme

I believe this should work now 👍

mergify[bot] commented 7 months ago

Thanks @gpapakyriakopoulos for creating this pull request!

A maintainer will review your changes shortly. Please don't be discouraged if it takes a while.

While you wait, make sure to review our contributor guidelines.

[!TIP]

Need help or want to ask for a PR review to be expedited?

Join us on Slack in the #pr-reviews channel.

gpapakyriakopoulos commented 7 months ago

@gpapakyriakopoulos could you please run again the following commands locally?

  make init
  make readme

I believe this should work now 👍

Seemed to worked correctly this time! I've added the README update in the PR, thanks!

gberenice commented 7 months ago

/terratest

gberenice commented 7 months ago

@gpapakyriakopoulos mind syncing your fork with the base branch?

gpapakyriakopoulos commented 6 months ago

Just rebased using the GitHub button @gberenice. Seems like you need to run terratest again + add your review again.

gberenice commented 6 months ago

/terratest

gberenice commented 6 months ago

A new version v1.0.1 was released. Thanks @gpapakyriakopoulos !