CfnProject

class aws_cdk.aws_codebuild.CfnProject(scope, id, *, 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: aws_cdk.core.CfnResource

A CloudFormation AWS::CodeBuild::Project.

The AWS::CodeBuild::Project resource configures how AWS CodeBuild builds your source code. For example, it tells CodeBuild where to get the source code and which build environment to use.

CloudformationResource

AWS::CodeBuild::Project

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 = codebuild.CfnProject(self, "MyCfnProject",
    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"
    )
)

Create a new AWS::CodeBuild::Project.

Parameters
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • artifacts (Union[IResolvable, ArtifactsProperty]) – 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]) – 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, 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, None]) – A ProjectBuildBatchConfig object that defines the batch build options for the project.

  • cache (Union[IResolvable, ProjectCacheProperty, 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]], 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, 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]], 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, IResolvable]], None]) – An array of ProjectSource objects.

  • secondary_source_versions (Union[IResolvable, Sequence[Union[IResolvable, ProjectSourceVersionProperty]], 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[CfnTag]]) – 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, 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, 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 .

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters

path (str) – The path of the value to delete.

Return type

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters

target (CfnResource) –

Return type

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters
  • key (str) –

  • value (Any) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

None

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters

property_path (str) – The path to the property.

Return type

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters

attribute_name (str) – The name of the attribute.

Return type

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters

key (str) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

Any

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters

new_logical_id (str) – The new logical ID to use for this stack element.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Returns

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::CodeBuild::Project'
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]

attr_arn

The ARN of the AWS CodeBuild project, such as arn:aws:codebuild:us-west-2:123456789012:project/myProjectName .

CloudformationAttribute

Arn

Return type

str

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]

cfn_options

Options for this resource, such as condition, update policy etc.

Return type

ICfnResourceOptions

cfn_resource_type

AWS resource type.

Return type

str

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]

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

Return type

List[str]

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]

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Return type

str

Returns

the logical ID as a stringified token. This value will only get resolved during synthesis.

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]

node

The construct tree node associated with this construct.

Return type

ConstructNode

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]

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Return type

str

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]

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Return type

Stack

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

TagManager

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]

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters

x (Any) –

Return type

bool

Returns

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters

construct (IConstruct) –

Return type

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

ArtifactsProperty

class CfnProject.ArtifactsProperty(*, type, artifact_identifier=None, encryption_disabled=None, location=None, name=None, namespace_type=None, override_artifact_name=None, packaging=None, path=None)

Bases: object

Artifacts is a property of the AWS::CodeBuild::Project resource that specifies output settings for artifacts generated by an AWS CodeBuild build.

Parameters
  • type (str) – The type of build output artifact. Valid values include:. - CODEPIPELINE : The build project has build output generated through CodePipeline. .. epigraph:: The CODEPIPELINE type is not supported for secondaryArtifacts . - NO_ARTIFACTS : The build project does not produce any build output. - S3 : The build project stores build output in Amazon S3.

  • artifact_identifier (Optional[str]) – An identifier for this artifact definition.

  • encryption_disabled (Union[bool, IResolvable, None]) – Set to true if you do not want your output artifacts encrypted. This option is valid only if your artifacts type is Amazon Simple Storage Service (Amazon S3). If this is set with another artifacts type, an invalidInputException is thrown.

  • location (Optional[str]) – Information about the build output artifact location:. - If type is set to CODEPIPELINE , AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output locations instead of CodeBuild . - If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced. - If type is set to S3 , this is the name of the output bucket. If you specify CODEPIPELINE or NO_ARTIFACTS for the Type property, don’t specify this property. For all of the other types, you must specify this property.

  • name (Optional[str]) – Along with path and namespaceType , the pattern that AWS CodeBuild uses to name and store the output artifact:. - If type is set to CODEPIPELINE , AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild . - If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced. - If type is set to S3 , this is the name of the output artifact object. If you set the name to be a forward slash (“/”), the artifact is stored in the root of the output bucket. For example: - If path is set to MyArtifacts , namespaceType is set to BUILD_ID , and name is set to MyArtifact.zip , then the output artifact is stored in MyArtifacts/ *build-ID* /MyArtifact.zip . - If path is empty, namespaceType is set to NONE , and name is set to ” / “, the output artifact is stored in the root of the output bucket. - If path is set to MyArtifacts , namespaceType is set to BUILD_ID , and name is set to ” / “, the output artifact is stored in MyArtifacts/ *build-ID* . If you specify CODEPIPELINE or NO_ARTIFACTS for the Type property, don’t specify this property. For all of the other types, you must specify this property.

  • namespace_type (Optional[str]) – Along with path and name , the pattern that AWS CodeBuild uses to determine the name and location to store the output artifact: - If type is set to CODEPIPELINE , CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild . - If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced. - If type is set to S3 , valid values include: - BUILD_ID : Include the build ID in the location of the build output artifact. - NONE : Do not include the build ID. This is the default if namespaceType is not specified. For example, if path is set to MyArtifacts , namespaceType is set to BUILD_ID , and name is set to MyArtifact.zip , the output artifact is stored in MyArtifacts/<build-ID>/MyArtifact.zip .

  • override_artifact_name (Union[bool, IResolvable, None]) – If set to true a name specified in the buildspec file overrides the artifact name. The name specified in a buildspec file is calculated at build time and uses the Shell command language. For example, you can append a date and time to your artifact name so that it is always unique.

  • packaging (Optional[str]) – The type of build output artifact to create:. - If type is set to CODEPIPELINE , CodePipeline ignores this value if specified. This is because CodePipeline manages its build output artifacts instead of AWS CodeBuild . - If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced. - If type is set to S3 , valid values include: - NONE : AWS CodeBuild creates in the output bucket a folder that contains the build output. This is the default if packaging is not specified. - ZIP : AWS CodeBuild creates in the output bucket a ZIP file that contains the build output.

  • path (Optional[str]) – Along with namespaceType and name , the pattern that AWS CodeBuild uses to name and store the output artifact:. - If type is set to CODEPIPELINE , CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild . - If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced. - If type is set to S3 , this is the path to the output artifact. If path is not specified, path is not used. For example, if path is set to MyArtifacts , namespaceType is set to NONE , and name is set to MyArtifact.zip , the output artifact is stored in the output bucket at MyArtifacts/MyArtifact.zip .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-artifacts.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

artifacts_property = 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"
)

Attributes

artifact_identifier

An identifier for this artifact definition.

Link

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

Return type

Optional[str]

encryption_disabled

Set to true if you do not want your output artifacts encrypted.

This option is valid only if your artifacts type is Amazon Simple Storage Service (Amazon S3). If this is set with another artifacts type, an invalidInputException is thrown.

Link

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

Return type

Union[bool, IResolvable, None]

location

.

  • If type is set to CODEPIPELINE , AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output locations instead of CodeBuild .

  • If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced.

  • If type is set to S3 , this is the name of the output bucket.

If you specify CODEPIPELINE or NO_ARTIFACTS for the Type property, don’t specify this property. For all of the other types, you must specify this property.

Link

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

Type

Information about the build output artifact location

Return type

Optional[str]

name

.

  • If type is set to CODEPIPELINE , AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild .

  • If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced.

  • If type is set to S3 , this is the name of the output artifact object. If you set the name to be a forward slash (“/”), the artifact is stored in the root of the output bucket.

For example:

  • If path is set to MyArtifacts , namespaceType is set to BUILD_ID , and name is set to MyArtifact.zip , then the output artifact is stored in MyArtifacts/ *build-ID* /MyArtifact.zip .

  • If path is empty, namespaceType is set to NONE , and name is set to ” / “, the output artifact is stored in the root of the output bucket.

  • If path is set to MyArtifacts , namespaceType is set to BUILD_ID , and name is set to ” / “, the output artifact is stored in MyArtifacts/ *build-ID* .

