Skip to content

Commit

Permalink
feat(pipelines): added logging as option for codeBuildDefaults prop o…
Browse files Browse the repository at this point in the history
…n CodePipeline construct (#25266)

## Motivation:
Logging is an optional prop as part of the Project construct in the aws-codebuild module. Users can link a codebuild action when as part of their CodePipeline with codebuild options being set via the codeBuildDefaults prop on the CodePipeline construct. Currently, there isn't any ability to enable logging for the codebuild action. This feature allows a user to enable logging as part of a linked codebuild action via S3, CloudWatch, or both.

## Use Case (from issue #22045):
At my company we just enabled AWS Config and SecurityHub has generated a rule 'securityhub-codebuild-project-logging-enabled-abcxyz'. This rule states that all CodeBuild projects must have at least one logging option enabled.

However the Build and Synth steps from the pipeline are always failing this check since the pipelines module doesn't allow specifying logging options on the nested CodeBuild projects.

## Testing:
Unit testing was implemented to verify that the CloudFormation template would be synthesized correctly when logging selected as an option on the codeBuildDefaults prop for S3, CloudWatch, or both.

Integration testing was implemented to verify that all resources would be successfully provisioned when a new CodePipeline is created with logging enabled for the codebuild action.

Closes #22045

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
colifran committed Apr 25, 2023
1 parent c038be0 commit d479b4d
Show file tree
Hide file tree
Showing 57 changed files with 9,325 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "31.0.0",
"files": {
"1576b28912dd95ee8b60a0f773b1c888d1c0340a29d6adb4b2a2eb43dfcaffa9": {
"source": {
"path": "PipelineStack.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "1576b28912dd95ee8b60a0f773b1c888d1c0340a29d6adb4b2a2eb43dfcaffa9.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Loading

0 comments on commit d479b4d

Please sign in to comment.