def _set_common_params()

in infra/src/stages/deploy_stage_codebuild.py [0:0]


    def _set_common_params(self, scope):
        if self._obj is None:
            self._obj = object()
            stage = "Deploy"

            stack_scope = Stack.of(scope)

            self._cfn_buildspec_file_parameter = CfnParameter(stack_scope,
                                                              f"{stage}Buildspec",
                                                              type="String",
                                                              description="The name of the codebuild spec file. e.g. codebuild/buildspec.yml")

            self._cfn_build_image_parameter = CfnParameter(stack_scope, f"{stage}BuildImage", type="String",
                                                           description="The codebuild image as specified in https://docs.aws.amazon.com/codebuild/latest/userguide/codebuild-env-ref-available.html. e.g. aws/codebuild/amazonlinux2-x86_64-standard:2.0",
                                                           default="aws/codebuild/standard:4.0")

            build_image = self._cfn_build_image_parameter.value_as_string
            buildspec_file = self._cfn_buildspec_file_parameter.value_as_string

            self._code_build = aws_codebuild.PipelineProject(
                scope,
                "{}CodeBuild".format(stage),
                environment=aws_codebuild.BuildEnvironment(
                    build_image=aws_codebuild.LinuxBuildImage.from_code_build_image_id(build_image),
                    privileged=True),
                build_spec=aws_codebuild.BuildSpec.from_source_filename(buildspec_file)
            )