If you specify CODEPIPELINE or NO_ARTIFACTS for the Type property, don’t specify this property. For all of the other types, you must specify this property.

Link

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

Type

Along with path and namespaceType , the pattern that AWS CodeBuild uses to name and store the output artifact

Return type

Optional[str]

namespace_type
  • If type is set to CODEPIPELINE , CodePipeline ignores this value if specified.

This is because CodePipeline manages its build output names instead of AWS CodeBuild .

  • If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced.

  • If type is set to S3 , valid values include:

  • BUILD_ID : Include the build ID in the location of the build output artifact.

  • NONE : Do not include the build ID. This is the default if namespaceType is not specified.

For example, if path is set to MyArtifacts , namespaceType is set to BUILD_ID , and name is set to MyArtifact.zip , the output artifact is stored in MyArtifacts/<build-ID>/MyArtifact.zip .

Link

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

Type

Along with path and name , the pattern that AWS CodeBuild uses to determine the name and location to store the output artifact

Return type

Optional[str]

override_artifact_name

If set to true a name specified in the buildspec file overrides the artifact name.

The name specified in a buildspec file is calculated at build time and uses the Shell command language. For example, you can append a date and time to your artifact name so that it is always unique.

Link

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

Return type

Union[bool, IResolvable, None]

packaging

.

  • If type is set to CODEPIPELINE , CodePipeline ignores this value if specified. This is because CodePipeline manages its build output artifacts instead of AWS CodeBuild .

  • If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced.

  • If type is set to S3 , valid values include:

  • NONE : AWS CodeBuild creates in the output bucket a folder that contains the build output. This is the default if packaging is not specified.

  • ZIP : AWS CodeBuild creates in the output bucket a ZIP file that contains the build output.

Link

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

Type

The type of build output artifact to create

Return type

Optional[str]

path

.

  • If type is set to CODEPIPELINE , CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild .

  • If type is set to NO_ARTIFACTS , this value is ignored if specified, because no build output is produced.

  • If type is set to S3 , this is the path to the output artifact. If path is not specified, path is not used.

For example, if path is set to MyArtifacts , namespaceType is set to NONE , and name is set to MyArtifact.zip , the output artifact is stored in the output bucket at MyArtifacts/MyArtifact.zip .

Link

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

Type

Along with namespaceType and name , the pattern that AWS CodeBuild uses to name and store the output artifact

Return type

Optional[str]

type

.

  • CODEPIPELINE : The build project has build output generated through CodePipeline.

The CODEPIPELINE type is not supported for secondaryArtifacts .

  • NO_ARTIFACTS : The build project does not produce any build output.

  • S3 : The build project stores build output in Amazon S3.

Link

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

Type

The type of build output artifact. Valid values include

Return type

str

BatchRestrictionsProperty

class CfnProject.BatchRestrictionsProperty(*, compute_types_allowed=None, maximum_builds_allowed=None)

Bases: object

Specifies restrictions for the batch build.

Parameters
  • compute_types_allowed (Optional[Sequence[str]]) – An array of strings that specify the compute types that are allowed for the batch build. See Build environment compute types in the AWS CodeBuild User Guide for these values.

  • maximum_builds_allowed (Union[int, float, None]) – Specifies the maximum number of builds allowed.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-batchrestrictions.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

batch_restrictions_property = codebuild.CfnProject.BatchRestrictionsProperty(
    compute_types_allowed=["computeTypesAllowed"],
    maximum_builds_allowed=123
)

Attributes

compute_types_allowed

An array of strings that specify the compute types that are allowed for the batch build.

See Build environment compute types in the AWS CodeBuild User Guide for these values.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-batchrestrictions.html#cfn-codebuild-project-batchrestrictions-computetypesallowed

Return type

Optional[List[str]]

maximum_builds_allowed

Specifies the maximum number of builds allowed.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-batchrestrictions.html#cfn-codebuild-project-batchrestrictions-maximumbuildsallowed

Return type

Union[int, float, None]

BuildStatusConfigProperty

class CfnProject.BuildStatusConfigProperty(*, context=None, target_url=None)

Bases: object

Contains information that defines how the AWS CodeBuild build project reports the build status to the source provider.

Parameters
  • context (Optional[str]) – Specifies the context of the build status CodeBuild sends to the source provider. The usage of this parameter depends on the source provider. - Bitbucket - This parameter is used for the name parameter in the Bitbucket commit status. For more information, see build in the Bitbucket API documentation. - GitHub/GitHub Enterprise Server - This parameter is used for the context parameter in the GitHub commit status. For more information, see Create a commit status in the GitHub developer guide.

  • target_url (Optional[str]) –

    Specifies the target url of the build status CodeBuild sends to the source provider. The usage of this parameter depends on the source provider. - Bitbucket - This parameter is used for the url parameter in the Bitbucket commit status. For more information, see build in the Bitbucket API documentation. - GitHub/GitHub Enterprise Server - This parameter is used for the target_url parameter in the GitHub commit status. For more information, see Create a commit status in the GitHub developer guide.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-buildstatusconfig.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

build_status_config_property = codebuild.CfnProject.BuildStatusConfigProperty(
    context="context",
    target_url="targetUrl"
)

Attributes

context

Specifies the context of the build status CodeBuild sends to the source provider.

The usage of this parameter depends on the source provider.

  • Bitbucket - This parameter is used for the name parameter in the Bitbucket commit status. For more information, see build in the Bitbucket API documentation.

  • GitHub/GitHub Enterprise Server - This parameter is used for the context parameter in the GitHub commit status. For more information, see Create a commit status in the GitHub developer guide.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-buildstatusconfig.html#cfn-codebuild-project-buildstatusconfig-context

Return type

Optional[str]

target_url

Specifies the target url of the build status CodeBuild sends to the source provider.

The usage of this parameter depends on the source provider.

  • Bitbucket - This parameter is used for the url parameter in the Bitbucket commit status. For more information, see build in the Bitbucket API documentation.

  • GitHub/GitHub Enterprise Server - This parameter is used for the target_url parameter in the GitHub commit status. For more information, see Create a commit status in the GitHub developer guide.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-buildstatusconfig.html#cfn-codebuild-project-buildstatusconfig-targeturl

Return type

Optional[str]

CloudWatchLogsConfigProperty

class CfnProject.CloudWatchLogsConfigProperty(*, status, group_name=None, stream_name=None)

Bases: object

CloudWatchLogs is a property of the AWS CodeBuild Project LogsConfig property type that specifies settings for CloudWatch logs generated by an AWS CodeBuild build.

Parameters
  • status (str) – The current status of the logs in CloudWatch Logs for a build project. Valid values are:. - ENABLED : CloudWatch Logs are enabled for this build project. - DISABLED : CloudWatch Logs are not enabled for this build project.

  • group_name (Optional[str]) – The group name of the logs in CloudWatch Logs. For more information, see Working with Log Groups and Log Streams .

  • stream_name (Optional[str]) –

    The prefix of the stream name of the CloudWatch Logs. For more information, see Working with Log Groups and Log Streams .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-cloudwatchlogsconfig.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

cloud_watch_logs_config_property = codebuild.CfnProject.CloudWatchLogsConfigProperty(
    status="status",

    # the properties below are optional
    group_name="groupName",
    stream_name="streamName"
)

Attributes

group_name

The group name of the logs in CloudWatch Logs.

For more information, see Working with Log Groups and Log Streams .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-cloudwatchlogsconfig.html#cfn-codebuild-project-cloudwatchlogsconfig-groupname

