hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.83k stars 9.17k forks source link

[Enhancement]: #27117

Open robertdeheer opened 2 years ago

robertdeheer commented 2 years ago

Description

Hello,

The aws cli supports invoking an ssm document with a cloudwatch configuration. I don't see a way to add cloudwatch configuration with the aws_ssm_document or aws_ssm_association resources.

aws ssm send-command \
    --document-name "AWS-RunPowerShellScript" \
    --parameters commands=["echo helloWorld"] \
    --targets "Key=instanceids,Values=an instance ID” \
    --cloud-watch-output-config '{"CloudWatchLogGroupName":"log group name","CloudWatchOutputEnabled":true}'

https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-rc-setting-up-cwlogs.html

Affected Resource(s) and/or Data Source(s)

*aws_ssm_document

Potential Terraform Configuration

resource "aws_ssm_association" "this" {
  name = aws_ssm_document.daily-vendor-update.name

  schedule_expression = "rate(60 minutes)"

  targets {
    key    = "tag:Name"
    values = ["test"]
  }

  cloudwatch_config = <<CFG
{
  "CloudWatchLogGroupName":"log group name",
  "CloudWatchOutputEnabled":true
}
CFG

}

References

https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-rc-setting-up-cwlogs.html

This request is for an implementation similar to the cloudwatch_config here

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_maintenance_window_task

Would you like to implement a fix?

No

github-actions[bot] commented 2 years ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 2 weeks ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!