Resource: awsCodebuildReportGroup
Provides a CodeBuild Report Groups Resource.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsS3BucketExample = new aws.s3Bucket.S3Bucket(this, "example", {
bucket: "my-test",
});
const dataAwsCallerIdentityCurrent =
new aws.dataAwsCallerIdentity.DataAwsCallerIdentity(this, "current", {});
const dataAwsIamPolicyDocumentExample =
new aws.dataAwsIamPolicyDocument.DataAwsIamPolicyDocument(this, "example_2", {
statement: [
{
actions: ["kms:*"],
effect: "Allow",
principals: [
{
identifiers: [
`arn:aws:iam::\${${dataAwsCallerIdentityCurrent.accountId}}:root`,
],
type: "AWS",
},
],
resources: ["*"],
sid: "Enable IAM User Permissions",
},
],
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAwsIamPolicyDocumentExample.overrideLogicalId("example");
const awsKmsKeyExample = new aws.kmsKey.KmsKey(this, "example_3", {
deletionWindowInDays: 7,
description: "my test kms key",
policy: dataAwsIamPolicyDocumentExample.json,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsKmsKeyExample.overrideLogicalId("example");
const awsCodebuildReportGroupExample =
new aws.codebuildReportGroup.CodebuildReportGroup(this, "example_4", {
exportConfig: {
s3Destination: {
bucket: awsS3BucketExample.id,
encryptionDisabled: false,
encryptionKey: awsKmsKeyExample.arn,
packaging: "NONE",
path: "/some",
},
type: "S3",
},
name: "my test report group",
type: "TEST",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsCodebuildReportGroupExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
name
- (Required) The name of a Report Group.type
- (Required) The type of the Report Group. Valid value aretest
andCODE_COVERAGE
.exportConfig
- (Required) Information about the destination where the raw data of this Report Group is exported. see Export Config documented below.deleteReports
- (Optional) Iftrue
, deletes any reports that belong to a report group before deleting the report group. Iffalse
, you must delete any reports in the report group before deleting it. Default value isfalse
.tags
- (Optional) Key-value mapping of resource tags. If configured with a providerdefaultTags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Export Config
type
- (Required) The export configuration type. Valid values ares3
andNO_EXPORT
.s3Destination
- (Required) contains information about the S3 bucket where the run of a report is exported. see S3 Destination documented below.
S3 Destination
bucket
- (Required) The name of the S3 bucket where the raw data of a report are exported.encryptionKey
- (Required) The encryption key for the report's encrypted raw data. The KMS key ARN.encryptionDisabled
- (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) andzip
.path
- (Optional) The path to the exported report's raw data results.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
id
- The ARN of Report Group.arn
- The ARN of Report Group.created
- The date and time this Report Group was created.tagsAll
- A map of tags assigned to the resource, including those inherited from the providerdefaultTags
configuration block.
Import
CodeBuild Report Group can be imported using the CodeBuild Report Group arn, e.g.,