Return type

Optional[str]

status

.

  • ENABLED : CloudWatch Logs are enabled for this build project.

  • DISABLED : CloudWatch Logs are not enabled for this build project.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-cloudwatchlogsconfig.html#cfn-codebuild-project-cloudwatchlogsconfig-status

Type

The current status of the logs in CloudWatch Logs for a build project. Valid values are

Return type

str

stream_name

The prefix of the stream name of the CloudWatch Logs.

For more information, see Working with Log Groups and Log Streams .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-cloudwatchlogsconfig.html#cfn-codebuild-project-cloudwatchlogsconfig-streamname

Return type

Optional[str]

EnvironmentProperty

class CfnProject.EnvironmentProperty(*, compute_type, image, type, certificate=None, environment_variables=None, image_pull_credentials_type=None, privileged_mode=None, registry_credential=None)

Bases: object

Environment is a property of the AWS::CodeBuild::Project resource that specifies the environment for an AWS CodeBuild project.

Parameters
  • compute_type (str) –

    The type of compute environment. This determines the number of CPU cores and memory the build environment uses. Available values include: - BUILD_GENERAL1_SMALL : Use up to 3 GB memory and 2 vCPUs for builds. - BUILD_GENERAL1_MEDIUM : Use up to 7 GB memory and 4 vCPUs for builds. - BUILD_GENERAL1_LARGE : Use up to 15 GB memory and 8 vCPUs for builds. For more information, see Build Environment Compute Types in the AWS CodeBuild User Guide.

  • image (str) – The image tag or image digest that identifies the Docker image to use for this build project. Use the following formats: - For an image tag: <registry>/<repository>:<tag> . For example, in the Docker repository that CodeBuild uses to manage its Docker images, this would be aws/codebuild/standard:4.0 . - For an image digest: <registry>/<repository>@<digest> . For example, to specify an image with the digest “sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf,” use <registry>/<repository>@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf . For more information, see Docker images provided by CodeBuild in the AWS CodeBuild user guide .

  • type (str) –

    The type of build environment to use for related builds. - The environment type ARM_CONTAINER is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Sydney), and EU (Frankfurt). - The environment type LINUX_CONTAINER with compute type build.general1.2xlarge is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney), China (Beijing), and China (Ningxia). - The environment type LINUX_GPU_CONTAINER is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney) , China (Beijing), and China (Ningxia). - The environment types WINDOWS_CONTAINER and WINDOWS_SERVER_2019_CONTAINER are available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), and EU (Ireland). For more information, see Build environment compute types in the AWS CodeBuild user guide .

  • certificate (Optional[str]) – The ARN of the Amazon S3 bucket, path prefix, and object key that contains the PEM-encoded certificate for the build project. For more information, see certificate in the AWS CodeBuild User Guide .

  • environment_variables (Union[IResolvable, Sequence[Union[EnvironmentVariableProperty, IResolvable]], None]) – A set of environment variables to make available to builds for this build project.

  • image_pull_credentials_type (Optional[str]) – The type of credentials AWS CodeBuild uses to pull images in your build. There are two valid values:. - CODEBUILD specifies that AWS CodeBuild uses its own credentials. This requires that you modify your ECR repository policy to trust AWS CodeBuild service principal. - SERVICE_ROLE specifies that AWS CodeBuild uses your build project’s service role. When you use a cross-account or private registry image, you must use SERVICE_ROLE credentials. When you use an AWS CodeBuild curated image, you must use CODEBUILD credentials.

  • privileged_mode (Union[bool, IResolvable, None]) – Enables running the Docker daemon inside a Docker container. Set to true only if the build project is used to build Docker images. Otherwise, a build that attempts to interact with the Docker daemon fails. The default setting is false . You can initialize the Docker daemon during the install phase of your build by adding one of the following sets of commands to the install phase of your buildspec file: If the operating system’s base image is Ubuntu Linux: - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay& - timeout 15 sh -c "until docker info; do echo .; sleep 1; done" If the operating system’s base image is Alpine Linux and the previous command does not work, add the -t argument to timeout : - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay& - timeout -t 15 sh -c "until docker info; do echo .; sleep 1; done"

  • registry_credential (Union[IResolvable, RegistryCredentialProperty, None]) – RegistryCredential is a property of the AWS::CodeBuild::Project Environment property that specifies information about credentials that provide access to a private Docker registry. When this is set:. - imagePullCredentialsType must be set to SERVICE_ROLE . - images cannot be curated or an Amazon ECR image.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.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

environment_property = 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"
    )
)

Attributes

certificate

The ARN of the Amazon S3 bucket, path prefix, and object key that contains the PEM-encoded certificate for the build project.

For more information, see certificate in the AWS CodeBuild User Guide .

Link

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

Return type

Optional[str]

compute_type

The type of compute environment.

This determines the number of CPU cores and memory the build environment uses. Available values include:

  • BUILD_GENERAL1_SMALL : Use up to 3 GB memory and 2 vCPUs for builds.

  • BUILD_GENERAL1_MEDIUM : Use up to 7 GB memory and 4 vCPUs for builds.

  • BUILD_GENERAL1_LARGE : Use up to 15 GB memory and 8 vCPUs for builds.

For more information, see Build Environment Compute Types in the AWS CodeBuild User Guide.

Link

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

Return type

str

environment_variables

A set of environment variables to make available to builds for this build project.

Link

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

Return type

Union[IResolvable, List[Union[EnvironmentVariableProperty, IResolvable]], None]

image

The image tag or image digest that identifies the Docker image to use for this build project.

Use the following formats:

  • For an image tag: <registry>/<repository>:<tag> . For example, in the Docker repository that CodeBuild uses to manage its Docker images, this would be aws/codebuild/standard:4.0 .

  • For an image digest: <registry>/<repository>@<digest> . For example, to specify an image with the digest “sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf,” use <registry>/<repository>@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf .

For more information, see Docker images provided by CodeBuild in the AWS CodeBuild user guide .

Link

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

Return type

str

image_pull_credentials_type

.

  • CODEBUILD specifies that AWS CodeBuild uses its own credentials. This requires that you modify your ECR repository policy to trust AWS CodeBuild service principal.

  • SERVICE_ROLE specifies that AWS CodeBuild uses your build project’s service role.

When you use a cross-account or private registry image, you must use SERVICE_ROLE credentials. When you use an AWS CodeBuild curated image, you must use CODEBUILD credentials.

Link

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

Type

The type of credentials AWS CodeBuild uses to pull images in your build. There are two valid values

Return type

Optional[str]

privileged_mode

Enables running the Docker daemon inside a Docker container.

Set to true only if the build project is used to build Docker images. Otherwise, a build that attempts to interact with the Docker daemon fails. The default setting is false .

You can initialize the Docker daemon during the install phase of your build by adding one of the following sets of commands to the install phase of your buildspec file:

If the operating system’s base image is Ubuntu Linux:

- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay&

- timeout 15 sh -c "until docker info; do echo .; sleep 1; done"

If the operating system’s base image is Alpine Linux and the previous command does not work, add the -t argument to timeout :

- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay&

- timeout -t 15 sh -c "until docker info; do echo .; sleep 1; done"

Link

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

Return type

Union[bool, IResolvable, None]

registry_credential

.

  • imagePullCredentialsType must be set to SERVICE_ROLE .

  • images cannot be curated or an Amazon ECR image.

Link

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

Type

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

Type

//docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-environment>`_ property that specifies information about credentials that provide access to a private Docker registry. When this is set

Return type

Union[IResolvable, RegistryCredentialProperty, None]

type

