Provides a CodeBuild Report Groups Resource.
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"
}
}
}
This resource supports the following arguments:
name
- (Required) The name of a Report Group.type
- (Required) The type of the Report Group. Valid value are TEST
and CODE_COVERAGE
.export_config
- (Required) Information about the destination where the raw data of this Report Group is exported. see Export Config documented below.delete_reports
- (Optional) If true
, deletes any reports that belong to a report group before deleting the report group. If false
, you must delete any reports in the report group before deleting it. Default value is false
.tags
- (Optional) Key-value mapping of resource tags. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.type
- (Required) The export configuration type. Valid values are S3
and NO_EXPORT
.s3_destination
- (Required) contains information about the S3 bucket where the run of a report is exported. see S3 Destination documented below.bucket
- (Required) The name of the S3 bucket where the raw data of a report are exported.encryption_key
- (Required) The encryption key for the report's encrypted raw data. The KMS key ARN.encryption_disabled
- (Optional) A boolean value that specifies if the results of a report are encrypted.
Note: the API does not currently allow setting encryption as disabledpackaging
- (Optional) The type of build output artifact to create. Valid values are: NONE
(default) and ZIP
.path
- (Optional) The path to the exported report's raw data results.This resource exports the following attributes in addition to the arguments above:
id
- The ARN of Report Group.arn
- The ARN of Report Group.created
- The date and time this Report Group was created.tags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.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