Skip to content
v2.276.0

ReportGroupProps Struct ​

Construction properties for ReportGroup.

Example ​

ts
declare const source: codebuild.Source;

// create a new ReportGroup
const reportGroup = new codebuild.ReportGroup(this, 'ReportGroup', {
    type: codebuild.ReportGroupType.CODE_COVERAGE
});

const project = new codebuild.Project(this, 'Project', {
  source,
  buildSpec: codebuild.BuildSpec.fromObject({
    // ...
    reports: {
      [reportGroup.reportGroupArn]: {
        files: '**/*',
        'base-directory': 'build/coverage-report.xml',
        'file-format': 'JACOCOXML'
      },
    },
  }),
});
python
# source: codebuild.Source


# create a new ReportGroup
report_group = codebuild.ReportGroup(self, "ReportGroup",
    type=codebuild.ReportGroupType.CODE_COVERAGE
)

project = codebuild.Project(self, "Project",
    source=source,
    build_spec=codebuild.BuildSpec.from_object({
        # ...
        "reports": {
            "report_group.report_group_arn": {
                "files": "**/*",
                "base-directory": "build/coverage-report.xml",
                "file-format": "JACOCOXML"
            }
        }
    })
)
java
Source source;


// create a new ReportGroup
ReportGroup reportGroup = ReportGroup.Builder.create(this, "ReportGroup")
        .type(ReportGroupType.CODE_COVERAGE)
        .build();

Project project = Project.Builder.create(this, "Project")
        .source(source)
        .buildSpec(BuildSpec.fromObject(Map.of(
                // ...
                "reports", Map.of(
                        reportGroup.getReportGroupArn(), Map.of(
                                "files", "**/*",
                                "base-directory", "build/coverage-report.xml",
                                "file-format", "JACOCOXML")))))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Source source;


// create a new ReportGroup
var reportGroup = new ReportGroup(this, "ReportGroup", new ReportGroupProps {
    Type = ReportGroupType.CODE_COVERAGE
});

var project = new Project(this, "Project", new ProjectProps {
    Source = source,
    BuildSpec = BuildSpec.FromObject(new Dictionary<string, object> {
        // ...
        { "reports", new Dictionary<string, IDictionary<string, string>> {
            { reportGroup.ReportGroupArn, new Struct {
                Files = "**/*",
                Base-directory = "build/coverage-report.xml",
                File-format = "JACOCOXML"
            } }
        } }
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var source Source


// create a new ReportGroup
reportGroup := codebuild.NewReportGroup(this, jsii.String("ReportGroup"), &ReportGroupProps{
	Type: codebuild.ReportGroupType_CODE_COVERAGE,
})

project := codebuild.NewProject(this, jsii.String("Project"), &ProjectProps{
	Source: Source,
	BuildSpec: codebuild.BuildSpec_FromObject(map[string]interface{}{
		// ...
		"reports": map[string]map[string]*string{
			reportGroup.reportGroupArn: map[string]*string{
				"files": jsii.String("**/*"),
				"base-directory": jsii.String("build/coverage-report.xml"),
				"file-format": jsii.String("JACOCOXML"),
			},
		},
	}),
})

Properties ​

deleteReportsoptionalbooleandelete_reportsoptionalbooldeleteReportsoptionalBooleanDeleteReportsoptionalboolDeleteReportsoptional*bool= false#
If true, deleting the report group force deletes the contents of the report group.

If false, the report group must be empty before attempting to delete it.

exportBucketoptionalIBucketexport_bucketoptionalIBucketexportBucketoptionalIBucketExportBucketoptionalIBucketExportBucketoptionalIBucket#
An optional S3 bucket to export the reports to.

Default: the reports will not be exported

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.RETAIN#
What to do when this resource is deleted from a stack.

As CodeBuild does not allow deleting a ResourceGroup that has reports inside of it, this is set to retain the resource by default.

reportGroupNameoptionalstringreport_group_nameoptionalstrreportGroupNameoptionalStringReportGroupNameoptionalstringReportGroupNameoptional*string#
The physical name of the report group.

Default: CloudFormation-generated name

typeoptionalReportGroupTypetypeoptionalReportGroupTypetypeoptionalReportGroupTypeTypeoptionalReportGroupTypeTypeoptionalReportGroupType= TEST#
The type of report group. This can be one of the following values:.
  • TEST - The report group contains test reports.
  • CODE_COVERAGE - The report group contains code coverage reports.
zipExportoptionalbooleanzip_exportoptionalboolzipExportoptionalBooleanZipExportoptionalboolZipExportoptional*bool#
Whether to output the report files into the export bucket as-is, or create a ZIP from them before doing the export.

Default: false (the files will not be ZIPped)

Ignored if exportBucket has not been provided.