The type of build environment to use for related builds.

  • The environment type ARM_CONTAINER is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Sydney), and EU (Frankfurt).

  • The environment type LINUX_CONTAINER with compute type build.general1.2xlarge is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney), China (Beijing), and China (Ningxia).

  • The environment type LINUX_GPU_CONTAINER is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney) , China (Beijing), and China (Ningxia).

  • The environment types WINDOWS_CONTAINER and WINDOWS_SERVER_2019_CONTAINER are available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), and EU (Ireland).

For more information, see Build environment compute types in the AWS CodeBuild user guide .

Link

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

Return type

str

EnvironmentVariableProperty

class CfnProject.EnvironmentVariableProperty(*, name, value, type=None)

Bases: object

EnvironmentVariable is a property of the AWS CodeBuild Project Environment property type that specifies the name and value of an environment variable for an AWS CodeBuild project environment. When you use the environment to run a build, these variables are available for your builds to use. EnvironmentVariable contains a list of EnvironmentVariable property types.

Parameters
  • name (str) – The name or key of the environment variable.

  • value (str) – The value of the environment variable. .. epigraph:: We strongly discourage the use of PLAINTEXT environment variables to store sensitive values, especially AWS secret key IDs and secret access keys. PLAINTEXT environment variables can be displayed in plain text using the AWS CodeBuild console and the AWS CLI . For sensitive values, we recommend you use an environment variable of type PARAMETER_STORE or SECRETS_MANAGER .

  • type (Optional[str]) – The type of environment variable. Valid values include:. - PARAMETER_STORE : An environment variable stored in Systems Manager Parameter Store. To learn how to specify a parameter store environment variable, see env/parameter-store in the AWS CodeBuild User Guide . - PLAINTEXT : An environment variable in plain text format. This is the default value. - SECRETS_MANAGER : An environment variable stored in AWS Secrets Manager . To learn how to specify a secrets manager environment variable, see env/secrets-manager in the AWS CodeBuild User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environmentvariable.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

environment_variable_property = codebuild.CfnProject.EnvironmentVariableProperty(
    name="name",
    value="value",

    # the properties below are optional
    type="type"
)

Attributes

name

The name or key of the environment variable.

Link

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

Return type

str

type

.

  • PARAMETER_STORE : An environment variable stored in Systems Manager Parameter Store. To learn how to specify a parameter store environment variable, see env/parameter-store in the AWS CodeBuild User Guide .

  • PLAINTEXT : An environment variable in plain text format. This is the default value.

  • SECRETS_MANAGER : An environment variable stored in AWS Secrets Manager . To learn how to specify a secrets manager environment variable, see env/secrets-manager in the AWS CodeBuild User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environmentvariable.html#cfn-codebuild-project-environmentvariable-type

Type

The type of environment variable. Valid values include

Return type

Optional[str]

value

The value of the environment variable.

We strongly discourage the use of PLAINTEXT environment variables to store sensitive values, especially AWS secret key IDs and secret access keys. PLAINTEXT environment variables can be displayed in plain text using the AWS CodeBuild console and the AWS CLI . For sensitive values, we recommend you use an environment variable of type PARAMETER_STORE or SECRETS_MANAGER .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environmentvariable.html#cfn-codebuild-project-environmentvariable-value

Return type

str

GitSubmodulesConfigProperty

class CfnProject.GitSubmodulesConfigProperty(*, fetch_submodules)

Bases: object

GitSubmodulesConfig is a property of the AWS CodeBuild Project Source property type that specifies information about the Git submodules configuration for the build project.

Parameters

fetch_submodules (Union[bool, IResolvable]) – Set to true to fetch Git submodules for your AWS CodeBuild build project.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-gitsubmodulesconfig.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

git_submodules_config_property = codebuild.CfnProject.GitSubmodulesConfigProperty(
    fetch_submodules=False
)

Attributes

fetch_submodules

Set to true to fetch Git submodules for your AWS CodeBuild build project.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-gitsubmodulesconfig.html#cfn-codebuild-project-gitsubmodulesconfig-fetchsubmodules

Return type

Union[bool, IResolvable]

LogsConfigProperty

class CfnProject.LogsConfigProperty(*, cloud_watch_logs=None, s3_logs=None)

Bases: object

LogsConfig is a property of the AWS CodeBuild Project resource that specifies information about logs for a build project. These can be logs in Amazon CloudWatch Logs, built in a specified S3 bucket, or both.

Parameters
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-logsconfig.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

logs_config_property = 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"
    )
)

Attributes

cloud_watch_logs

Information about CloudWatch Logs for a build project.

CloudWatch Logs are enabled by default.

Link

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

Return type

Union[IResolvable, CloudWatchLogsConfigProperty, None]

s3_logs

Information about logs built to an S3 bucket for a build project.

S3 logs are not enabled by default.

Link

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

Return type

Union[IResolvable, S3LogsConfigProperty, None]

ProjectBuildBatchConfigProperty

class CfnProject.ProjectBuildBatchConfigProperty(*, batch_report_mode=None, combine_artifacts=None, restrictions=None, service_role=None, timeout_in_mins=None)

Bases: object

Contains configuration information about a batch build project.

Parameters
  • batch_report_mode (Optional[str]) – Specifies how build status reports are sent to the source provider for the batch build. This property is only used when the source provider for your project is Bitbucket, GitHub, or GitHub Enterprise, and your project is configured to report build statuses to the source provider. - REPORT_AGGREGATED_BATCH - (Default) Aggregate all of the build statuses into a single status report. - REPORT_INDIVIDUAL_BUILDS - Send a separate status report for each individual build.

  • combine_artifacts (Union[bool, IResolvable, None]) – Specifies if the build artifacts for the batch build should be combined into a single artifact location.

  • restrictions (Union[IResolvable, BatchRestrictionsProperty, None]) – A BatchRestrictions object that specifies the restrictions for the batch build.

  • service_role (Optional[str]) – Specifies the service role ARN for the batch build project.

  • timeout_in_mins (Union[int, float, None]) – Specifies the maximum amount of time, in minutes, that the batch build must be completed in.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectbuildbatchconfig.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

project_build_batch_config_property = 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
)

Attributes

batch_report_mode

Specifies how build status reports are sent to the source provider for the batch build.

This property is only used when the source provider for your project is Bitbucket, GitHub, or GitHub Enterprise, and your project is configured to report build statuses to the source provider.

  • REPORT_AGGREGATED_BATCH - (Default) Aggregate all of the build statuses into a single status report.

  • REPORT_INDIVIDUAL_BUILDS - Send a separate status report for each individual build.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectbuildbatchconfig.html#cfn-codebuild-project-projectbuildbatchconfig-batchreportmode

Return type

Optional[str]

combine_artifacts

Specifies if the build artifacts for the batch build should be combined into a single artifact location.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectbuildbatchconfig.html#cfn-codebuild-project-projectbuildbatchconfig-combineartifacts

Return type

Union[bool, IResolvable, None]

restrictions

A BatchRestrictions object that specifies the restrictions for the batch build.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectbuildbatchconfig.html#cfn-codebuild-project-projectbuildbatchconfig-restrictions

Return type

Union[IResolvable, BatchRestrictionsProperty, None]

service_role

Specifies the service role ARN for the batch build project.

Link

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

Return type

Optional[str]

timeout_in_mins

Specifies the maximum amount of time, in minutes, that the batch build must be completed in.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectbuildbatchconfig.html#cfn-codebuild-project-projectbuildbatchconfig-timeoutinmins

Return type

Union[int, float, None]

ProjectCacheProperty

class CfnProject.ProjectCacheProperty(*, type, location=None, modes=None)

Bases: object

ProjectCache is a property of the AWS CodeBuild Project resource that specifies information about the cache for the build project. If ProjectCache is not specified, then both of its properties default to NO_CACHE .

