Search code examples
amazon-web-servicesterraformamazon-cloudwatch

AWS: can I enable CloudWatch "centralized monitoring account" using terraform?


I have different accounts in AWS. Now I would like to use CloudWatch to centralized monitoring account, but I don't found a solution to configure "Monitoring account configuration" using Terraform:

enter image description here

enter image description here


Solution

  • I think you want the Observability Access Manager resources:

    1. https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/oam_sink
    2. https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/oam_link

    Based on the AWS documentation for sink and link, you should create the sink in the monitoring account and links in all the member accounts.

    EDIT: As per the comments, the sink policy resource is also required.