Skip to content
v2.273.0

ReportGroup L2 construct ​

The ReportGroup resource class.

Example ​

ts
declare const source: codebuild.Source;

// create a new ReportGroup
const reportGroup = new codebuild.ReportGroup(this, 'ReportGroup');

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


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

project = codebuild.Project(self, "Project",
    source=source,
    build_spec=codebuild.BuildSpec.from_object({
        # ...
        "reports": {
            "report_group.report_group_arn": {
                "files": "**/*",
                "base-directory": "build/test-results"
            }
        }
    })
)
java
Source source;


// create a new ReportGroup
ReportGroup reportGroup = new ReportGroup(this, "ReportGroup");

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/test-results")))))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Source source;


// create a new ReportGroup
var reportGroup = new ReportGroup(this, "ReportGroup");

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/test-results"
            } }
        } }
    })
});
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"))

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/test-results"),
			},
		},
	}),
})

Initializer ​

ts
new ReportGroup(scope: Construct, id: string, props?: ReportGroupProps)
python
ReportGroup(scope: Construct, id: str, props: typing.Optional[ReportGroupProps] = None)
java
new ReportGroup(Construct scope, String id, ReportGroupProps props)
csharp
new ReportGroup(Construct scope, string id, ReportGroupProps? props = null)
go
NewReportGroup(Scope Construct, Id *string, Props ReportGroupProps)

Construct Props ​

deleteReportsbooleandelete_reportsbooldeleteReportsBooleanDeleteReportsboolDeleteReports*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.

exportBucketIBucketexport_bucketIBucketexportBucketIBucketExportBucketIBucketExportBucketIBucket= the reports will not be exported#
An optional S3 bucket to export the reports to.
removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= 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.

reportGroupNamestringreport_group_namestrreportGroupNameStringReportGroupNamestringReportGroupName*string= CloudFormation-generated name#
The physical name of the report group.
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.
zipExportbooleanzip_exportboolzipExportBooleanZipExportboolZipExport*bool= false (the files will not be ZIP…#
Whether to output the report files into the export bucket as-is, or create a ZIP from them before doing the export.

Ignored if exportBucket has not been provided.

default

Default: false (the files will not be ZIPped)

Properties ​

The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
reportGroupArnstringreport_group_arnstrreportGroupArnStringReportGroupArnstringReportGroupArn*stringrequired#
The ARN of the ReportGroup.
reportGroupNamestringreport_group_namestrreportGroupNameStringReportGroupNamestringReportGroupName*stringrequired#
The name of the ReportGroup.
reportGroupRefReportGroupReferencereport_group_refReportGroupReferencereportGroupRefReportGroupReferenceReportGroupRefReportGroupReferenceReportGroupRefReportGroupReferencerequired#
A reference to a ReportGroup resource.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.

Methods ​

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

fromReportGroupName(scope: Construct, id: string, reportGroupName: string): IReportGroup@staticmethod def from_report_group_name(scope: Construct, id: str, report_group_name: str) -> IReportGrouppublic static IReportGroup fromReportGroupName(Construct scope, String id, String reportGroupName)public static IReportGroup FromReportGroupName(Construct scope, string id, string reportGroupName)func FromReportGroupName(Scope Construct, Id *string, ReportGroupName *string) IReportGroupstatic#
Reference an existing ReportGroup, defined outside of the CDK code, by name.
grantWrite(identity: IGrantable): Grantdef grant_write(self, identity: IGrantable) -> Grantpublic Grant grantWrite(IGrantable identity)public Grant GrantWrite(IGrantable identity)func GrantWrite(Identity IGrantable) Grant#
[disable-awslint:no-grants].
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.