Parameters
  • type (str) – The type of cache used by the build project. Valid values include:. - NO_CACHE : The build project does not use any cache. - S3 : The build project reads and writes from and to S3. - LOCAL : The build project stores a cache locally on a build host that is only available to that build host.

  • location (Optional[str]) – Information about the cache location:. - NO_CACHE or LOCAL : This value is ignored. - S3 : This is the S3 bucket name/prefix.

  • modes (Optional[Sequence[str]]) – An array of strings that specify the local cache modes. You can use one or more local cache modes at the same time. This is only used for LOCAL cache types. Possible values are: - LOCAL_SOURCE_CACHE - Caches Git metadata for primary and secondary sources. After the cache is created, subsequent builds pull only the change between commits. This mode is a good choice for projects with a clean working directory and a source that is a large Git repository. If you choose this option and your project does not use a Git repository (GitHub, GitHub Enterprise, or Bitbucket), the option is ignored. - LOCAL_DOCKER_LAYER_CACHE - Caches existing Docker layers. This mode is a good choice for projects that build or pull large Docker images. It can prevent the performance issues caused by pulling large Docker images down from the network. .. epigraph:: - You can use a Docker layer cache in the Linux environment only. - The privileged flag must be set so that your project has the required Docker permissions. - You should consider the security implications before you use a Docker layer cache. - LOCAL_CUSTOM_CACHE - Caches directories you specify in the buildspec file. This mode is a good choice if your build scenario is not suited to one of the other three local cache modes. If you use a custom cache: - Only directories can be specified for caching. You cannot specify individual files. - Symlinks are used to reference cached directories. - Cached directories are linked to your build before it downloads its project sources. Cached items are overridden if a source item has the same name. Directories are specified using cache paths in the buildspec file.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectcache.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

project_cache_property = codebuild.CfnProject.ProjectCacheProperty(
    type="type",

    # the properties below are optional
    location="location",
    modes=["modes"]
)

Attributes

location

.

  • NO_CACHE or LOCAL : This value is ignored.

  • S3 : This is the S3 bucket name/prefix.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectcache.html#cfn-codebuild-project-projectcache-location

Type

Information about the cache location

Return type

Optional[str]

modes

An array of strings that specify the local cache modes.

You can use one or more local cache modes at the same time. This is only used for LOCAL cache types.

Possible values are:

  • LOCAL_SOURCE_CACHE - Caches Git metadata for primary and secondary sources. After the cache is created, subsequent builds pull only the change between commits. This mode is a good choice for projects with a clean working directory and a source that is a large Git repository. If you choose this option and your project does not use a Git repository (GitHub, GitHub Enterprise, or Bitbucket), the option is ignored.

  • LOCAL_DOCKER_LAYER_CACHE - Caches existing Docker layers. This mode is a good choice for projects that build or pull large Docker images. It can prevent the performance issues caused by pulling large Docker images down from the network.

  • You can use a Docker layer cache in the Linux environment only.

  • The privileged flag must be set so that your project has the required Docker permissions.

  • You should consider the security implications before you use a Docker layer cache.

  • LOCAL_CUSTOM_CACHE - Caches directories you specify in the buildspec file. This mode is a good choice if your build scenario is not suited to one of the other three local cache modes. If you use a custom cache:

  • Only directories can be specified for caching. You cannot specify individual files.

  • Symlinks are used to reference cached directories.

  • Cached directories are linked to your build before it downloads its project sources. Cached items are overridden if a source item has the same name. Directories are specified using cache paths in the buildspec file.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectcache.html#cfn-codebuild-project-projectcache-modes

Return type

Optional[List[str]]

type

.

  • NO_CACHE : The build project does not use any cache.

  • S3 : The build project reads and writes from and to S3.

  • LOCAL : The build project stores a cache locally on a build host that is only available to that build host.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectcache.html#cfn-codebuild-project-projectcache-type

Type

The type of cache used by the build project. Valid values include

Return type

str

ProjectFileSystemLocationProperty

class CfnProject.ProjectFileSystemLocationProperty(*, identifier, location, mount_point, type, mount_options=None)

Bases: object

Information about a file system created by Amazon Elastic File System (EFS).

For more information, see What Is Amazon Elastic File System?

Parameters
  • identifier (str) – The name used to access a file system created by Amazon EFS. CodeBuild creates an environment variable by appending the identifier in all capital letters to CODEBUILD_ . For example, if you specify my_efs for identifier , a new environment variable is create named CODEBUILD_MY_EFS . The identifier is used to mount your file system.

  • location (str) – A string that specifies the location of the file system created by Amazon EFS. Its format is efs-dns-name:/directory-path . You can find the DNS name of file system when you view it in the Amazon EFS console. The directory path is a path to a directory in the file system that CodeBuild mounts. For example, if the DNS name of a file system is fs-abcd1234.efs.us-west-2.amazonaws.com , and its mount directory is my-efs-mount-directory , then the location is fs-abcd1234.efs.us-west-2.amazonaws.com:/my-efs-mount-directory . The directory path in the format efs-dns-name:/directory-path is optional. If you do not specify a directory path, the location is only the DNS name and CodeBuild mounts the entire file system.

  • mount_point (str) – The location in the container where you mount the file system.

  • type (str) – The type of the file system. The one supported type is EFS .

  • mount_options (Optional[str]) – The mount options for a file system created by Amazon EFS. The default mount options used by CodeBuild are nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 . For more information, see Recommended NFS Mount Options .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.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

project_file_system_location_property = codebuild.CfnProject.ProjectFileSystemLocationProperty(
    identifier="identifier",
    location="location",
    mount_point="mountPoint",
    type="type",

    # the properties below are optional
    mount_options="mountOptions"
)

Attributes

identifier

The name used to access a file system created by Amazon EFS.

CodeBuild creates an environment variable by appending the identifier in all capital letters to CODEBUILD_ . For example, if you specify my_efs for identifier , a new environment variable is create named CODEBUILD_MY_EFS .

The identifier is used to mount your file system.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-identifier

Return type

str

location

A string that specifies the location of the file system created by Amazon EFS.

Its format is efs-dns-name:/directory-path . You can find the DNS name of file system when you view it in the Amazon EFS console. The directory path is a path to a directory in the file system that CodeBuild mounts. For example, if the DNS name of a file system is fs-abcd1234.efs.us-west-2.amazonaws.com , and its mount directory is my-efs-mount-directory , then the location is fs-abcd1234.efs.us-west-2.amazonaws.com:/my-efs-mount-directory .

The directory path in the format efs-dns-name:/directory-path is optional. If you do not specify a directory path, the location is only the DNS name and CodeBuild mounts the entire file system.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-location

Return type

str

mount_options

The mount options for a file system created by Amazon EFS.

The default mount options used by CodeBuild are nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 . For more information, see Recommended NFS Mount Options .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-mountoptions

Return type

Optional[str]

mount_point

The location in the container where you mount the file system.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-mountpoint

Return type

str

type

The type of the file system.

The one supported type is EFS .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-type

Return type

str

ProjectSourceVersionProperty

class CfnProject.ProjectSourceVersionProperty(*, source_identifier, source_version=None)

Bases: object

A source identifier and its corresponding version.

Parameters
  • source_identifier (str) – An identifier for a source in the build project. The identifier can only contain alphanumeric characters and underscores, and must be less than 128 characters in length.

  • source_version (Optional[str]) –

    The source version for the corresponding source identifier. If specified, 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. 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-properties-codebuild-project-projectsourceversion.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

project_source_version_property = codebuild.CfnProject.ProjectSourceVersionProperty(
    source_identifier="sourceIdentifier",

    # the properties below are optional
    source_version="sourceVersion"
)

