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: CfnResource

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. .. epigraph:

To unset or remove a project value via CFN, explicitly provide the attribute with value as empty input.
See:

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

CloudformationResource:

AWS::CodeBuild::Project

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import 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"
        )],
        fleet=codebuild.CfnProject.ProjectFleetProperty(
            fleet_arn="fleetArn"
        ),
        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"
    )
)
Parameters:
  • scope (Construct) – Scope in which this resource is defined.

  • id (str) – Construct identifier for this resource (unique in its scope).

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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_dependency(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_depends_on(target)

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

Parameters:

target (CfnResource) –

Deprecated:

use addDependency

Stability:

deprecated

Return type:

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters:
  • key (str) –

  • value (Any) –

See:

Return type:

None

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.

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 intermediate 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). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

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 resource, please consult that specific resource’s documentation.

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options

Return type:

None

get_att(attribute_name, type_hint=None)

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.

  • type_hint (Optional[ResolutionTypeHint]) –

Return type:

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters:

key (str) –

See:

Return type:

Any

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.

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters:

inspector (TreeInspector) – tree inspector to collect and process attributes.

Return type:

None

obtain_dependencies()

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.

Return type:

List[Union[Stack, CfnResource]]

obtain_resource_dependencies()

Get a shallow copy of dependencies between this resource and other resources in the same stack.

Return type:

List[CfnResource]

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

remove_dependency(target)

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

replace_dependency(target, new_target)

Replaces one dependency with another.

Parameters:
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.

Type:

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

attr_arn

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

CloudformationAttribute:

Arn

attr_id

Id

Type:

cloudformationAttribute

badge_enabled

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

build_batch_config

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

cache

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

cfn_options

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

cfn_resource_type

AWS resource type.

concurrent_build_limit

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

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.

description

A description that makes the build project easy to identify.

encryption_key

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

environment

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

file_system_locations

An array of ProjectFileSystemLocation objects for a CodeBuild build project.

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

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.

name

The name of the build project.

node

The tree node.

queued_timeout_in_minutes

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

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 }).

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.

secondary_artifacts

A list of Artifacts objects.

secondary_source_versions

An array of ProjectSourceVersion objects.

secondary_sources

An array of ProjectSource objects.

service_role

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

source

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

source_version

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

stack

The stack in which this element is defined.

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

tags

Tag Manager which manages the tags for this resource.

tags_raw

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

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.

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.

visibility

Specifies the visibility of the project’s builds.

Possible values are:.

vpc_config

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

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(x)

Check whether the given object is a CfnResource.

Parameters:

x (Any) –

Return type:

bool

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

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 .

See:

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.
from aws_cdk import 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.

See:

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

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.

See:

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

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.

See:

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

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.

See:

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

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 .

See:

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

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.

See:

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

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.

See:

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

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 .

See:

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

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.

See:

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

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.

See:

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.
from aws_cdk import 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.

See:

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

maximum_builds_allowed

Specifies the maximum number of builds allowed.

See:

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

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.

See:

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.
from aws_cdk import 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.

See:

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

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.

See:

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

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 .

See:

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.
from aws_cdk import 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 .

See:

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

status

.

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

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

See:

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

stream_name

The prefix of the stream name of the CloudWatch Logs.

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

See:

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

EnvironmentProperty

class CfnProject.EnvironmentProperty(*, compute_type, image, type, certificate=None, environment_variables=None, fleet=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 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 ARM_LAMBDA_CONTAINER and LINUX_LAMBDA_CONTAINER are available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific (Mumbai), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), EU (Frankfurt), EU (Ireland), and South America (São Paulo). - 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). .. epigraph:: If you’re using compute fleets during project creation, type will be ignored. 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[IResolvable, EnvironmentVariableProperty, Dict[str, Any]]], None]) – A set of environment variables to make available to builds for this build project.

  • fleet (Union[IResolvable, ProjectFleetProperty, Dict[str, Any], None]) –

  • 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, Dict[str, Any], 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.

See:

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.
from aws_cdk import 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"
    )],
    fleet=codebuild.CfnProject.ProjectFleetProperty(
        fleet_arn="fleetArn"
    ),
    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 .

See:

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

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.

See:

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

environment_variables

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

See:

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

fleet

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

Type:

see

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 .

See:

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

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.

See:

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

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"

See:

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

registry_credential

.

  • imagePullCredentialsType must be set to SERVICE_ROLE .

  • images cannot be curated or an Amazon ECR image.

See:

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

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 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 ARM_LAMBDA_CONTAINER and LINUX_LAMBDA_CONTAINER are available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific (Mumbai), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), EU (Frankfurt), EU (Ireland), and South America (São Paulo).

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

If you’re using compute fleets during project creation, type will be ignored.

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

See:

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

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. 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. For environment variables of this type, specify the name of the parameter as the value of the EnvironmentVariable. The parameter value will be substituted for the name at runtime. You can also define Parameter Store environment variables in the buildspec. To learn how to do so, 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 . For environment variables of this type, specify the name of the secret as the value of the EnvironmentVariable. The secret value will be substituted for the name at runtime. You can also define AWS Secrets Manager environment variables in the buildspec. To learn how to do so, see env/secrets-manager in the AWS CodeBuild User Guide .

See:

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.
from aws_cdk import 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.

See:

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

type

.

  • PARAMETER_STORE : An environment variable stored in Systems Manager Parameter Store. For environment variables of this type, specify the name of the parameter as the value of the EnvironmentVariable. The parameter value will be substituted for the name at runtime. You can also define Parameter Store environment variables in the buildspec. To learn how to do so, 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 . For environment variables of this type, specify the name of the secret as the value of the EnvironmentVariable. The secret value will be substituted for the name at runtime. You can also define AWS Secrets Manager environment variables in the buildspec. To learn how to do so, see env/secrets-manager in the AWS CodeBuild User Guide .

