Skip to content

Commit

Permalink
Setup public logging
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Jan 23, 2024
1 parent 56f11b5 commit 72037f0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/ci/cdk/cdk/aws_lc_github_ci_stack.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR ISC

from aws_cdk import Duration, Stack, aws_codebuild as codebuild, aws_iam as iam, aws_s3_assets
from aws_cdk import Duration, Stack, aws_codebuild as codebuild, aws_iam as iam, aws_s3_assets, aws_logs as logs
from constructs import Construct

from cdk.components import PruneStaleGitHubBuilds
Expand Down Expand Up @@ -47,6 +47,12 @@ def __init__(self,
assumed_by=iam.ServicePrincipal("codebuild.amazonaws.com"),
inline_policies=inline_policies)

logging_options = codebuild.LoggingOptions(
cloud_watch=codebuild.CloudWatchLoggingOptions(
log_group=logs.LogGroup(self, id="{}-public-logs".format(id))
)
)

# Define CodeBuild.
project = codebuild.Project(
scope=self,
Expand All @@ -55,6 +61,7 @@ def __init__(self,
source=git_hub_source,
role=role,
timeout=Duration.minutes(180),
logging=logging_options,
environment=codebuild.BuildEnvironment(compute_type=codebuild.ComputeType.SMALL,
privileged=False,
build_image=codebuild.LinuxBuildImage.STANDARD_4_0),
Expand Down

0 comments on commit 72037f0

Please sign in to comment.