create_project
async
¶
create_project(
name: ProjectName,
source: ProjectSource,
artifacts: ProjectArtifacts,
environment: ProjectEnvironment,
service_role: NonEmptyString,
*,
config_overrides: Optional[AsyncCodeBuildClientConfig] = None,
description: Optional[ProjectDescription] = None,
secondary_sources: Optional[ProjectSources] = None,
source_version: Optional[String] = None,
secondary_source_versions: Optional[ProjectSecondarySourceVersions] = None,
secondary_artifacts: Optional[ProjectArtifactsList] = None,
cache: Optional[ProjectCache] = None,
timeout_in_minutes: Optional[BuildTimeOut] = None,
queued_timeout_in_minutes: Optional[TimeOut] = None,
encryption_key: Optional[NonEmptyString] = None,
tags: Optional[TagList] = None,
vpc_config: Optional[VpcConfig] = None,
badge_enabled: Optional[WrapperBoolean] = None,
logs_config: Optional[LogsConfig] = None,
file_system_locations: Optional[ProjectFileSystemLocations] = None,
build_batch_config: Optional[ProjectBuildBatchConfig] = None,
concurrent_build_limit: Optional[WrapperInt] = None,
auto_retry_limit: Optional[WrapperInt] = None,
) -> CreateProjectOutput
Creates a build project.
Parameters:
-
name(ProjectName) –The name of the build project.
-
description(Optional[ProjectDescription], default:None) –A description that makes the build project easy to identify.
-
source(ProjectSource) –Information about the build input source code for the build project.
-
secondary_sources(Optional[ProjectSources], default:None) –An array of
ProjectSourceobjects. -
source_version(Optional[String], default:None) –A version of the build input to be built for this project. If not specified, the latest version is used. If specified, it must be one of:
-
For CodeCommit: the commit ID, branch, or Git tag to use.
-
For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format
pr/pull-request-ID(for examplepr/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.
If
sourceVersionis specified at the build level, then that version takes precedence over thissourceVersion(at the project level).For more information, see Source Version Sample with CodeBuild in the CodeBuild User Guide.
-
-
secondary_source_versions(Optional[ProjectSecondarySourceVersions], default:None) –An array of
ProjectSourceVersionobjects. IfsecondarySourceVersionsis specified at the build level, then they take precedence over thesesecondarySourceVersions(at the project level). -
artifacts(ProjectArtifacts) –Information about the build output artifacts for the build project.
-
secondary_artifacts(Optional[ProjectArtifactsList], default:None) –An array of
ProjectArtifactsobjects. -
cache(Optional[ProjectCache], default:None) –Stores recently used information so that it can be quickly accessed at a later time.
-
environment(ProjectEnvironment) –Information about the build environment for the build project.
-
service_role(NonEmptyString) –The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web Services services on behalf of the Amazon Web Services account.
-
timeout_in_minutes(Optional[BuildTimeOut], default:None) –How long, in minutes, from 5 to 2160 (36 hours), for CodeBuild to wait before it times out any build that has not been marked as completed. The default is 60 minutes.
-
queued_timeout_in_minutes(Optional[TimeOut], default:None) –The number of minutes a build is allowed to be queued before it times out.
-
encryption_key(Optional[NonEmptyString], default:None) –The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.
You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key.
You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the format
alias/). -
tags(Optional[TagList], default:None) –A list of tag key and value pairs associated with this build project.
These tags are available for use by Amazon Web Services services that support CodeBuild build project tags.
-
vpc_config(Optional[VpcConfig], default:None) –VpcConfig enables CodeBuild to access resources in an Amazon VPC.
If you're using compute fleets during project creation, do not provide vpcConfig.
-
badge_enabled(Optional[WrapperBoolean], default:None) –Set this to true to generate a publicly accessible URL for your project's build badge.
-
logs_config(Optional[LogsConfig], default:None) –Information about logs for the build project. These can be logs in CloudWatch Logs, logs uploaded to a specified S3 bucket, or both.
-
file_system_locations(Optional[ProjectFileSystemLocations], default:None) –An array of
ProjectFileSystemLocationobjects for a CodeBuild build project. AProjectFileSystemLocationobject specifies theidentifier,location,mountOptions,mountPoint, andtypeof a file system created using Amazon Elastic File System. -
build_batch_config(Optional[ProjectBuildBatchConfig], default:None) –A ProjectBuildBatchConfig object that defines the batch build options for the project.
-
concurrent_build_limit(Optional[WrapperInt], default:None) –The maximum number of concurrent builds that are allowed for this project.
New builds are only started if the current number of builds is less than or equal to this limit. If the current build count meets this limit, new builds are throttled and are not run.
-
auto_retry_limit(Optional[WrapperInt], default:None) –The maximum number of additional automatic retries after a failed build. For example, if the auto-retry limit is set to 2, CodeBuild will call the
RetryBuildAPI to automatically retry your build for up to 2 additional times.
Raises:
-
AccountLimitExceededException–An Amazon Web Services service limit was exceeded for the calling Amazon Web Services account.
-
InvalidInputException–The input value that was provided is not valid.
-
ResourceAlreadyExistsException–The specified Amazon Web Services resource cannot be created, because an Amazon Web Services resource with the same settings already exists.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_codebuild/_services/async_code_build.py
870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 | |