ProjectProps Struct
Example
declare const ecrRepository: ecr.Repository;
new codebuild.Project(this, 'Project', {
environment: {
buildImage: codebuild.WindowsBuildImage.fromEcrRepository(ecrRepository, 'v1.0', codebuild.WindowsImageType.SERVER_2019),
// optional certificate to include in the build image
certificate: {
bucket: s3.Bucket.fromBucketName(this, 'Bucket', 'amzn-s3-demo-bucket'),
objectKey: 'path/to/cert.pem',
},
},
// ...
})
Properties
allowAllOutboundbooleanallow_all_outboundboolallowAllOutboundBooleanAllowAllOutboundboolAllowAllOutbound*bool= true#If set to false, you must individually add traffic rules to allow the CodeBuild project to connect to network targets.
Only used if 'vpc' is supplied.
artifactsIArtifactsartifactsIArtifactsartifactsIArtifactsArtifactsIArtifactsArtifactsIArtifacts= NoArtifacts#Could be: PipelineBuildArtifacts, NoArtifacts and S3Artifacts.
autoRetryLimitnumberauto_retry_limitint | floatautoRetryLimitNumberAutoRetryLimitdoubleAutoRetryLimit*float64= no retry#autoRetryLimit must be between 0 and 10.
For more information, see Build Badges Sample in the AWS CodeBuild User Guide.
buildSpecBuildSpecbuild_specBuildSpecbuildSpecBuildSpecBuildSpecBuildSpecBuildSpecBuildSpec= Empty buildspec.#checkSecretsInPlainTextEnvVariablesbooleancheck_secrets_in_plain_text_env_variablesboolcheckSecretsInPlainTextEnvVariablesBooleanCheckSecretsInPlainTextEnvVariablesboolCheckSecretsInPlainTextEnvVariables*bool= true#concurrentBuildLimitnumberconcurrent_build_limitint | floatconcurrentBuildLimitNumberConcurrentBuildLimitdoubleConcurrentBuildLimit*float64= no explicit limit is set#Minimum value is 1 and maximum is account build limit.
descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= No description.#Use the description to identify the purpose of the project.
encryptionKeyIKeyencryption_keyIKeyencryptionKeyIKeyEncryptionKeyIKeyEncryptionKeyIKey= The AWS-managed CMK for Amazon S…#default
Default: The AWS-managed CMK for Amazon Simple Storage Service (Amazon S3) is used.
environmentBuildEnvironmentenvironmentBuildEnvironmentenvironmentBuildEnvironmentEnvironmentBuildEnvironmentEnvironmentBuildEnvironment= BuildEnvironment.LinuxBuildImage…#default
Default: BuildEnvironment.LinuxBuildImage.STANDARD_7_0
environmentVariables{ [key: string]: BuildEnvironmentVariable }environment_variablestyping.Mapping[str, BuildEnvironmentVariable]environmentVariablesMap<String, BuildEnvironmentVariable>EnvironmentVariablesIDictionary<string, BuildEnvironmentVariable>EnvironmentVariables*map[string]BuildEnvironmentVariable= No additional environment variab…#default
Default: No additional environment variables are specified.
fileSystemLocationsIFileSystemLocation[]file_system_locationstyping.List[IFileSystemLocation]fileSystemLocationsList<IFileSystemLocation>FileSystemLocationsIFileSystemLocation[]FileSystemLocations*[]IFileSystemLocation= no file system locations#A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System.
grantReportGroupPermissionsbooleangrant_report_group_permissionsboolgrantReportGroupPermissionsBooleanGrantReportGroupPermissionsboolGrantReportGroupPermissions*bool= true#notes
That is the standard report group that gets created when a simple name (in contrast to an ARN) is used in the 'reports' section of the buildspec of this project. This is usually harmless, but you can turn these off if you don't plan on using test reports in this project.
loggingLoggingOptionsloggingLoggingOptionsloggingLoggingOptionsLoggingLoggingOptionsLoggingLoggingOptions= no log configuration is set#A project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.
projectNamestringproject_namestrprojectNameStringProjectNamestringProjectName*string= Name is automatically generated.#queuedTimeoutDurationqueued_timeoutDurationqueuedTimeoutDurationQueuedTimeoutDurationQueuedTimeoutDuration= no queue timeout is set#For valid values, see the timeoutInMinutes field in the AWS CodeBuild User Guide.
secondaryArtifactsIArtifacts[]secondary_artifactstyping.List[IArtifacts]secondaryArtifactsList<IArtifacts>SecondaryArtifactsIArtifacts[]SecondaryArtifacts*[]IArtifacts= No secondary artifacts.#Can also be added after the Project has been created by using the Project#addSecondaryArtifact method.
secondarySourcesISource[]secondary_sourcestyping.List[ISource]secondarySourcesList<ISource>SecondarySourcesISource[]SecondarySources*[]ISource= No secondary sources.#Can be also added after the Project has been created by using the Project#addSecondarySource method.
securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= Security group will be automatic…#If no security group is identified, one will be created automatically.
Only used if 'vpc' is supplied.
default
Default: Security group will be automatically created.
Note: if NoSource is given as the source, then you need to provide an explicit buildSpec.
ssmSessionPermissionsbooleanssm_session_permissionsboolssmSessionPermissionsBooleanSsmSessionPermissionsboolSsmSessionPermissions*bool= false#notes
If the following prerequisites have been met:
- The necessary permissions have been added by setting this flag to true.
- The build image has the SSM agent installed (true for default CodeBuild images).
- The build is started with debugSessionEnabled set to true.
Then the build container can be paused and inspected using Session Manager by invoking the codebuild-breakpoint command somewhere during the build.
codebuild-breakpoint commands will be ignored if the build is not started with debugSessionEnabled=true.
subnetSelectionSubnetSelectionsubnet_selectionSubnetSelectionsubnetSelectionSubnetSelectionSubnetSelectionSubnetSelectionSubnetSelectionSubnetSelection= private subnets if available els…#notes · default
To access AWS services, your CodeBuild project needs to be in one of the following types of subnets:
- Subnets with access to the internet (of type PRIVATE_WITH_EGRESS).
- Private subnets unconnected to the internet, but with VPC endpoints for the necessary services.
If you don't specify a subnet selection, the default behavior is to use PRIVATE_WITH_EGRESS subnets first if they exist, then PRIVATE_WITHOUT_EGRESS, and finally PUBLIC subnets. If your VPC doesn't have PRIVATE_WITH_EGRESS subnets but you need AWS service access, add VPC Endpoints to your private subnets.
Default: private subnets if available else public subnets
For valid values, see the timeoutInMinutes field in the AWS CodeBuild User Guide.
visibilityProjectVisibilityvisibilityProjectVisibilityvisibilityProjectVisibilityVisibilityProjectVisibilityVisibilityProjectVisibility= no visibility is set#