question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CodeBuild: Add support for logging configuration in Project

See original GitHub issue

🚀 Feature Request

General Information

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

Description

  • There seems no way to specify a logging configuration for Project construct.

Proposed Solution

Environment

  • CDK CLI Version: 1.6.0 (build 3a0cde0)
  • Module Version: 1.6.0
  • OS: all
  • Language: all

Other information

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
logemanncommented, Jun 4, 2020

This worked for me:

let pipelineProject = new PipelineProject(this, "MyProject", {
...
};

const logGroup = new logs.LogGroup(this, StackUtils.getResourceName('CodepipelineLogGroup', props.deployEnv!), {
            retention: logs.RetentionDays.ONE_WEEK
        });
const logStream = logGroup.addStream(StackUtils.getResourceName('CodepipelineStream', props.deployEnv!));
        
let cfnProject = pipelineProject.node.defaultChild as CfnProject;
cfnProject.addPropertyOverride('LogsConfig', {
    "CloudWatchLogs": {
         "GroupName": logGroup.logGroupName,
         "Status": "ENABLED",
         "StreamName": logStream.logStreamName
    }
 });

pipelineProject.role?.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName('CloudWatchLogsFullAccess'));
2reactions
NGL321commented, Oct 14, 2019

Hi @idm-ryou,

This seems like a reasonable request! I have confirmed that LogsConfig property exists as a property of Project in Cloudformation, and that we do not accept it as a prop.

Someone will update this issue when any progress is made.

😸

Read more comments on GitHub >

github_iconTop Results From Across the Web

codebuild-project-logging-enabled - AWS Config
Checks if an AWS CodeBuild project environment has at least one log option enabled. The rule is NON_COMPLIANT if the status of all...
Read more >
Config Rules: CodeBuild Project Logging Enabled Check
A Config rule that checks if an AWS CodeBuild project environment has at least one log option enabled. The rule is NON_COMPLIANT if...
Read more >
aws_codebuild_project | Resources | hashicorp/aws
Provides a CodeBuild Project resource. ... IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for the project's...
Read more >
AWS CodeBuild - Towards AWS
By clicking on the build history you can navigate to more details on the execution. There you will see the logs and configuration...
Read more >
Change a build project's settings (console) - Amazon CodeBuild
Project configuration · Source · Environment · Buildspec · Batch configuration · Artifacts · Logs ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found