CfnProjectProps

class aws_cdk.aws_codebuild.CfnProjectProps(*, artifacts, environment, service_role, source, badge_enabled=None, build_batch_config=None, cache=None, concurrent_build_limit=None, description=None, encryption_key=None, file_system_locations=None, logs_config=None, name=None, queued_timeout_in_minutes=None, resource_access_role=None, secondary_artifacts=None, secondary_sources=None, secondary_source_versions=None, source_version=None, tags=None, timeout_in_minutes=None, triggers=None, visibility=None, vpc_config=None)

Bases: object

Properties for defining a CfnProject.

Parameters
  • artifacts (Union[IResolvable, ArtifactsProperty, Dict[str, Any]]) – Artifacts is a property of the AWS::CodeBuild::Project resource that specifies output settings for artifacts generated by an AWS CodeBuild build.

  • environment (Union[IResolvable, EnvironmentProperty, Dict[str, Any]]) – The build environment settings for the project, such as the environment type or the environment variables to use for the build environment.

  • service_role (str) – The ARN of the IAM role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.

  • source (Union[SourceProperty, Dict[str, Any], IResolvable]) – The source code settings for the project, such as the source code’s repository type and location.

  • badge_enabled (Union[bool, IResolvable, None]) – Indicates whether AWS CodeBuild generates a publicly accessible URL for your project’s build badge. For more information, see Build Badges Sample in the AWS CodeBuild User Guide . .. epigraph:: Including build badges with your project is currently not supported if the source type is CodePipeline. If you specify CODEPIPELINE for the Source property, do not specify the BadgeEnabled property.

  • build_batch_config (Union[IResolvable, ProjectBuildBatchConfigProperty, Dict[str, Any], None]) – A ProjectBuildBatchConfig object that defines the batch build options for the project.

  • cache (Union[IResolvable, ProjectCacheProperty, Dict[str, Any], None]) – Settings that AWS CodeBuild uses to store and reuse build dependencies.

  • concurrent_build_limit (Union[int, float, None]) – The maximum number of concurrent builds that are allowed for this project. New builds are only started if the current number of builds is less than or equal to this limit. If the current build count meets this limit, new builds are throttled and are not run.

  • description (Optional[str]) – A description that makes the build project easy to identify.

  • encryption_key (Optional[str]) – The AWS Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts. .. epigraph:: You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key. You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK’s alias (using the format alias/<alias-name> ). If you don’t specify a value, CodeBuild uses the managed CMK for Amazon Simple Storage Service (Amazon S3).

  • file_system_locations (Union[IResolvable, Sequence[Union[IResolvable, ProjectFileSystemLocationProperty, Dict[str, Any]]], None]) – An array of ProjectFileSystemLocation objects for a CodeBuild build project. A ProjectFileSystemLocation object specifies the identifier , location , mountOptions , mountPoint , and type of a file system created using Amazon Elastic File System.

  • logs_config (Union[IResolvable, LogsConfigProperty, Dict[str, Any], None]) – Information about logs for the build project. A project can create logs in CloudWatch Logs, an S3 bucket, or both.

  • name (Optional[str]) – The name of the build project. The name must be unique across all of the projects in your AWS account .

  • queued_timeout_in_minutes (Union[int, float, None]) – The number of minutes a build is allowed to be queued before it times out.

  • resource_access_role (Optional[str]) – The ARN of the IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for the project’s builds.

  • secondary_artifacts (Union[IResolvable, Sequence[Union[IResolvable, ArtifactsProperty, Dict[str, Any]]], None]) – A list of Artifacts objects. Each artifacts object specifies output settings that the project generates during a build.

  • secondary_sources (Union[IResolvable, Sequence[Union[SourceProperty, Dict[str, Any], IResolvable]], None]) – An array of ProjectSource objects.

  • secondary_source_versions (Union[IResolvable, Sequence[Union[IResolvable, ProjectSourceVersionProperty, Dict[str, Any]]], None]) – An array of ProjectSourceVersion objects. If secondarySourceVersions is specified at the build level, then they take over these secondarySourceVersions (at the project level).

  • source_version (Optional[str]) – A version of the build input to be built for this project. If not specified, the latest version is used. If specified, it must be one of: - For CodeCommit: the commit ID, branch, or Git tag to use. - For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format pr/pull-request-ID (for example pr/25 ). If a branch name is specified, the branch’s HEAD commit ID is used. If not specified, the default branch’s HEAD commit ID is used. - For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch’s HEAD commit ID is used. If not specified, the default branch’s HEAD commit ID is used. - For Amazon S3: the version ID of the object that represents the build input ZIP file to use. If sourceVersion is specified at the build level, then that version takes precedence over this sourceVersion (at the project level). For more information, see Source Version Sample with CodeBuild in the AWS CodeBuild User Guide .

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – An arbitrary set of tags (key-value pairs) for the AWS CodeBuild project. These tags are available for use by AWS services that support AWS CodeBuild build project tags.

  • timeout_in_minutes (Union[int, float, None]) – How long, in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait before timing out any related build that did not get marked as completed. The default is 60 minutes.

  • triggers (Union[ProjectTriggersProperty, Dict[str, Any], IResolvable, None]) – For an existing AWS CodeBuild build project that has its source code stored in a GitHub repository, enables AWS CodeBuild to begin automatically rebuilding the source code every time a code change is pushed to the repository.

  • visibility (Optional[str]) – Specifies the visibility of the project’s builds. Possible values are:. - PUBLIC_READ - The project builds are visible to the public. - PRIVATE - The project builds are not visible to the public.

  • vpc_config (Union[IResolvable, VpcConfigProperty, Dict[str, Any], None]) – VpcConfig specifies settings that enable AWS CodeBuild to access resources in an Amazon VPC. For more information, see Use AWS CodeBuild with Amazon Virtual Private Cloud in the AWS CodeBuild User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_codebuild as codebuild

