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.75k stars 9.1k forks source link

Enable organizational view for AWS Health Dashboard #25507

Open bebold-jhr opened 2 years ago

bebold-jhr commented 2 years ago

Community Note

Description

You can setup "organizational view" for AWS Health Dashboard. It would be great to be able to activate this via Terraform.

New or Affected Resource(s)

Potential Terraform Configuration

resource "aws_health_dashboard_organizational_view" "example" {
  enabled = true
}

References

ppmathis commented 3 months ago

FWIW, I got this working perfectly fine with a combination of these resources:

resource "aws_organizations_organization" "this" {
  # ...
  aws_service_access_principals = [
    "health.amazonaws.com",
  ]
}

resource "aws_iam_service_linked_role" "health" {
  aws_service_name = "health.amazonaws.com"
  custom_suffix    = "Organizations"
}

resource "aws_organizations_delegated_administrator" "health" {
  account_id        = aws_organizations_account.test.id
  service_principal = "health.amazonaws.com"
}

The Configurations tab in the AWS Health console also shows "Successful" for the organizational view setup, so I think it is probably alright. Could not find anything broken yet, but obviously not quite the officially recommended way.