See:

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

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

See:

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

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.

See:

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.
from aws_cdk import 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.

See:

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

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:
  • cloud_watch_logs (Union[IResolvable, CloudWatchLogsConfigProperty, Dict[str, Any], None]) – Information about CloudWatch Logs for a build project. CloudWatch Logs are enabled by default.

  • s3_logs (Union[IResolvable, S3LogsConfigProperty, Dict[str, Any], None]) – Information about logs built to an S3 bucket for a build project. S3 logs are not enabled by default.

See:

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.
from aws_cdk import 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.

See:

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

s3_logs

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

S3 logs are not enabled by default.

See:

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

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, Dict[str, Any], 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.

See:

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.
from aws_cdk import 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.

See:

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

combine_artifacts

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

See:

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

restrictions

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

See:

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

service_role

Specifies the service role ARN for the batch build project.

See:

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

timeout_in_mins

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

See:

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

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.

See:

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.
from aws_cdk import 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.

See:

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

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.

See:

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

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.

See:

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

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 .

See:

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.
from aws_cdk import 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.

See:

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

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.

See:

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

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 .

See:

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

mount_point

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

See:

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

type

The type of the file system.

The one supported type is EFS .

See:

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

ProjectFleetProperty

class CfnProject.ProjectFleetProperty(*, fleet_arn=None)

Bases: object

Information about the compute fleet of the build project.

For more information, see Working with reserved capacity in AWS CodeBuild .

Parameters:

fleet_arn (Optional[str]) – Specifies the compute fleet ARN for the build project.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

project_fleet_property = codebuild.CfnProject.ProjectFleetProperty(
    fleet_arn="fleetArn"
)

Attributes

fleet_arn

Specifies the compute fleet ARN for the build project.

See:

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

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 .

See:

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.
from aws_cdk import 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.

See:

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

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 .

See:

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

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.

The Webhook feature isn’t available in AWS CloudFormation for GitHub Enterprise projects. Use the AWS CLI or AWS CodeBuild console to create the webhook.

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[IResolvable, WebhookFilterProperty, Dict[str, Any]]]]], 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.

See:

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.
from aws_cdk import 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

See:

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

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.

See:

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

webhook

Specifies whether or not to begin automatically rebuilding the source code every time a code change is pushed to the repository.

See:

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

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 .

See:

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.
from aws_cdk import 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 .

See:

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

credential_provider

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

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

See:

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

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 .

See:

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.
from aws_cdk import 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.

See:

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

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 .

See:

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

status

.

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

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

See:

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

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.

See:

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.
from aws_cdk import 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.

See:

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

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.

See:

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

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, Dict[str, Any], 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, Dict[str, Any], 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, Dict[str, Any], 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.

See:

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.
from aws_cdk import 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.

See:

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

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 .

See:

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

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 .

See:

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

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.

See:

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

git_submodules_config

Information about the Git submodules configuration for the build project.

See:

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

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.

See:

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

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 .

See:

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

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.

See:

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

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.

See:

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

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.

See:

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

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.

See:

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.
from aws_cdk import 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.

See:

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

subnets

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

The maximum count is 16.

See:

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

vpc_id

The ID of the Amazon VPC.

See:

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

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.

The Webhook feature isn’t available in AWS CloudFormation for GitHub Enterprise projects. Use the AWS CLI or AWS CodeBuild console to create the webhook.

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 eight webhook filter types: EVENT , ACTOR_ACCOUNT_ID , HEAD_REF , BASE_REF , FILE_PATH , COMMIT_MESSAGE , TAG_NAME , and RELEASE_NAME . - EVENT - A webhook event triggers a build when the provided pattern matches one of eight event types: PUSH , PULL_REQUEST_CREATED , PULL_REQUEST_UPDATED , PULL_REQUEST_CLOSED , PULL_REQUEST_REOPENED , PULL_REQUEST_MERGED , RELEASED , and PRERELEASED . 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. The RELEASED and PRERELEASED work with GitHub 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 . .. epigraph:: 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. - TAG_NAME - A webhook triggers a build when the tag name of the release matches the regular expression pattern . .. epigraph:: Works with RELEASED and PRERELEASED events only. - RELEASE_NAME - A webhook triggers a build when the release name matches the regular expression pattern . .. epigraph:: Works with RELEASED and PRERELEASED events only.

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

See:

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.
from aws_cdk import 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.

See:

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

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 .

See:

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

type

The type of webhook filter.

There are eight webhook filter types: EVENT , ACTOR_ACCOUNT_ID , HEAD_REF , BASE_REF , FILE_PATH , COMMIT_MESSAGE , TAG_NAME , and RELEASE_NAME .

  • EVENT

  • A webhook event triggers a build when the provided pattern matches one of eight event types: PUSH , PULL_REQUEST_CREATED , PULL_REQUEST_UPDATED , PULL_REQUEST_CLOSED , PULL_REQUEST_REOPENED , PULL_REQUEST_MERGED , RELEASED , and PRERELEASED . 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. The RELEASED and PRERELEASED work with GitHub 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.

  • TAG_NAME

  • A webhook triggers a build when the tag name of the release matches the regular expression pattern .

Works with RELEASED and PRERELEASED events only.

  • RELEASE_NAME

  • A webhook triggers a build when the release name matches the regular expression pattern .

Works with RELEASED and PRERELEASED events only.

See:

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