From 4ba2db997ca5f07d7d504472edaa72484edb5095 Mon Sep 17 00:00:00 2001 From: Justin W Smith <103147162+justsmth@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:35:10 -0500 Subject: [PATCH] Setup public logging --- tests/ci/cdk/cdk/aws_lc_github_ci_stack.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/ci/cdk/cdk/aws_lc_github_ci_stack.py b/tests/ci/cdk/cdk/aws_lc_github_ci_stack.py index 3e647169659..cdc0259aa70 100644 --- a/tests/ci/cdk/cdk/aws_lc_github_ci_stack.py +++ b/tests/ci/cdk/cdk/aws_lc_github_ci_stack.py @@ -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 @@ -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, @@ -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),