cfn_project_props = codebuild.CfnProjectProps(
    artifacts=codebuild.CfnProject.ArtifactsProperty(
        type="type",

        # the properties below are optional
        artifact_identifier="artifactIdentifier",
        encryption_disabled=False,
        location="location",
        name="name",
        namespace_type="namespaceType",
        override_artifact_name=False,
        packaging="packaging",
        path="path"
    ),
    environment=codebuild.CfnProject.EnvironmentProperty(
        compute_type="computeType",
        image="image",
        type="type",

        # the properties below are optional
        certificate="certificate",
        environment_variables=[codebuild.CfnProject.EnvironmentVariableProperty(
            name="name",
            value="value",

            # the properties below are optional
            type="type"
        )],
        image_pull_credentials_type="imagePullCredentialsType",
        privileged_mode=False,
        registry_credential=codebuild.CfnProject.RegistryCredentialProperty(
            credential="credential",
            credential_provider="credentialProvider"
        )
    ),
    service_role="serviceRole",
    source=codebuild.CfnProject.SourceProperty(
        type="type",

        # the properties below are optional
        auth=codebuild.CfnProject.SourceAuthProperty(
            type="type",

            # the properties below are optional
            resource="resource"
        ),
        build_spec="buildSpec",
        build_status_config=codebuild.CfnProject.BuildStatusConfigProperty(
            context="context",
            target_url="targetUrl"
        ),
        git_clone_depth=123,
        git_submodules_config=codebuild.CfnProject.GitSubmodulesConfigProperty(
            fetch_submodules=False
        ),
        insecure_ssl=False,
        location="location",
        report_build_status=False,
        source_identifier="sourceIdentifier"
    ),

    # the properties below are optional
    badge_enabled=False,
    build_batch_config=codebuild.CfnProject.ProjectBuildBatchConfigProperty(
        batch_report_mode="batchReportMode",
        combine_artifacts=False,
        restrictions=codebuild.CfnProject.BatchRestrictionsProperty(
            compute_types_allowed=["computeTypesAllowed"],
            maximum_builds_allowed=123
        ),
        service_role="serviceRole",
        timeout_in_mins=123
    ),
    cache=codebuild.CfnProject.ProjectCacheProperty(
        type="type",

        # the properties below are optional
        location="location",
        modes=["modes"]
    ),
    concurrent_build_limit=123,
    description="description",
    encryption_key="encryptionKey",
    file_system_locations=[codebuild.CfnProject.ProjectFileSystemLocationProperty(
        identifier="identifier",
        location="location",
        mount_point="mountPoint",
        type="type",

        # the properties below are optional
        mount_options="mountOptions"
    )],
    logs_config=codebuild.CfnProject.LogsConfigProperty(
        cloud_watch_logs=codebuild.CfnProject.CloudWatchLogsConfigProperty(
            status="status",

            # the properties below are optional
            group_name="groupName",
            stream_name="streamName"
        ),
        s3_logs=codebuild.CfnProject.S3LogsConfigProperty(
            status="status",

            # the properties below are optional
            encryption_disabled=False,
            location="location"
        )
    ),
    name="name",
    queued_timeout_in_minutes=123,
    resource_access_role="resourceAccessRole",
    secondary_artifacts=[codebuild.CfnProject.ArtifactsProperty(
        type="type",

        # the properties below are optional
        artifact_identifier="artifactIdentifier",
        encryption_disabled=False,
        location="location",
        name="name",
        namespace_type="namespaceType",
        override_artifact_name=False,
        packaging="packaging",
        path="path"
    )],
    secondary_sources=[codebuild.CfnProject.SourceProperty(
        type="type",

        # the properties below are optional
        auth=codebuild.CfnProject.SourceAuthProperty(
            type="type",

            # the properties below are optional
            resource="resource"
        ),
        build_spec="buildSpec",
        build_status_config=codebuild.CfnProject.BuildStatusConfigProperty(
            context="context",
            target_url="targetUrl"
        ),
        git_clone_depth=123,
        git_submodules_config=codebuild.CfnProject.GitSubmodulesConfigProperty(
            fetch_submodules=False
        ),
        insecure_ssl=False,
        location="location",
        report_build_status=False,
        source_identifier="sourceIdentifier"
    )],
    secondary_source_versions=[codebuild.CfnProject.ProjectSourceVersionProperty(
        source_identifier="sourceIdentifier",

        # the properties below are optional
        source_version="sourceVersion"
    )],
    source_version="sourceVersion",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    timeout_in_minutes=123,
    triggers=codebuild.CfnProject.ProjectTriggersProperty(
        build_type="buildType",
        filter_groups=[[codebuild.CfnProject.WebhookFilterProperty(
            pattern="pattern",
            type="type",

            # the properties below are optional
            exclude_matched_pattern=False
        )]],
        webhook=False
    ),
    visibility="visibility",
    vpc_config=codebuild.CfnProject.VpcConfigProperty(
        security_group_ids=["securityGroupIds"],
        subnets=["subnets"],
        vpc_id="vpcId"
    )
)