Attributes

source_identifier

An identifier for a source in the build project.

The identifier can only contain alphanumeric characters and underscores, and must be less than 128 characters in length.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectsourceversion.html#cfn-codebuild-project-projectsourceversion-sourceidentifier

Return type

str

source_version

.

  • 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.

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-properties-codebuild-project-projectsourceversion.html#cfn-codebuild-project-projectsourceversion-sourceversion

Type

The source version for the corresponding source identifier. If specified, must be one of

Return type

Optional[str]

ProjectTriggersProperty

class CfnProject.ProjectTriggersProperty(*, build_type=None, filter_groups=None, webhook=None)

Bases: object

ProjectTriggers is a property of the AWS CodeBuild Project resource that specifies webhooks that trigger an AWS CodeBuild build.

Parameters
  • build_type (Optional[str]) – Specifies the type of build this webhook will trigger. Allowed values are:. - BUILD - A single build - BUILD_BATCH - A batch build

  • filter_groups (Union[IResolvable, Sequence[Union[IResolvable, Sequence[Union[WebhookFilterProperty, IResolvable]]]], None]) – A list of lists of WebhookFilter objects used to determine which webhook events are triggered. At least one WebhookFilter in the array must specify EVENT as its type.

  • webhook (Union[bool, IResolvable, None]) – Specifies whether or not 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-properties-codebuild-project-projecttriggers.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

project_triggers_property = 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
)

Attributes

build_type

.

  • BUILD - A single build

  • BUILD_BATCH - A batch build

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projecttriggers.html#cfn-codebuild-project-projecttriggers-buildtype

Type

Specifies the type of build this webhook will trigger. Allowed values are

Return type

Optional[str]

filter_groups

A list of lists of WebhookFilter objects used to determine which webhook events are triggered.

At least one WebhookFilter in the array must specify EVENT as its type.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projecttriggers.html#cfn-codebuild-project-projecttriggers-filtergroups

Return type

Union[IResolvable, List[Union[IResolvable, List[Union[WebhookFilterProperty, IResolvable]]]], None]

webhook

Specifies whether or not 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-properties-codebuild-project-projecttriggers.html#cfn-codebuild-project-projecttriggers-webhook

Return type

Union[bool, IResolvable, None]

RegistryCredentialProperty

class CfnProject.RegistryCredentialProperty(*, credential, credential_provider)

Bases: object

RegistryCredential is a property of the AWS CodeBuild Project Environment property type that specifies information about credentials that provide access to a private Docker registry. When this is set:.

  • imagePullCredentialsType must be set to SERVICE_ROLE .

  • images cannot be curated or an Amazon ECR image.

For more information, see Private Registry with AWS Secrets Manager Sample for AWS CodeBuild .

Parameters
  • credential (str) – The Amazon Resource Name (ARN) or name of credentials created using AWS Secrets Manager . .. epigraph:: The credential can use the name of the credentials only if they exist in your current AWS Region .

  • credential_provider (str) – The service that created the credentials to access a private Docker registry. The valid value, SECRETS_MANAGER, is for AWS Secrets Manager .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-registrycredential.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

registry_credential_property = codebuild.CfnProject.RegistryCredentialProperty(
    credential="credential",
    credential_provider="credentialProvider"
)

Attributes

credential

The Amazon Resource Name (ARN) or name of credentials created using AWS Secrets Manager .

The credential can use the name of the credentials only if they exist in your current AWS Region .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-registrycredential.html#cfn-codebuild-project-registrycredential-credential

Return type

str

credential_provider

The service that created the credentials to access a private Docker registry.

The valid value, SECRETS_MANAGER, is for AWS Secrets Manager .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-registrycredential.html#cfn-codebuild-project-registrycredential-credentialprovider

Return type

str

S3LogsConfigProperty

class CfnProject.S3LogsConfigProperty(*, status, encryption_disabled=None, location=None)

Bases: object

S3Logs is a property of the AWS CodeBuild Project LogsConfig property type that specifies settings for logs generated by an AWS CodeBuild build in an S3 bucket.

Parameters
  • status (str) – The current status of the S3 build logs. Valid values are:. - ENABLED : S3 build logs are enabled for this build project. - DISABLED : S3 build logs are not enabled for this build project.

  • encryption_disabled (Union[bool, IResolvable, None]) – Set to true if you do not want your S3 build log output encrypted. By default S3 build logs are encrypted.

  • location (Optional[str]) – The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 bucket name is my-bucket , and your path prefix is build-log , then acceptable formats are my-bucket/build-log or arn:aws:s3:::my-bucket/build-log .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-s3logsconfig.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

s3_logs_config_property = codebuild.CfnProject.S3LogsConfigProperty(
    status="status",

    # the properties below are optional
    encryption_disabled=False,
    location="location"
)

Attributes

encryption_disabled

Set to true if you do not want your S3 build log output encrypted.

By default S3 build logs are encrypted.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-s3logsconfig.html#cfn-codebuild-project-s3logsconfig-encryptiondisabled

Return type

Union[bool, IResolvable, None]

location

The ARN of an S3 bucket and the path prefix for S3 logs.

If your Amazon S3 bucket name is my-bucket , and your path prefix is build-log , then acceptable formats are my-bucket/build-log or arn:aws:s3:::my-bucket/build-log .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-s3logsconfig.html#cfn-codebuild-project-s3logsconfig-location

Return type

Optional[str]

status

.

  • ENABLED : S3 build logs are enabled for this build project.

  • DISABLED : S3 build logs are not enabled for this build project.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-s3logsconfig.html#cfn-codebuild-project-s3logsconfig-status

Type

The current status of the S3 build logs. Valid values are

Return type

str

SourceAuthProperty

class CfnProject.SourceAuthProperty(*, type, resource=None)

Bases: object

SourceAuth is a property of the AWS CodeBuild Project Source property type that specifies authorization settings for AWS CodeBuild to access the source code to be built.

SourceAuth is for use by the CodeBuild console only. Do not get or set it directly.

Parameters
  • type (str) – The authorization type to use. The only valid value is OAUTH , which represents the OAuth authorization type. .. epigraph:: This data type is used by the AWS CodeBuild console only.

  • resource (Optional[str]) – The resource value that applies to the specified authorization type. .. epigraph:: This data type is used by the AWS CodeBuild console only.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-sourceauth.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

source_auth_property = codebuild.CfnProject.SourceAuthProperty(
    type="type",

    # the properties below are optional
    resource="resource"
)

Attributes

resource

The resource value that applies to the specified authorization type.

This data type is used by the AWS CodeBuild console only.

Link

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

Return type

Optional[str]

type

The authorization type to use. The only valid value is OAUTH , which represents the OAuth authorization type.

This data type is used by the AWS CodeBuild console only.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-sourceauth.html#cfn-codebuild-project-sourceauth-type

Return type

str

SourceProperty

class CfnProject.SourceProperty(*, type, auth=None, build_spec=None, build_status_config=None, git_clone_depth=None, git_submodules_config=None, insecure_ssl=None, location=None, report_build_status=None, source_identifier=None)

Bases: object

Source is a property of the AWS::CodeBuild::Project resource that specifies the source code settings for the project, such as the source code’s repository type and location.

