Resource: aws_codebuild_report_group

Provides a CodeBuild Report Groups Resource.

Example Usage

data "aws_caller_identity" "current" {}

data "aws_iam_policy_document" "example" {
  statement {
    sid    = "Enable IAM User Permissions"
    effect = "Allow"

    principals {
      type        = "AWS"
      identifiers = ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"]
    }

    actions   = ["kms:*"]
    resources = ["*"]
  }
}
resource "aws_kms_key" "example" {
  description             = "my test kms key"
  deletion_window_in_days = 7
  policy                  = data.aws_iam_policy_document.example.json
}

resource "aws_s3_bucket" "example" {
  bucket = "my-test"
}

resource "aws_codebuild_report_group" "example" {
  name = "my test report group"
  type = "TEST"

  export_config {
    type = "S3"

    s3_destination {
      bucket              = aws_s3_bucket.example.id
      encryption_disabled = false
      encryption_key      = aws_kms_key.example.arn
      packaging           = "NONE"
      path                = "/some"
    }
  }
}

Argument Reference

This resource supports the following arguments:

Export Config

S3 Destination

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import CodeBuild Report Group using the CodeBuild Report Group arn. For example:

import {
  to = aws_codebuild_report_group.example
  id = "arn:aws:codebuild:us-west-2:123456789:report-group/report-group-name"
}

Using terraform import, import CodeBuild Report Group using the CodeBuild Report Group arn. For example:

% terraform import aws_codebuild_report_group.example arn:aws:codebuild:us-west-2:123456789:report-group/report-group-name