The Terraform Mackerel Provider now supports AWS integration

Hello, id:hayajo_77 from the Mackerel SRE team.

We've just released v0.0.6 of the Terraform Mackerel Provider, it now supports AWS integration. This allows you to manage AWS integration configuration in Terraform.

mackerelio-labs/mackerel | Terraform Registry

This feature was contributed by @Gompei. We would like to take this opportunity to thank @Gompei for his help with the release. Thank you very much.

Configuration example

The following is an example of AWS integration configuration using IAM roles (configuration with AWS access keys is also available).

resource "mackerel_aws_integration" "test_integration" {
  name = "test AWS integration"
  memo = "This AWS integration is managed by Terraform."
  role_arn = "arn:aws:iam::1234567890:role/MackerelAWSIntegrationRole"
  external_id = "dJhaxAGdfQRSkXGCFqKjvgXNQ0I5DyeSylibsw8p"
  region = "ap-northeast-1"

  included_tags = "service:foo"
  excluded_tags = "environment:staging, environment:develop"

  alb {
    role = "foo: alb"
  rds {
    role = "foo: rds"
    excluded_metrics = ["rds.cpu.used", "rds.memory.swap"]
  ec2 {
    role = "foo: ec2"
    retire_automatically = true

For the external_id, you can use the external ID of the AWS integration configuration that you have already registered, or get new one from API.

The following is an example of how to get the external_id using the API (replace <YOUR_API_KEY> with the API key you want to use).

$ curl -XPOST -H "Content-Type: application/json" -H "X-Api-Key: <YOUR_API_KEY>"
{"externalId": "dJhaxAGdfQRSkXGCFqKjvgXNQ0I5DyeSylibsw8p"}

For a detailed description of the configuration required to use AWS integration with Mackerel and the permissions used, please refer to the AWS integration help.

You can also get more information about the configuration of AWS integration by the Terraform Mackerel Provider from its documentation.

If you have question

You can join the Mackerel User Group with this URL and ask your question.

Please take advantage of it!

That's it for the AWS integration of the Terraform Mackerel Provider.

If you are interested in IaC such as monitoring configuration, we hope you will find this provider useful.