Parameters
  • type (str) – The type of repository that contains the source code to be built. Valid values include:. - BITBUCKET : The source code is in a Bitbucket repository. - CODECOMMIT : The source code is in an CodeCommit repository. - CODEPIPELINE : The source code settings are specified in the source action of a pipeline in CodePipeline. - GITHUB : The source code is in a GitHub or GitHub Enterprise Cloud repository. - GITHUB_ENTERPRISE : The source code is in a GitHub Enterprise Server repository. - NO_SOURCE : The project does not have input source code. - S3 : The source code is in an Amazon S3 bucket.

  • auth (Union[IResolvable, SourceAuthProperty, None]) – Information about the authorization settings for AWS CodeBuild to access the source code to be built. This information is for the AWS CodeBuild console’s use only. Your code should not get or set Auth directly.

  • build_spec (Optional[str]) – The build specification for the project. If this value is not provided, then the source code must contain a buildspec file named buildspec.yml at the root level. If this value is provided, it can be either a single string containing the entire build specification, or the path to an alternate buildspec file relative to the value of the built-in environment variable CODEBUILD_SRC_DIR . The alternate buildspec file can have a name other than buildspec.yml , for example myspec.yml or build_spec_qa.yml or similar. For more information, see the Build Spec Reference in the AWS CodeBuild User Guide .

  • build_status_config (Union[IResolvable, BuildStatusConfigProperty, None]) – Contains information that defines how the build project reports the build status to the source provider. This option is only used when the source provider is GITHUB , GITHUB_ENTERPRISE , or BITBUCKET .

  • git_clone_depth (Union[int, float, None]) – The depth of history to download. Minimum value is 0. If this value is 0, greater than 25, or not provided, then the full history is downloaded with each build project. If your source type is Amazon S3, this value is not supported.

  • git_submodules_config (Union[IResolvable, GitSubmodulesConfigProperty, None]) – Information about the Git submodules configuration for the build project.

  • insecure_ssl (Union[bool, IResolvable, None]) – This is used with GitHub Enterprise only. Set to true to ignore SSL warnings while connecting to your GitHub Enterprise project repository. The default value is false . InsecureSsl should be used for testing purposes only. It should not be used in a production environment.

  • location (Optional[str]) – Information about the location of the source code to be built. Valid values include:. - For source code settings that are specified in the source action of a pipeline in CodePipeline, location should not be specified. If it is specified, CodePipeline ignores it. This is because CodePipeline uses the settings in a pipeline’s source action instead of this value. - For source code in an CodeCommit repository, the HTTPS clone URL to the repository that contains the source code and the buildspec file (for example, https://git-codecommit.<region-ID>.amazonaws.com/v1/repos/<repo-name> ). - For source code in an Amazon S3 input bucket, one of the following. - The path to the ZIP file that contains the source code (for example, <bucket-name>/<path>/<object-name>.zip ). - The path to the folder that contains the source code (for example, <bucket-name>/<path-to-source-code>/<folder>/ ). - For source code in a GitHub repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your AWS account to your GitHub account. Use the AWS CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with GitHub, on the GitHub Authorize application page, for Organization access , choose Request access next to each repository you want to allow AWS CodeBuild to have access to, and then choose Authorize application . (After you have connected to your GitHub account, you do not need to finish creating the build project. You can leave the AWS CodeBuild console.) To instruct AWS CodeBuild to use this connection, in the source object, set the auth object’s type value to OAUTH . - For source code in a Bitbucket repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your AWS account to your Bitbucket account. Use the AWS CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with Bitbucket, on the Bitbucket Confirm access to your account page, choose Grant access . (After you have connected to your Bitbucket account, you do not need to finish creating the build project. You can leave the AWS CodeBuild console.) To instruct AWS CodeBuild to use this connection, in the source object, set the auth object’s type value to OAUTH . If you specify CODEPIPELINE for the Type property, don’t specify this property. For all of the other types, you must specify Location .

  • report_build_status (Union[bool, IResolvable, None]) – Set to true to report the status of a build’s start and finish to your source provider. This option is valid only when your source provider is GitHub, GitHub Enterprise, or Bitbucket. If this is set and you use a different source provider, an invalidInputException is thrown.

  • source_identifier (Optional[str]) – An identifier for this project source. The identifier can only contain alphanumeric characters and underscores, and must be less than 128 characters in length.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.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

source_property = 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"
)

Attributes

auth

Information about the authorization settings for AWS CodeBuild to access the source code to be built.

This information is for the AWS CodeBuild console’s use only. Your code should not get or set Auth directly.

Link

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

Return type

Union[IResolvable, SourceAuthProperty, None]

build_spec

The build specification for the project.

If this value is not provided, then the source code must contain a buildspec file named buildspec.yml at the root level. If this value is provided, it can be either a single string containing the entire build specification, or the path to an alternate buildspec file relative to the value of the built-in environment variable CODEBUILD_SRC_DIR . The alternate buildspec file can have a name other than buildspec.yml , for example myspec.yml or build_spec_qa.yml or similar. For more information, see the Build Spec Reference in the AWS CodeBuild User Guide .

Link

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

Return type

Optional[str]

build_status_config

Contains information that defines how the build project reports the build status to the source provider.

This option is only used when the source provider is GITHUB , GITHUB_ENTERPRISE , or BITBUCKET .

Link

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

Return type

Union[IResolvable, BuildStatusConfigProperty, None]

git_clone_depth

The depth of history to download.

Minimum value is 0. If this value is 0, greater than 25, or not provided, then the full history is downloaded with each build project. If your source type is Amazon S3, this value is not supported.

Link

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

Return type

Union[int, float, None]

git_submodules_config

Information about the Git submodules configuration for the build project.

Link

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

Return type

Union[IResolvable, GitSubmodulesConfigProperty, None]

insecure_ssl

This is used with GitHub Enterprise only.

Set to true to ignore SSL warnings while connecting to your GitHub Enterprise project repository. The default value is false . InsecureSsl should be used for testing purposes only. It should not be used in a production environment.

Link

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

Return type

Union[bool, IResolvable, None]

location

