CfnProjectPropsMixin
- class aws_cdk.mixins_preview.aws_codebuild.mixins.CfnProjectPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::CodeBuild::Projectresource 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
- Mixin:
true
- 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.mixins_preview import mixins from aws_cdk.mixins_preview.aws_codebuild import mixins as codebuild_mixins cfn_project_props_mixin = codebuild_mixins.CfnProjectPropsMixin(codebuild_mixins.CfnProjectMixinProps( artifacts=codebuild_mixins.CfnProjectPropsMixin.ArtifactsProperty( artifact_identifier="artifactIdentifier", encryption_disabled=False, location="location", name="name", namespace_type="namespaceType", override_artifact_name=False, packaging="packaging", path="path", type="type" ), auto_retry_limit=123, badge_enabled=False, build_batch_config=codebuild_mixins.CfnProjectPropsMixin.ProjectBuildBatchConfigProperty( batch_report_mode="batchReportMode", combine_artifacts=False, restrictions=codebuild_mixins.CfnProjectPropsMixin.BatchRestrictionsProperty( compute_types_allowed=["computeTypesAllowed"], maximum_builds_allowed=123 ), service_role="serviceRole", timeout_in_mins=123 ), cache=codebuild_mixins.CfnProjectPropsMixin.ProjectCacheProperty( cache_namespace="cacheNamespace", location="location", modes=["modes"], type="type" ), concurrent_build_limit=123, description="description", encryption_key="encryptionKey", environment=codebuild_mixins.CfnProjectPropsMixin.EnvironmentProperty( certificate="certificate", compute_type="computeType", docker_server=codebuild_mixins.CfnProjectPropsMixin.DockerServerProperty( compute_type="computeType", security_group_ids=["securityGroupIds"] ), environment_variables=[codebuild_mixins.CfnProjectPropsMixin.EnvironmentVariableProperty( name="name", type="type", value="value" )], fleet=codebuild_mixins.CfnProjectPropsMixin.ProjectFleetProperty( fleet_arn="fleetArn" ), image="image", image_pull_credentials_type="imagePullCredentialsType", privileged_mode=False, registry_credential=codebuild_mixins.CfnProjectPropsMixin.RegistryCredentialProperty( credential="credential", credential_provider="credentialProvider" ), type="type" ), file_system_locations=[codebuild_mixins.CfnProjectPropsMixin.ProjectFileSystemLocationProperty( identifier="identifier", location="location", mount_options="mountOptions", mount_point="mountPoint", type="type" )], logs_config=codebuild_mixins.CfnProjectPropsMixin.LogsConfigProperty( cloud_watch_logs=codebuild_mixins.CfnProjectPropsMixin.CloudWatchLogsConfigProperty( group_name="groupName", status="status", stream_name="streamName" ), s3_logs=codebuild_mixins.CfnProjectPropsMixin.S3LogsConfigProperty( encryption_disabled=False, location="location", status="status" ) ), name="name", queued_timeout_in_minutes=123, resource_access_role="resourceAccessRole", secondary_artifacts=[codebuild_mixins.CfnProjectPropsMixin.ArtifactsProperty( artifact_identifier="artifactIdentifier", encryption_disabled=False, location="location", name="name", namespace_type="namespaceType", override_artifact_name=False, packaging="packaging", path="path", type="type" )], secondary_sources=[codebuild_mixins.CfnProjectPropsMixin.SourceProperty( auth=codebuild_mixins.CfnProjectPropsMixin.SourceAuthProperty( resource="resource", type="type" ), build_spec="buildSpec", build_status_config=codebuild_mixins.CfnProjectPropsMixin.BuildStatusConfigProperty( context="context", target_url="targetUrl" ), git_clone_depth=123, git_submodules_config=codebuild_mixins.CfnProjectPropsMixin.GitSubmodulesConfigProperty( fetch_submodules=False ), insecure_ssl=False, location="location", report_build_status=False, source_identifier="sourceIdentifier", type="type" )], secondary_source_versions=[codebuild_mixins.CfnProjectPropsMixin.ProjectSourceVersionProperty( source_identifier="sourceIdentifier", source_version="sourceVersion" )], service_role="serviceRole", source=codebuild_mixins.CfnProjectPropsMixin.SourceProperty( auth=codebuild_mixins.CfnProjectPropsMixin.SourceAuthProperty( resource="resource", type="type" ), build_spec="buildSpec", build_status_config=codebuild_mixins.CfnProjectPropsMixin.BuildStatusConfigProperty( context="context", target_url="targetUrl" ), git_clone_depth=123, git_submodules_config=codebuild_mixins.CfnProjectPropsMixin.GitSubmodulesConfigProperty( fetch_submodules=False ), insecure_ssl=False, location="location", report_build_status=False, source_identifier="sourceIdentifier", type="type" ), source_version="sourceVersion", tags=[CfnTag( key="key", value="value" )], timeout_in_minutes=123, triggers=codebuild_mixins.CfnProjectPropsMixin.ProjectTriggersProperty( build_type="buildType", filter_groups=[[codebuild_mixins.CfnProjectPropsMixin.WebhookFilterProperty( exclude_matched_pattern=False, pattern="pattern", type="type" )]], pull_request_build_policy=codebuild_mixins.CfnProjectPropsMixin.PullRequestBuildPolicyProperty( approver_roles=["approverRoles"], requires_comment_approval="requiresCommentApproval" ), scope_configuration=codebuild_mixins.CfnProjectPropsMixin.ScopeConfigurationProperty( domain="domain", name="name", scope="scope" ), webhook=False ), visibility="visibility", vpc_config=codebuild_mixins.CfnProjectPropsMixin.VpcConfigProperty( security_group_ids=["securityGroupIds"], subnets=["subnets"], vpc_id="vpcId" ) ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::CodeBuild::Project.- Parameters:
props (
Union[CfnProjectMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['artifacts', 'autoRetryLimit', 'badgeEnabled', 'buildBatchConfig', 'cache', 'concurrentBuildLimit', 'description', 'encryptionKey', 'environment', 'fileSystemLocations', 'logsConfig', 'name', 'queuedTimeoutInMinutes', 'resourceAccessRole', 'secondaryArtifacts', 'secondarySources', 'secondarySourceVersions', 'serviceRole', 'source', 'sourceVersion', 'tags', 'timeoutInMinutes', 'triggers', 'visibility', 'vpcConfig']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
ArtifactsProperty
- class CfnProjectPropsMixin.ArtifactsProperty(*, artifact_identifier=None, encryption_disabled=None, location=None, name=None, namespace_type=None, override_artifact_name=None, packaging=None, path=None, type=None)
Bases:
objectArtifactsis a property of the AWS::CodeBuild::Project resource that specifies output settings for artifacts generated by an AWS CodeBuild build.- Parameters:
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, aninvalidInputExceptionis thrown.location (
Optional[str]) – Information about the build output artifact location:. - Iftypeis set toCODEPIPELINE, AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output locations instead of CodeBuild . - Iftypeis set toNO_ARTIFACTS, this value is ignored if specified, because no build output is produced. - Iftypeis set toS3, this is the name of the output bucket. If you specifyCODEPIPELINEorNO_ARTIFACTSfor theTypeproperty, don’t specify this property. For all of the other types, you must specify this property.name (
Optional[str]) – Along withpathandnamespaceType, the pattern that AWS CodeBuild uses to name and store the output artifact:. - Iftypeis set toCODEPIPELINE, AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild . - Iftypeis set toNO_ARTIFACTS, this value is ignored if specified, because no build output is produced. - Iftypeis set toS3, 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: - Ifpathis set toMyArtifacts,namespaceTypeis set toBUILD_ID, andnameis set toMyArtifact.zip, then the output artifact is stored inMyArtifacts/ *build-ID* /MyArtifact.zip. - Ifpathis empty,namespaceTypeis set toNONE, andnameis set to “/“, the output artifact is stored in the root of the output bucket. - Ifpathis set toMyArtifacts,namespaceTypeis set toBUILD_ID, andnameis set to “/“, the output artifact is stored inMyArtifacts/ *build-ID*. If you specifyCODEPIPELINEorNO_ARTIFACTSfor theTypeproperty, don’t specify this property. For all of the other types, you must specify this property.namespace_type (
Optional[str]) – Along withpathandname, the pattern that AWS CodeBuild uses to determine the name and location to store the output artifact: - Iftypeis set toCODEPIPELINE, CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild . - Iftypeis set toNO_ARTIFACTS, this value is ignored if specified, because no build output is produced. - Iftypeis set toS3, 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 ifnamespaceTypeis not specified. For example, ifpathis set toMyArtifacts,namespaceTypeis set toBUILD_ID, andnameis set toMyArtifact.zip, the output artifact is stored inMyArtifacts/<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:. - Iftypeis set toCODEPIPELINE, CodePipeline ignores this value if specified. This is because CodePipeline manages its build output artifacts instead of AWS CodeBuild . - Iftypeis set toNO_ARTIFACTS, this value is ignored if specified, because no build output is produced. - Iftypeis set toS3, valid values include: -NONE: AWS CodeBuild creates in the output bucket a folder that contains the build output. This is the default ifpackagingis not specified. -ZIP: AWS CodeBuild creates in the output bucket a ZIP file that contains the build output.path (
Optional[str]) – Along withnamespaceTypeandname, the pattern that AWS CodeBuild uses to name and store the output artifact:. - Iftypeis set toCODEPIPELINE, CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild . - Iftypeis set toNO_ARTIFACTS, this value is ignored if specified, because no build output is produced. - Iftypeis set toS3, this is the path to the output artifact. Ifpathis not specified,pathis not used. For example, ifpathis set toMyArtifacts,namespaceTypeis set toNONE, andnameis set toMyArtifact.zip, the output artifact is stored in the output bucket atMyArtifacts/MyArtifact.zip.type (
Optional[str]) – The type of build output artifact. Valid values include:. -CODEPIPELINE: The build project has build output generated through CodePipeline. .. epigraph:: TheCODEPIPELINEtype is not supported forsecondaryArtifacts. -NO_ARTIFACTS: The build project does not produce any build output. -S3: The build project stores build output in Amazon S3.
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins artifacts_property = codebuild_mixins.CfnProjectPropsMixin.ArtifactsProperty( artifact_identifier="artifactIdentifier", encryption_disabled=False, location="location", name="name", namespace_type="namespaceType", override_artifact_name=False, packaging="packaging", path="path", type="type" )
Attributes
- artifact_identifier
An identifier for this artifact definition.
- 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
invalidInputExceptionis thrown.
- location
.
If
typeis set toCODEPIPELINE, AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output locations instead of CodeBuild .If
typeis set toNO_ARTIFACTS, this value is ignored if specified, because no build output is produced.If
typeis set toS3, this is the name of the output bucket.
If you specify
CODEPIPELINEorNO_ARTIFACTSfor theTypeproperty, don’t specify this property. For all of the other types, you must specify this property.- See:
- Type:
Information about the build output artifact location
- name
.
If
typeis set toCODEPIPELINE, AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild .If
typeis set toNO_ARTIFACTS, this value is ignored if specified, because no build output is produced.If
typeis set toS3, 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
pathis set toMyArtifacts,namespaceTypeis set toBUILD_ID, andnameis set toMyArtifact.zip, then the output artifact is stored inMyArtifacts/ *build-ID* /MyArtifact.zip.If
pathis empty,namespaceTypeis set toNONE, andnameis set to “/“, the output artifact is stored in the root of the output bucket.If
pathis set toMyArtifacts,namespaceTypeis set toBUILD_ID, andnameis set to “/“, the output artifact is stored inMyArtifacts/ *build-ID*.
If you specify
CODEPIPELINEorNO_ARTIFACTSfor theTypeproperty, don’t specify this property. For all of the other types, you must specify this property.- See:
- Type:
Along with
pathandnamespaceType, the pattern that AWS CodeBuild uses to name and store the output artifact
- namespace_type
If
typeis set toCODEPIPELINE, CodePipeline ignores this value if specified.
This is because CodePipeline manages its build output names instead of AWS CodeBuild .
If
typeis set toNO_ARTIFACTS, this value is ignored if specified, because no build output is produced.If
typeis set toS3, 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 ifnamespaceTypeis not specified.
For example, if
pathis set toMyArtifacts,namespaceTypeis set toBUILD_ID, andnameis set toMyArtifact.zip, the output artifact is stored inMyArtifacts/<build-ID>/MyArtifact.zip.- See:
- Type:
Along with
pathandname, 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.
- packaging
.
If
typeis set toCODEPIPELINE, CodePipeline ignores this value if specified. This is because CodePipeline manages its build output artifacts instead of AWS CodeBuild .If
typeis set toNO_ARTIFACTS, this value is ignored if specified, because no build output is produced.If
typeis set toS3, valid values include:NONE: AWS CodeBuild creates in the output bucket a folder that contains the build output. This is the default ifpackagingis not specified.ZIP: AWS CodeBuild creates in the output bucket a ZIP file that contains the build output.
- See:
- Type:
The type of build output artifact to create
- path
.
If
typeis set toCODEPIPELINE, CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild .If
typeis set toNO_ARTIFACTS, this value is ignored if specified, because no build output is produced.If
typeis set toS3, this is the path to the output artifact. Ifpathis not specified,pathis not used.
For example, if
pathis set toMyArtifacts,namespaceTypeis set toNONE, andnameis set toMyArtifact.zip, the output artifact is stored in the output bucket atMyArtifacts/MyArtifact.zip.- See:
- Type:
Along with
namespaceTypeandname, 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
CODEPIPELINEtype is not supported forsecondaryArtifacts.NO_ARTIFACTS: The build project does not produce any build output.S3: The build project stores build output in Amazon S3.
- See:
- Type:
The type of build output artifact. Valid values include
BatchRestrictionsProperty
- class CfnProjectPropsMixin.BatchRestrictionsProperty(*, compute_types_allowed=None, maximum_builds_allowed=None)
Bases:
objectSpecifies 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:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins batch_restrictions_property = codebuild_mixins.CfnProjectPropsMixin.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.
- maximum_builds_allowed
Specifies the maximum number of builds allowed.
BuildStatusConfigProperty
- class CfnProjectPropsMixin.BuildStatusConfigProperty(*, context=None, target_url=None)
Bases:
objectContains 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 thenameparameter in the Bitbucket commit status. For more information, see build in the Bitbucket API documentation. - GitHub/GitHub Enterprise Server - This parameter is used for thecontextparameter 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
urlparameter in the Bitbucket commit status. For more information, see build in the Bitbucket API documentation. - GitHub/GitHub Enterprise Server - This parameter is used for thetarget_urlparameter in the GitHub commit status. For more information, see Create a commit status in the GitHub developer guide.
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins build_status_config_property = codebuild_mixins.CfnProjectPropsMixin.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
nameparameter 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
contextparameter in the GitHub commit status. For more information, see Create a commit status in the GitHub developer guide.
- 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
urlparameter 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_urlparameter in the GitHub commit status. For more information, see Create a commit status in the GitHub developer guide.
CloudWatchLogsConfigProperty
- class CfnProjectPropsMixin.CloudWatchLogsConfigProperty(*, group_name=None, status=None, stream_name=None)
Bases:
objectCloudWatchLogsis a property of the AWS CodeBuild Project LogsConfig property type that specifies settings for CloudWatch logs generated by an AWS CodeBuild build.- Parameters:
group_name (
Optional[str]) – The group name of the logs in CloudWatch Logs. For more information, see Working with Log Groups and Log Streams .status (
Optional[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.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:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins cloud_watch_logs_config_property = codebuild_mixins.CfnProjectPropsMixin.CloudWatchLogsConfigProperty( group_name="groupName", status="status", 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 .
- status
.
ENABLED: CloudWatch Logs are enabled for this build project.DISABLED: CloudWatch Logs are not enabled for this build project.
- See:
- 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 .
DockerServerProperty
- class CfnProjectPropsMixin.DockerServerProperty(*, compute_type=None, security_group_ids=None)
Bases:
object- Parameters:
compute_type (
Optional[str])security_group_ids (
Optional[Sequence[str]])
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins docker_server_property = codebuild_mixins.CfnProjectPropsMixin.DockerServerProperty( compute_type="computeType", security_group_ids=["securityGroupIds"] )
Attributes
- compute_type
-
- Type:
see
EnvironmentProperty
- class CfnProjectPropsMixin.EnvironmentProperty(*, certificate=None, compute_type=None, docker_server=None, environment_variables=None, fleet=None, image=None, image_pull_credentials_type=None, privileged_mode=None, registry_credential=None, type=None)
Bases:
objectEnvironmentis a property of the AWS::CodeBuild::Project resource that specifies the environment for an AWS CodeBuild project.- Parameters:
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 .compute_type (
Optional[str]) – The type of compute environment. This determines the number of CPU cores and memory the build environment uses. Available values include: -ATTRIBUTE_BASED_COMPUTE: Specify the amount of vCPUs, memory, disk space, and the type of machine. .. epigraph:: If you useATTRIBUTE_BASED_COMPUTE, you must define your attributes by usingcomputeConfiguration. AWS CodeBuild will select the cheapest instance that satisfies your specified attributes. For more information, see Reserved capacity environment types in the AWS CodeBuild User Guide . -BUILD_GENERAL1_SMALL: Use up to 4 GiB memory and 2 vCPUs for builds. -BUILD_GENERAL1_MEDIUM: Use up to 8 GiB memory and 4 vCPUs for builds. -BUILD_GENERAL1_LARGE: Use up to 16 GiB memory and 8 vCPUs for builds, depending on your environment type. -BUILD_GENERAL1_XLARGE: Use up to 72 GiB memory and 36 vCPUs for builds, depending on your environment type. -BUILD_GENERAL1_2XLARGE: Use up to 144 GiB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute type supports Docker images up to 100 GB uncompressed. -BUILD_LAMBDA_1GB: Use up to 1 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINERandARM_LAMBDA_CONTAINER. -BUILD_LAMBDA_2GB: Use up to 2 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINERandARM_LAMBDA_CONTAINER. -BUILD_LAMBDA_4GB: Use up to 4 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINERandARM_LAMBDA_CONTAINER. -BUILD_LAMBDA_8GB: Use up to 8 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINERandARM_LAMBDA_CONTAINER. -BUILD_LAMBDA_10GB: Use up to 10 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINERandARM_LAMBDA_CONTAINER. If you useBUILD_GENERAL1_SMALL: - For environment typeLINUX_CONTAINER, you can use up to 4 GiB memory and 2 vCPUs for builds. - For environment typeLINUX_GPU_CONTAINER, you can use up to 16 GiB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. - For environment typeARM_CONTAINER, you can use up to 4 GiB memory and 2 vCPUs on ARM-based processors for builds. If you useBUILD_GENERAL1_LARGE: - For environment typeLINUX_CONTAINER, you can use up to 16 GiB memory and 8 vCPUs for builds. - For environment typeLINUX_GPU_CONTAINER, you can use up to 255 GiB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. - For environment typeARM_CONTAINER, you can use up to 16 GiB memory and 8 vCPUs on ARM-based processors for builds. For more information, see On-demand environment types in the AWS CodeBuild User Guide.docker_server (
Union[IResolvable,DockerServerProperty,Dict[str,Any],None])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 (
Optional[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 beaws/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 .image_pull_credentials_type (
Optional[str]) – The type of credentials AWS CodeBuild uses to pull images in your build. There are two valid values:. -CODEBUILDspecifies that AWS CodeBuild uses its own credentials. This requires that you modify your ECR repository policy to trust AWS CodeBuild service principal. -SERVICE_ROLEspecifies 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 isfalse. 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-targument totimeout:- 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]) –RegistryCredentialis 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:. -imagePullCredentialsTypemust be set toSERVICE_ROLE. - images cannot be curated or an Amazon ECR image.type (
Optional[str]) –The type of build environment to use for related builds. .. epigraph:: If you’re using compute fleets during project creation,
typewill be ignored. For more information, see Build environment compute types in the AWS CodeBuild user guide .
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins environment_property = codebuild_mixins.CfnProjectPropsMixin.EnvironmentProperty( certificate="certificate", compute_type="computeType", docker_server=codebuild_mixins.CfnProjectPropsMixin.DockerServerProperty( compute_type="computeType", security_group_ids=["securityGroupIds"] ), environment_variables=[codebuild_mixins.CfnProjectPropsMixin.EnvironmentVariableProperty( name="name", type="type", value="value" )], fleet=codebuild_mixins.CfnProjectPropsMixin.ProjectFleetProperty( fleet_arn="fleetArn" ), image="image", image_pull_credentials_type="imagePullCredentialsType", privileged_mode=False, registry_credential=codebuild_mixins.CfnProjectPropsMixin.RegistryCredentialProperty( credential="credential", credential_provider="credentialProvider" ), type="type" )
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 .
- compute_type
The type of compute environment.
This determines the number of CPU cores and memory the build environment uses. Available values include:
ATTRIBUTE_BASED_COMPUTE: Specify the amount of vCPUs, memory, disk space, and the type of machine.
If you use
ATTRIBUTE_BASED_COMPUTE, you must define your attributes by usingcomputeConfiguration. AWS CodeBuild will select the cheapest instance that satisfies your specified attributes. For more information, see Reserved capacity environment types in the AWS CodeBuild User Guide .BUILD_GENERAL1_SMALL: Use up to 4 GiB memory and 2 vCPUs for builds.BUILD_GENERAL1_MEDIUM: Use up to 8 GiB memory and 4 vCPUs for builds.BUILD_GENERAL1_LARGE: Use up to 16 GiB memory and 8 vCPUs for builds, depending on your environment type.BUILD_GENERAL1_XLARGE: Use up to 72 GiB memory and 36 vCPUs for builds, depending on your environment type.BUILD_GENERAL1_2XLARGE: Use up to 144 GiB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute type supports Docker images up to 100 GB uncompressed.BUILD_LAMBDA_1GB: Use up to 1 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINERandARM_LAMBDA_CONTAINER.BUILD_LAMBDA_2GB: Use up to 2 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINERandARM_LAMBDA_CONTAINER.BUILD_LAMBDA_4GB: Use up to 4 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINERandARM_LAMBDA_CONTAINER.BUILD_LAMBDA_8GB: Use up to 8 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINERandARM_LAMBDA_CONTAINER.BUILD_LAMBDA_10GB: Use up to 10 GiB memory for builds. Only available for environment typeLINUX_LAMBDA_CONTAINERandARM_LAMBDA_CONTAINER.
If you use
BUILD_GENERAL1_SMALL:For environment type
LINUX_CONTAINER, you can use up to 4 GiB memory and 2 vCPUs for builds.For environment type
LINUX_GPU_CONTAINER, you can use up to 16 GiB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds.For environment type
ARM_CONTAINER, you can use up to 4 GiB memory and 2 vCPUs on ARM-based processors for builds.
If you use
BUILD_GENERAL1_LARGE:For environment type
LINUX_CONTAINER, you can use up to 16 GiB memory and 8 vCPUs for builds.For environment type
LINUX_GPU_CONTAINER, you can use up to 255 GiB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds.For environment type
ARM_CONTAINER, you can use up to 16 GiB memory and 8 vCPUs on ARM-based processors for builds.
For more information, see On-demand environment types in the AWS CodeBuild User Guide.
- docker_server
-
- Type:
see
- environment_variables
A set of environment variables to make available to builds for this build project.
- 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 beaws/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 .
- image_pull_credentials_type
.
CODEBUILDspecifies that AWS CodeBuild uses its own credentials. This requires that you modify your ECR repository policy to trust AWS CodeBuild service principal.SERVICE_ROLEspecifies 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:
- 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
-targument totimeout:- 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
.
imagePullCredentialsTypemust be set toSERVICE_ROLE.images cannot be curated or an Amazon ECR image.
- See:
- Type:
RegistryCredentialis 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
- type
The type of build environment to use for related builds.
If you’re using compute fleets during project creation,
typewill be ignored.For more information, see Build environment compute types in the AWS CodeBuild user guide .
EnvironmentVariableProperty
- class CfnProjectPropsMixin.EnvironmentVariableProperty(*, name=None, type=None, value=None)
Bases:
objectEnvironmentVariableis 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.EnvironmentVariablecontains a list ofEnvironmentVariableproperty types.- Parameters:
name (
Optional[str]) – The name or key of the environment variable.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 thevalueof 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 thevalueof 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 .value (
Optional[str]) – The value of the environment variable. .. epigraph:: We strongly discourage the use ofPLAINTEXTenvironment variables to store sensitive values, especially AWS secret key IDs.PLAINTEXTenvironment 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 typePARAMETER_STOREorSECRETS_MANAGER.
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins environment_variable_property = codebuild_mixins.CfnProjectPropsMixin.EnvironmentVariableProperty( name="name", type="type", value="value" )
Attributes
- name
The name or key of the environment variable.
- 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 thevalueof 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 thevalueof 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:
- Type:
The type of environment variable. Valid values include
- value
The value of the environment variable.
We strongly discourage the use of
PLAINTEXTenvironment variables to store sensitive values, especially AWS secret key IDs.PLAINTEXTenvironment 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 typePARAMETER_STOREorSECRETS_MANAGER.
GitSubmodulesConfigProperty
- class CfnProjectPropsMixin.GitSubmodulesConfigProperty(*, fetch_submodules=None)
Bases:
objectGitSubmodulesConfigis 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,None]) – Set to true to fetch Git submodules for your AWS CodeBuild build project.- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins git_submodules_config_property = codebuild_mixins.CfnProjectPropsMixin.GitSubmodulesConfigProperty( fetch_submodules=False )
Attributes
- fetch_submodules
Set to true to fetch Git submodules for your AWS CodeBuild build project.
LogsConfigProperty
- class CfnProjectPropsMixin.LogsConfigProperty(*, cloud_watch_logs=None, s3_logs=None)
Bases:
objectLogsConfigis 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:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins logs_config_property = codebuild_mixins.CfnProjectPropsMixin.LogsConfigProperty( cloud_watch_logs=codebuild_mixins.CfnProjectPropsMixin.CloudWatchLogsConfigProperty( group_name="groupName", status="status", stream_name="streamName" ), s3_logs=codebuild_mixins.CfnProjectPropsMixin.S3LogsConfigProperty( encryption_disabled=False, location="location", status="status" ) )
Attributes
- cloud_watch_logs
Information about CloudWatch Logs for a build project.
CloudWatch Logs are enabled by default.
- s3_logs
Information about logs built to an S3 bucket for a build project.
S3 logs are not enabled by default.
ProjectBuildBatchConfigProperty
- class CfnProjectPropsMixin.ProjectBuildBatchConfigProperty(*, batch_report_mode=None, combine_artifacts=None, restrictions=None, service_role=None, timeout_in_mins=None)
Bases:
objectContains 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]) – ABatchRestrictionsobject 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:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins project_build_batch_config_property = codebuild_mixins.CfnProjectPropsMixin.ProjectBuildBatchConfigProperty( batch_report_mode="batchReportMode", combine_artifacts=False, restrictions=codebuild_mixins.CfnProjectPropsMixin.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.
- combine_artifacts
Specifies if the build artifacts for the batch build should be combined into a single artifact location.
- restrictions
A
BatchRestrictionsobject that specifies the restrictions for the batch build.
- service_role
Specifies the service role ARN for the batch build project.
- timeout_in_mins
Specifies the maximum amount of time, in minutes, that the batch build must be completed in.
ProjectCacheProperty
- class CfnProjectPropsMixin.ProjectCacheProperty(*, cache_namespace=None, location=None, modes=None, type=None)
Bases:
objectProjectCacheis a property of the AWS CodeBuild Project resource that specifies information about the cache for the build project. IfProjectCacheis not specified, then both of its properties default toNO_CACHE.- Parameters:
cache_namespace (
Optional[str]) – Defines the scope of the cache. You can use this namespace to share a cache across multiple projects. For more information, see Cache sharing between projects in the AWS CodeBuild User Guide .location (
Optional[str]) – Information about the cache location:. -NO_CACHEorLOCAL: 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 forLOCALcache 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. - Theprivilegedflag 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.type (
Optional[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.
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins project_cache_property = codebuild_mixins.CfnProjectPropsMixin.ProjectCacheProperty( cache_namespace="cacheNamespace", location="location", modes=["modes"], type="type" )
Attributes
- cache_namespace
Defines the scope of the cache.
You can use this namespace to share a cache across multiple projects. For more information, see Cache sharing between projects in the AWS CodeBuild User Guide .
- location
.
NO_CACHEorLOCAL: This value is ignored.S3: This is the S3 bucket name/prefix.
- See:
- 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
LOCALcache 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
privilegedflag 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.
- 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:
- Type:
The type of cache used by the build project. Valid values include
ProjectFileSystemLocationProperty
- class CfnProjectPropsMixin.ProjectFileSystemLocationProperty(*, identifier=None, location=None, mount_options=None, mount_point=None, type=None)
Bases:
objectInformation about a file system created by Amazon Elastic File System (EFS).
For more information, see What Is Amazon Elastic File System?
- Parameters:
identifier (
Optional[str]) – The name used to access a file system created by Amazon EFS. CodeBuild creates an environment variable by appending theidentifierin all capital letters toCODEBUILD_. For example, if you specifymy_efsforidentifier, a new environment variable is create namedCODEBUILD_MY_EFS. Theidentifieris used to mount your file system.location (
Optional[str]) – A string that specifies the location of the file system created by Amazon EFS. Its format isefs-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 isfs-abcd1234.efs.us-west-2.amazonaws.com, and its mount directory ismy-efs-mount-directory, then thelocationisfs-abcd1234.efs.us-west-2.amazonaws.com:/my-efs-mount-directory. The directory path in the formatefs-dns-name:/directory-pathis optional. If you do not specify a directory path, the location is only the DNS name and CodeBuild mounts the entire file system.mount_options (
Optional[str]) – The mount options for a file system created by Amazon EFS. The default mount options used by CodeBuild arenfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2. For more information, see Recommended NFS Mount Options .mount_point (
Optional[str]) – The location in the container where you mount the file system.type (
Optional[str]) – The type of the file system. The one supported type isEFS.
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins project_file_system_location_property = codebuild_mixins.CfnProjectPropsMixin.ProjectFileSystemLocationProperty( identifier="identifier", location="location", mount_options="mountOptions", mount_point="mountPoint", type="type" )
Attributes
- identifier
The name used to access a file system created by Amazon EFS.
CodeBuild creates an environment variable by appending the
identifierin all capital letters toCODEBUILD_. For example, if you specifymy_efsforidentifier, a new environment variable is create namedCODEBUILD_MY_EFS.The
identifieris used to mount your file system.
- 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 isfs-abcd1234.efs.us-west-2.amazonaws.com, and its mount directory ismy-efs-mount-directory, then thelocationisfs-abcd1234.efs.us-west-2.amazonaws.com:/my-efs-mount-directory.The directory path in the format
efs-dns-name:/directory-pathis optional. If you do not specify a directory path, the location is only the DNS name and CodeBuild mounts the entire file system.
- 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 .
- mount_point
The location in the container where you mount the file system.
- type
The type of the file system.
The one supported type is
EFS.
ProjectFleetProperty
- class CfnProjectPropsMixin.ProjectFleetProperty(*, fleet_arn=None)
Bases:
objectInformation 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:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins project_fleet_property = codebuild_mixins.CfnProjectPropsMixin.ProjectFleetProperty( fleet_arn="fleetArn" )
Attributes
- fleet_arn
Specifies the compute fleet ARN for the build project.
ProjectSourceVersionProperty
- class CfnProjectPropsMixin.ProjectSourceVersionProperty(*, source_identifier=None, source_version=None)
Bases:
objectA source identifier and its corresponding version.
- Parameters:
source_identifier (
Optional[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 formatpr/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 GitLab: the commit ID, branch, or Git tag to use. - 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:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins project_source_version_property = codebuild_mixins.CfnProjectPropsMixin.ProjectSourceVersionProperty( source_identifier="sourceIdentifier", 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.
- 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 GitLab: the commit ID, branch, or Git tag to use.
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:
- Type:
The source version for the corresponding source identifier. If specified, must be one of
ProjectTriggersProperty
- class CfnProjectPropsMixin.ProjectTriggersProperty(*, build_type=None, filter_groups=None, pull_request_build_policy=None, scope_configuration=None, webhook=None)
Bases:
objectProjectTriggersis 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 buildfilter_groups (
Union[IResolvable,Sequence[Union[IResolvable,Sequence[Union[IResolvable,WebhookFilterProperty,Dict[str,Any]]]]],None]) – A list of lists ofWebhookFilterobjects used to determine which webhook events are triggered. At least oneWebhookFilterin the array must specifyEVENTas its type.pull_request_build_policy (
Union[IResolvable,PullRequestBuildPolicyProperty,Dict[str,Any],None])scope_configuration (
Union[IResolvable,ScopeConfigurationProperty,Dict[str,Any],None]) – Contains configuration information about the scope for a webhook.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:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins project_triggers_property = codebuild_mixins.CfnProjectPropsMixin.ProjectTriggersProperty( build_type="buildType", filter_groups=[[codebuild_mixins.CfnProjectPropsMixin.WebhookFilterProperty( exclude_matched_pattern=False, pattern="pattern", type="type" )]], pull_request_build_policy=codebuild_mixins.CfnProjectPropsMixin.PullRequestBuildPolicyProperty( approver_roles=["approverRoles"], requires_comment_approval="requiresCommentApproval" ), scope_configuration=codebuild_mixins.CfnProjectPropsMixin.ScopeConfigurationProperty( domain="domain", name="name", scope="scope" ), webhook=False )
Attributes
- build_type
.
BUILD - A single build
BUILD_BATCH - A batch build
- See:
- Type:
Specifies the type of build this webhook will trigger. Allowed values are
- filter_groups
A list of lists of
WebhookFilterobjects used to determine which webhook events are triggered.At least one
WebhookFilterin the array must specifyEVENTas its type.
- pull_request_build_policy
-
- Type:
see
- scope_configuration
Contains configuration information about the scope for a webhook.
- webhook
Specifies whether or not to begin automatically rebuilding the source code every time a code change is pushed to the repository.
PullRequestBuildPolicyProperty
- class CfnProjectPropsMixin.PullRequestBuildPolicyProperty(*, approver_roles=None, requires_comment_approval=None)
Bases:
object- Parameters:
approver_roles (
Optional[Sequence[str]])requires_comment_approval (
Optional[str])
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins pull_request_build_policy_property = codebuild_mixins.CfnProjectPropsMixin.PullRequestBuildPolicyProperty( approver_roles=["approverRoles"], requires_comment_approval="requiresCommentApproval" )
Attributes
- approver_roles
-
- Type:
see
RegistryCredentialProperty
- class CfnProjectPropsMixin.RegistryCredentialProperty(*, credential=None, credential_provider=None)
Bases:
objectRegistryCredentialis 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:.imagePullCredentialsTypemust be set toSERVICE_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 (
Optional[str]) – The Amazon Resource Name (ARN) or name of credentials created using AWS Secrets Manager . .. epigraph:: Thecredentialcan use the name of the credentials only if they exist in your current AWS Region .credential_provider (
Optional[str]) – The service that created the credentials to access a private Docker registry. The valid value, SECRETS_MANAGER, is for AWS Secrets Manager .
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins registry_credential_property = codebuild_mixins.CfnProjectPropsMixin.RegistryCredentialProperty( credential="credential", credential_provider="credentialProvider" )
Attributes
- credential
The Amazon Resource Name (ARN) or name of credentials created using AWS Secrets Manager .
The
credentialcan use the name of the credentials only if they exist in your current AWS Region .
- credential_provider
The service that created the credentials to access a private Docker registry.
The valid value, SECRETS_MANAGER, is for AWS Secrets Manager .
S3LogsConfigProperty
- class CfnProjectPropsMixin.S3LogsConfigProperty(*, encryption_disabled=None, location=None, status=None)
Bases:
objectS3Logsis 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:
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 ismy-bucket, and your path prefix isbuild-log, then acceptable formats aremy-bucket/build-logorarn:aws:s3:::my-bucket/build-log.status (
Optional[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.
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins s3_logs_config_property = codebuild_mixins.CfnProjectPropsMixin.S3LogsConfigProperty( encryption_disabled=False, location="location", status="status" )
Attributes
- encryption_disabled
Set to true if you do not want your S3 build log output encrypted.
By default S3 build logs are encrypted.
- 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 isbuild-log, then acceptable formats aremy-bucket/build-logorarn:aws:s3:::my-bucket/build-log.
- status
.
ENABLED: S3 build logs are enabled for this build project.DISABLED: S3 build logs are not enabled for this build project.
- See:
- Type:
The current status of the S3 build logs. Valid values are
ScopeConfigurationProperty
- class CfnProjectPropsMixin.ScopeConfigurationProperty(*, domain=None, name=None, scope=None)
Bases:
objectContains configuration information about the scope for a webhook.
- Parameters:
domain (
Optional[str]) – The domain of the GitHub Enterprise organization or the GitLab Self Managed group. Note that this parameter is only required if your project’s source type is GITHUB_ENTERPRISE or GITLAB_SELF_MANAGED.name (
Optional[str]) – The name of either the enterprise or organization that will send webhook events to CodeBuild , depending on if the webhook is a global or organization webhook respectively.scope (
Optional[str]) – The type of scope for a GitHub or GitLab webhook. The scope default is GITHUB_ORGANIZATION.
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins scope_configuration_property = codebuild_mixins.CfnProjectPropsMixin.ScopeConfigurationProperty( domain="domain", name="name", scope="scope" )
Attributes
- domain
The domain of the GitHub Enterprise organization or the GitLab Self Managed group.
Note that this parameter is only required if your project’s source type is GITHUB_ENTERPRISE or GITLAB_SELF_MANAGED.
- name
The name of either the enterprise or organization that will send webhook events to CodeBuild , depending on if the webhook is a global or organization webhook respectively.
- scope
The type of scope for a GitHub or GitLab webhook.
The scope default is GITHUB_ORGANIZATION.
SourceAuthProperty
- class CfnProjectPropsMixin.SourceAuthProperty(*, resource=None, type=None)
Bases:
objectSourceAuthis 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.- Parameters:
resource (
Optional[str]) – The resource value that applies to the specified authorization type.type (
Optional[str]) – The authorization type to use. Valid options are OAUTH, CODECONNECTIONS, or SECRETS_MANAGER.
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins source_auth_property = codebuild_mixins.CfnProjectPropsMixin.SourceAuthProperty( resource="resource", type="type" )
Attributes
- resource
The resource value that applies to the specified authorization type.
- type
The authorization type to use.
Valid options are OAUTH, CODECONNECTIONS, or SECRETS_MANAGER.
SourceProperty
- class CfnProjectPropsMixin.SourceProperty(*, 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, type=None)
Bases:
objectSourceis 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:
auth (
Union[IResolvable,SourceAuthProperty,Dict[str,Any],None]) – Information about the authorization settings for AWS CodeBuild to access the source code to be built.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 namedbuildspec.ymlat 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 variableCODEBUILD_SRC_DIR. The alternate buildspec file can have a name other thanbuildspec.yml, for examplemyspec.ymlorbuild_spec_qa.ymlor 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 isGITHUB,GITHUB_ENTERPRISE, orBITBUCKET.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 isfalse.InsecureSslshould 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,locationshould 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 thesourceobject, set theauthobject’stypevalue toOAUTH. - For source code in an GitLab or self-managed GitLab repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your AWS account to your GitLab account. Use the AWS CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with GitLab, on the Connections Authorize application page, choose Authorize . Then on the AWS CodeConnections Create GitLab connection page, choose Connect to GitLab . (After you have connected to your GitLab account, you do not need to finish creating the build project. You can leave the AWS CodeBuild console.) To instruct AWS CodeBuild to override the default connection and use this connection instead, set theauthobject’stypevalue toCODECONNECTIONSin thesourceobject. - 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 thesourceobject, set theauthobject’stypevalue toOAUTH. If you specifyCODEPIPELINEfor theTypeproperty, don’t specify this property. For all of the other types, you must specifyLocation.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, GitLab, GitLab Self Managed, or Bitbucket. If this is set and you use a different source provider, aninvalidInputExceptionis 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.type (
Optional[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 repository. -GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository. -GITLAB: The source code is in a GitLab repository. -GITLAB_SELF_MANAGED: The source code is in a self-managed GitLab repository. -NO_SOURCE: The project does not have input source code. -S3: The source code is in an Amazon S3 bucket.
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins source_property = codebuild_mixins.CfnProjectPropsMixin.SourceProperty( auth=codebuild_mixins.CfnProjectPropsMixin.SourceAuthProperty( resource="resource", type="type" ), build_spec="buildSpec", build_status_config=codebuild_mixins.CfnProjectPropsMixin.BuildStatusConfigProperty( context="context", target_url="targetUrl" ), git_clone_depth=123, git_submodules_config=codebuild_mixins.CfnProjectPropsMixin.GitSubmodulesConfigProperty( fetch_submodules=False ), insecure_ssl=False, location="location", report_build_status=False, source_identifier="sourceIdentifier", type="type" )
Attributes
- auth
Information about the authorization settings for AWS CodeBuild to access the source code to be built.
- 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.ymlat 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 variableCODEBUILD_SRC_DIR. The alternate buildspec file can have a name other thanbuildspec.yml, for examplemyspec.ymlorbuild_spec_qa.ymlor similar. For more information, see the Build Spec Reference in the AWS CodeBuild User Guide .
- 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, orBITBUCKET.
- 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.
- git_submodules_config
Information about the Git submodules configuration for the build project.
- 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.InsecureSslshould be used for testing purposes only. It should not be used in a production environment.
- location
.
For source code settings that are specified in the source action of a pipeline in CodePipeline,
locationshould 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
sourceobject, set theauthobject’stypevalue toOAUTH.For source code in an GitLab or self-managed GitLab repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your AWS account to your GitLab account. Use the AWS CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with GitLab, on the Connections Authorize application page, choose Authorize . Then on the AWS CodeConnections Create GitLab connection page, choose Connect to GitLab . (After you have connected to your GitLab account, you do not need to finish creating the build project. You can leave the AWS CodeBuild console.) To instruct AWS CodeBuild to override the default connection and use this connection instead, set the
authobject’stypevalue toCODECONNECTIONSin thesourceobject.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
sourceobject, set theauthobject’stypevalue toOAUTH.
If you specify
CODEPIPELINEfor theTypeproperty, don’t specify this property. For all of the other types, you must specifyLocation.- See:
- 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, GitLab, GitLab Self Managed, or Bitbucket. If this is set and you use a different source provider, an
invalidInputExceptionis thrown.
- 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.
- 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 repository.GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository.GITLAB: The source code is in a GitLab repository.GITLAB_SELF_MANAGED: The source code is in a self-managed GitLab repository.NO_SOURCE: The project does not have input source code.S3: The source code is in an Amazon S3 bucket.
- See:
- Type:
The type of repository that contains the source code to be built. Valid values include
VpcConfigProperty
- class CfnProjectPropsMixin.VpcConfigProperty(*, security_group_ids=None, subnets=None, vpc_id=None)
Bases:
objectVpcConfigis 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:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins vpc_config_property = codebuild_mixins.CfnProjectPropsMixin.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.
- subnets
A list of one or more subnet IDs in your Amazon VPC.
The maximum count is 16.
- vpc_id
The ID of the Amazon VPC.
WebhookFilterProperty
- class CfnProjectPropsMixin.WebhookFilterProperty(*, exclude_matched_pattern=None, pattern=None, type=None)
Bases:
objectWebhookFilteris a structure of theFilterGroupsproperty 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:
exclude_matched_pattern (
Union[bool,IResolvable,None]) – Used to indicate that thepatterndetermines which webhook events do not trigger a build. If true, then a webhook event that does not match thepatterntriggers a build. If false, then a webhook event that matches thepatterntriggers a build.pattern (
Optional[str]) – For aWebHookFilterthat usesEVENTtype, a comma-separated string that specifies one or more events. For example, the webhook filterPUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATEDallows all push, pull request created, and pull request updated events to trigger a build. For aWebHookFilterthat uses any of the other filter types, a regular expression pattern. For example, aWebHookFilterthat usesHEAD_REFfor itstypeand the pattern^refs/heads/triggers a build when the head reference is a branch with a reference namerefs/heads/branch-name.type (
Optional[str]) – The type of webhook filter. There are 11 webhook filter types:EVENT,ACTOR_ACCOUNT_ID,HEAD_REF,BASE_REF,FILE_PATH,COMMIT_MESSAGE,TAG_NAME,RELEASE_NAME,REPOSITORY_NAME,ORGANIZATION_NAME, andWORKFLOW_NAME. - EVENT - A webhook event triggers a build when the providedpatternmatches one of nine event types:PUSH,PULL_REQUEST_CREATED,PULL_REQUEST_UPDATED,PULL_REQUEST_CLOSED,PULL_REQUEST_REOPENED,PULL_REQUEST_MERGED,RELEASED,PRERELEASED, andWORKFLOW_JOB_QUEUED. TheEVENTpatterns are specified as a comma-separated string. For example,PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATEDfilters all push, pull request created, and pull request updated events. .. epigraph:: TypesPULL_REQUEST_REOPENEDandWORKFLOW_JOB_QUEUEDwork with GitHub and GitHub Enterprise only. TypesRELEASEDandPRERELEASEDwork with GitHub only. - ACTOR_ACCOUNT_ID - A webhook event triggers a build when a GitHub, GitHub Enterprise, or Bitbucket account ID matches the regular expressionpattern. - HEAD_REF - A webhook event triggers a build when the head reference matches the regular expressionpattern. For example,refs/heads/branch-nameandrefs/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 expressionpattern. 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 expressionpattern. .. epigraph:: Works with push and pull request events only. - COMMIT_MESSAGE - A webhook triggers a build when the head commit message matches the regular expressionpattern. .. epigraph:: Works with push and pull request events only. - TAG_NAME - A webhook triggers a build when the tag name of the release matches the regular expressionpattern. .. epigraph:: Works withRELEASEDandPRERELEASEDevents only. - RELEASE_NAME - A webhook triggers a build when the release name matches the regular expressionpattern. .. epigraph:: Works withRELEASEDandPRERELEASEDevents only. - REPOSITORY_NAME - A webhook triggers a build when the repository name matches the regular expressionpattern. .. epigraph:: Works with GitHub global or organization webhooks only. - ORGANIZATION_NAME - A webhook triggers a build when the organization name matches the regular expressionpattern. .. epigraph:: Works with GitHub global webhooks only. - WORKFLOW_NAME - A webhook triggers a build when the workflow name matches the regular expressionpattern. .. epigraph:: Works withWORKFLOW_JOB_QUEUEDevents only. > For CodeBuild-hosted Buildkite runner builds, WORKFLOW_NAME filters will filter by pipeline name.
- See:
- 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.mixins_preview.aws_codebuild import mixins as codebuild_mixins webhook_filter_property = codebuild_mixins.CfnProjectPropsMixin.WebhookFilterProperty( exclude_matched_pattern=False, pattern="pattern", type="type" )
Attributes
- exclude_matched_pattern
Used to indicate that the
patterndetermines which webhook events do not trigger a build.If true, then a webhook event that does not match the
patterntriggers a build. If false, then a webhook event that matches thepatterntriggers a build.
- pattern
For a
WebHookFilterthat usesEVENTtype, a comma-separated string that specifies one or more events.For example, the webhook filter
PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATEDallows all push, pull request created, and pull request updated events to trigger a build.For a
WebHookFilterthat uses any of the other filter types, a regular expression pattern. For example, aWebHookFilterthat usesHEAD_REFfor itstypeand the pattern^refs/heads/triggers a build when the head reference is a branch with a reference namerefs/heads/branch-name.
- type
The type of webhook filter.
There are 11 webhook filter types:
EVENT,ACTOR_ACCOUNT_ID,HEAD_REF,BASE_REF,FILE_PATH,COMMIT_MESSAGE,TAG_NAME,RELEASE_NAME,REPOSITORY_NAME,ORGANIZATION_NAME, andWORKFLOW_NAME.EVENT
A webhook event triggers a build when the provided
patternmatches one of nine event types:PUSH,PULL_REQUEST_CREATED,PULL_REQUEST_UPDATED,PULL_REQUEST_CLOSED,PULL_REQUEST_REOPENED,PULL_REQUEST_MERGED,RELEASED,PRERELEASED, andWORKFLOW_JOB_QUEUED. TheEVENTpatterns are specified as a comma-separated string. For example,PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATEDfilters all push, pull request created, and pull request updated events.
Types
PULL_REQUEST_REOPENEDandWORKFLOW_JOB_QUEUEDwork with GitHub and GitHub Enterprise only. TypesRELEASEDandPRERELEASEDwork 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-nameandrefs/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 push and pull request events only.
COMMIT_MESSAGE
A webhook triggers a build when the head commit message matches the regular expression
pattern.
Works with push and pull request events only.
TAG_NAME
A webhook triggers a build when the tag name of the release matches the regular expression
pattern.
Works with
RELEASEDandPRERELEASEDevents only.RELEASE_NAME
A webhook triggers a build when the release name matches the regular expression
pattern.
Works with
RELEASEDandPRERELEASEDevents only.REPOSITORY_NAME
A webhook triggers a build when the repository name matches the regular expression
pattern.
Works with GitHub global or organization webhooks only.
ORGANIZATION_NAME
A webhook triggers a build when the organization name matches the regular expression
pattern.
Works with GitHub global webhooks only.
WORKFLOW_NAME
A webhook triggers a build when the workflow name matches the regular expression
pattern.
Works with
WORKFLOW_JOB_QUEUEDevents only. > For CodeBuild-hosted Buildkite runner builds, WORKFLOW_NAME filters will filter by pipeline name.