Attributes

artifacts

//docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html>`_ resource that specifies output settings for artifacts generated by an AWS CodeBuild build.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-artifacts

Type

Artifacts is a property of the `AWS::CodeBuild::Project <https

Return type

Union[IResolvable, ArtifactsProperty]

badge_enabled

Indicates whether AWS CodeBuild generates a publicly accessible URL for your project’s build badge.

For more information, see Build Badges Sample in the AWS CodeBuild User Guide . .. epigraph:

Including build badges with your project is currently not supported if the source type is CodePipeline. If you specify ``CODEPIPELINE`` for the ``Source`` property, do not specify the ``BadgeEnabled`` property.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-badgeenabled

Return type

Union[bool, IResolvable, None]

build_batch_config

A ProjectBuildBatchConfig object that defines the batch build options for the project.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-buildbatchconfig

Return type

Union[IResolvable, ProjectBuildBatchConfigProperty, None]

cache

Settings that AWS CodeBuild uses to store and reuse build dependencies.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-cache

Return type

Union[IResolvable, ProjectCacheProperty, None]

concurrent_build_limit

The maximum number of concurrent builds that are allowed for this project.

New builds are only started if the current number of builds is less than or equal to this limit. If the current build count meets this limit, new builds are throttled and are not run.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-concurrentbuildlimit

Return type

Union[int, float, None]

description

A description that makes the build project easy to identify.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-description

Return type

Optional[str]

encryption_key

The AWS Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.

You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key.

You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK’s alias (using the format alias/<alias-name> ). If you don’t specify a value, CodeBuild uses the managed CMK for Amazon Simple Storage Service (Amazon S3).

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-encryptionkey

Return type

Optional[str]

environment

The build environment settings for the project, such as the environment type or the environment variables to use for the build environment.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-environment

Return type

Union[IResolvable, EnvironmentProperty]

file_system_locations

An array of ProjectFileSystemLocation objects for a CodeBuild build project.

A ProjectFileSystemLocation object specifies the identifier , location , mountOptions , mountPoint , and type of a file system created using Amazon Elastic File System.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-filesystemlocations

Return type

Union[IResolvable, List[Union[IResolvable, ProjectFileSystemLocationProperty]], None]

logs_config

Information about logs for the build project.

A project can create logs in CloudWatch Logs, an S3 bucket, or both.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-logsconfig

Return type

Union[IResolvable, LogsConfigProperty, None]

name

The name of the build project.

The name must be unique across all of the projects in your AWS account .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-name

Return type

Optional[str]

queued_timeout_in_minutes

The number of minutes a build is allowed to be queued before it times out.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-queuedtimeoutinminutes

Return type

Union[int, float, None]

resource_access_role

The ARN of the IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for the project’s builds.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-resourceaccessrole

Return type

Optional[str]

secondary_artifacts

A list of Artifacts objects.

Each artifacts object specifies output settings that the project generates during a build.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-secondaryartifacts

Return type

Union[IResolvable, List[Union[IResolvable, ArtifactsProperty]], None]

secondary_source_versions

An array of ProjectSourceVersion objects.

If secondarySourceVersions is specified at the build level, then they take over these secondarySourceVersions (at the project level).

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-secondarysourceversions

Return type

Union[IResolvable, List[Union[IResolvable, ProjectSourceVersionProperty]], None]

secondary_sources

An array of ProjectSource objects.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-secondarysources

Return type

Union[IResolvable, List[Union[SourceProperty, IResolvable]], None]

service_role

The ARN of the IAM role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-servicerole

Return type

str

source

The source code settings for the project, such as the source code’s repository type and location.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-source

Return type

Union[SourceProperty, IResolvable]

source_version

A version of the build input to be built for this project.

If not specified, the latest version is used. If specified, it must be one of:

  • For CodeCommit: the commit ID, branch, or Git tag to use.

  • For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format pr/pull-request-ID (for example pr/25 ). If a branch name is specified, the branch’s HEAD commit ID is used. If not specified, the default branch’s HEAD commit ID is used.

  • For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch’s HEAD commit ID is used. If not specified, the default branch’s HEAD commit ID is used.

  • For Amazon S3: the version ID of the object that represents the build input ZIP file to use.

If sourceVersion is specified at the build level, then that version takes precedence over this sourceVersion (at the project level).

For more information, see Source Version Sample with CodeBuild in the AWS CodeBuild User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-sourceversion

Return type

Optional[str]

tags

An arbitrary set of tags (key-value pairs) for the AWS CodeBuild project.

These tags are available for use by AWS services that support AWS CodeBuild build project tags.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-tags

Return type

Optional[List[CfnTag]]

timeout_in_minutes

How long, in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait before timing out any related build that did not get marked as completed.

The default is 60 minutes.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-timeoutinminutes

Return type

Union[int, float, None]

triggers

For an existing AWS CodeBuild build project that has its source code stored in a GitHub repository, enables AWS CodeBuild to begin automatically rebuilding the source code every time a code change is pushed to the repository.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-triggers

Return type

Union[ProjectTriggersProperty, IResolvable, None]

visibility

.

  • PUBLIC_READ - The project builds are visible to the public.

  • PRIVATE - The project builds are not visible to the public.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-visibility

Type

Specifies the visibility of the project’s builds. Possible values are

Return type

Optional[str]

vpc_config

VpcConfig specifies settings that enable AWS CodeBuild to access resources in an Amazon VPC.

For more information, see Use AWS CodeBuild with Amazon Virtual Private Cloud in the AWS CodeBuild User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-vpcconfig

Return type

Union[IResolvable, VpcConfigProperty, None]