.

  • For source code settings that are specified in the source action of a pipeline in CodePipeline, location should not be specified. If it is specified, CodePipeline ignores it. This is because CodePipeline uses the settings in a pipeline’s source action instead of this value.

  • For source code in an CodeCommit repository, the HTTPS clone URL to the repository that contains the source code and the buildspec file (for example, https://git-codecommit.<region-ID>.amazonaws.com/v1/repos/<repo-name> ).

  • For source code in an Amazon S3 input bucket, one of the following.

  • The path to the ZIP file that contains the source code (for example, <bucket-name>/<path>/<object-name>.zip ).

  • The path to the folder that contains the source code (for example, <bucket-name>/<path-to-source-code>/<folder>/ ).

  • For source code in a GitHub repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your AWS account to your GitHub account. Use the AWS CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with GitHub, on the GitHub Authorize application page, for Organization access , choose Request access next to each repository you want to allow AWS CodeBuild to have access to, and then choose Authorize application . (After you have connected to your GitHub account, you do not need to finish creating the build project. You can leave the AWS CodeBuild console.) To instruct AWS CodeBuild to use this connection, in the source object, set the auth object’s type value to OAUTH .

  • For source code in a Bitbucket repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your AWS account to your Bitbucket account. Use the AWS CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with Bitbucket, on the Bitbucket Confirm access to your account page, choose Grant access . (After you have connected to your Bitbucket account, you do not need to finish creating the build project. You can leave the AWS CodeBuild console.) To instruct AWS CodeBuild to use this connection, in the source object, set the auth object’s type value to OAUTH .

If you specify CODEPIPELINE for the Type property, don’t specify this property. For all of the other types, you must specify Location .

Link

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

Type

Information about the location of the source code to be built. Valid values include

Return type

Optional[str]

report_build_status

Set to true to report the status of a build’s start and finish to your source provider.

This option is valid only when your source provider is GitHub, GitHub Enterprise, or Bitbucket. If this is set and you use a different source provider, an invalidInputException is thrown.

Link

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

Return type

Union[bool, IResolvable, None]

source_identifier

An identifier for this project source.

The identifier can only contain alphanumeric characters and underscores, and must be less than 128 characters in length.

Link

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

Return type

Optional[str]

type

.

  • BITBUCKET : The source code is in a Bitbucket repository.

  • CODECOMMIT : The source code is in an CodeCommit repository.

  • CODEPIPELINE : The source code settings are specified in the source action of a pipeline in CodePipeline.

  • GITHUB : The source code is in a GitHub or GitHub Enterprise Cloud repository.

  • GITHUB_ENTERPRISE : The source code is in a GitHub Enterprise Server repository.

  • NO_SOURCE : The project does not have input source code.

  • S3 : The source code is in an Amazon S3 bucket.

Link

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

Type

The type of repository that contains the source code to be built. Valid values include

Return type

str

VpcConfigProperty

class CfnProject.VpcConfigProperty(*, security_group_ids=None, subnets=None, vpc_id=None)

Bases: object

VpcConfig is a property of the AWS::CodeBuild::Project resource 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 .

Parameters
  • security_group_ids (Optional[Sequence[str]]) – A list of one or more security groups IDs in your Amazon VPC. The maximum count is 5.

  • subnets (Optional[Sequence[str]]) – A list of one or more subnet IDs in your Amazon VPC. The maximum count is 16.

  • vpc_id (Optional[str]) – The ID of the Amazon VPC.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-vpcconfig.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

vpc_config_property = codebuild.CfnProject.VpcConfigProperty(
    security_group_ids=["securityGroupIds"],
    subnets=["subnets"],
    vpc_id="vpcId"
)

Attributes

security_group_ids

A list of one or more security groups IDs in your Amazon VPC.

The maximum count is 5.

Link

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

Return type

Optional[List[str]]

subnets

A list of one or more subnet IDs in your Amazon VPC.

The maximum count is 16.

Link

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

Return type

Optional[List[str]]

vpc_id

The ID of the Amazon VPC.

Link

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

Return type

Optional[str]

WebhookFilterProperty

class CfnProject.WebhookFilterProperty(*, pattern, type, exclude_matched_pattern=None)

Bases: object

WebhookFilter is a structure of the FilterGroups property on the AWS CodeBuild Project ProjectTriggers property type that specifies which webhooks trigger an AWS CodeBuild build.

Parameters
  • pattern (str) – For a WebHookFilter that uses EVENT type, a comma-separated string that specifies one or more events. For example, the webhook filter PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED allows all push, pull request created, and pull request updated events to trigger a build. For a WebHookFilter that uses any of the other filter types, a regular expression pattern. For example, a WebHookFilter that uses HEAD_REF for its type and the pattern ^refs/heads/ triggers a build when the head reference is a branch with a reference name refs/heads/branch-name .

  • type (str) – The type of webhook filter. There are six webhook filter types: EVENT , ACTOR_ACCOUNT_ID , HEAD_REF , BASE_REF , FILE_PATH , and COMMIT_MESSAGE . - EVENT - A webhook event triggers a build when the provided pattern matches one of five event types: PUSH , PULL_REQUEST_CREATED , PULL_REQUEST_UPDATED , PULL_REQUEST_REOPENED , and PULL_REQUEST_MERGED . The EVENT patterns are specified as a comma-separated string. For example, PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED filters all push, pull request created, and pull request updated events. .. epigraph:: The PULL_REQUEST_REOPENED works with GitHub and GitHub Enterprise only. - ACTOR_ACCOUNT_ID - A webhook event triggers a build when a GitHub, GitHub Enterprise, or Bitbucket account ID matches the regular expression pattern . - HEAD_REF - A webhook event triggers a build when the head reference matches the regular expression pattern . For example, refs/heads/branch-name and refs/tags/tag-name . Works with GitHub and GitHub Enterprise push, GitHub and GitHub Enterprise pull request, Bitbucket push, and Bitbucket pull request events. - BASE_REF - A webhook event triggers a build when the base reference matches the regular expression pattern . For example, refs/heads/branch-name . .. epigraph:: Works with pull request events only. - FILE_PATH - A webhook triggers a build when the path of a changed file matches the regular expression pattern . .. epigraph:: Works with GitHub and Bitbucket events push and pull requests events. Also works with GitHub Enterprise push events, but does not work with GitHub Enterprise pull request events. - COMMIT_MESSAGE - A webhook triggers a build when the head commit message matches the regular expression pattern . .. epigraph:: Works with GitHub and Bitbucket events push and pull requests events. Also works with GitHub Enterprise push events, but does not work with GitHub Enterprise pull request events.

  • exclude_matched_pattern (Union[bool, IResolvable, None]) – Used to indicate that the pattern determines which webhook events do not trigger a build. If true, then a webhook event that does not match the pattern triggers a build. If false, then a webhook event that matches the pattern triggers a build.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-webhookfilter.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

webhook_filter_property = codebuild.CfnProject.WebhookFilterProperty(
    pattern="pattern",
    type="type",

    # the properties below are optional
    exclude_matched_pattern=False
)

Attributes

exclude_matched_pattern

Used to indicate that the pattern determines which webhook events do not trigger a build.

If true, then a webhook event that does not match the pattern triggers a build. If false, then a webhook event that matches the pattern triggers a build.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-webhookfilter.html#cfn-codebuild-project-webhookfilter-excludematchedpattern

Return type

Union[bool, IResolvable, None]

pattern

For a WebHookFilter that uses EVENT type, a comma-separated string that specifies one or more events.

For example, the webhook filter PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED allows all push, pull request created, and pull request updated events to trigger a build.

For a WebHookFilter that uses any of the other filter types, a regular expression pattern. For example, a WebHookFilter that uses HEAD_REF for its type and the pattern ^refs/heads/ triggers a build when the head reference is a branch with a reference name refs/heads/branch-name .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-webhookfilter.html#cfn-codebuild-project-webhookfilter-pattern

Return type

str

type

The type of webhook filter.

There are six webhook filter types: EVENT , ACTOR_ACCOUNT_ID , HEAD_REF , BASE_REF , FILE_PATH , and COMMIT_MESSAGE .

  • EVENT - A webhook event triggers a build when the provided pattern matches one of five event types: PUSH , PULL_REQUEST_CREATED , PULL_REQUEST_UPDATED , PULL_REQUEST_REOPENED , and PULL_REQUEST_MERGED . The EVENT patterns are specified as a comma-separated string. For example, PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED filters all push, pull request created, and pull request updated events.

The PULL_REQUEST_REOPENED works with GitHub and GitHub Enterprise only.

  • ACTOR_ACCOUNT_ID - A webhook event triggers a build when a GitHub, GitHub Enterprise, or Bitbucket account ID matches the regular expression pattern .

  • HEAD_REF - A webhook event triggers a build when the head reference matches the regular expression pattern . For example, refs/heads/branch-name and refs/tags/tag-name .

Works with GitHub and GitHub Enterprise push, GitHub and GitHub Enterprise pull request, Bitbucket push, and Bitbucket pull request events.

  • BASE_REF - A webhook event triggers a build when the base reference matches the regular expression pattern . For example, refs/heads/branch-name .

Works with pull request events only.

  • FILE_PATH - A webhook triggers a build when the path of a changed file matches the regular expression pattern .

Works with GitHub and Bitbucket events push and pull requests events. Also works with GitHub Enterprise push events, but does not work with GitHub Enterprise pull request events.

  • COMMIT_MESSAGE - A webhook triggers a build when the head commit message matches the regular expression pattern .

Works with GitHub and Bitbucket events push and pull requests events. Also works with GitHub Enterprise push events, but does not work with GitHub Enterprise pull request events.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-webhookfilter.html#cfn-codebuild-project-webhookfilter-type

Return type

str