Class Project.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<Project>
- Enclosing class:
Project
Project
.-
Method Summary
Modifier and TypeMethodDescriptionallowAllOutbound
(Boolean allowAllOutbound) Whether to allow the CodeBuild to send all network traffic.artifacts
(IArtifacts artifacts) Defines where build artifacts will be stored.Indicates whether AWS CodeBuild generates a publicly accessible URL for your project's build badge.build()
Filename or contents of buildspec in JSON format.Caching strategy to use.checkSecretsInPlainTextEnvVariables
(Boolean checkSecretsInPlainTextEnvVariables) Whether to check for the presence of any secrets in the environment variables of the default type, BuildEnvironmentVariableType.PLAINTEXT.concurrentBuildLimit
(Number concurrentBuildLimit) Maximum number of concurrent builds.static Project.Builder
description
(String description) A description of the project.encryptionKey
(IKey encryptionKey) Encryption key to use to read and write artifacts.environment
(BuildEnvironment environment) Build environment to use for the build.environmentVariables
(Map<String, ? extends BuildEnvironmentVariable> environmentVariables) Additional environment variables to add to the build environment.fileSystemLocations
(List<? extends IFileSystemLocation> fileSystemLocations) An ProjectFileSystemLocation objects for a CodeBuild build project.grantReportGroupPermissions
(Boolean grantReportGroupPermissions) Add permissions to this project's role to create and use test report groups with name starting with the name of this project.logging
(LoggingOptions logging) Information about logs for the build project.projectName
(String projectName) The physical, human-readable name of the CodeBuild Project.queuedTimeout
(Duration queuedTimeout) The number of minutes after which AWS CodeBuild stops the build if it's still in queue.Service Role to assume while running the build.secondaryArtifacts
(List<? extends IArtifacts> secondaryArtifacts) The secondary artifacts for the Project.secondarySources
(List<? extends ISource> secondarySources) The secondary sources for the Project.securityGroups
(List<? extends ISecurityGroup> securityGroups) What security group to associate with the codebuild project's network interfaces.The source of the build.ssmSessionPermissions
(Boolean ssmSessionPermissions) Add the permissions necessary for debugging builds with SSM Session Manager.subnetSelection
(SubnetSelection subnetSelection) Where to place the network interfaces within the VPC.The number of minutes after which AWS CodeBuild stops the build if it's not complete.visibility
(ProjectVisibility visibility) Specifies the visibility of the project's builds.VPC network to place codebuild network interfaces.
-
Method Details
-
create
@Stability(Stable) public static Project.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
Project.Builder
.
-
allowAllOutbound
Whether to allow the CodeBuild to send all network traffic.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.
Default: true
- Parameters:
allowAllOutbound
- Whether to allow the CodeBuild to send all network traffic. This parameter is required.- Returns:
this
-
badge
Indicates whether AWS CodeBuild generates a publicly accessible URL for your project's build badge.For more information, see Build Badges Sample in the AWS CodeBuild User Guide.
Default: false
- Parameters:
badge
- Indicates whether AWS CodeBuild generates a publicly accessible URL for your project's build badge. This parameter is required.- Returns:
this
-
buildSpec
Filename or contents of buildspec in JSON format.Default: - Empty buildspec.
- Parameters:
buildSpec
- Filename or contents of buildspec in JSON format. This parameter is required.- Returns:
this
- See Also:
-
cache
Caching strategy to use.Default: Cache.none
- Parameters:
cache
- Caching strategy to use. This parameter is required.- Returns:
this
-
checkSecretsInPlainTextEnvVariables
@Stability(Stable) public Project.Builder checkSecretsInPlainTextEnvVariables(Boolean checkSecretsInPlainTextEnvVariables) Whether to check for the presence of any secrets in the environment variables of the default type, BuildEnvironmentVariableType.PLAINTEXT. Since using a secret for the value of that kind of variable would result in it being displayed in plain text in the AWS Console, the construct will throw an exception if it detects a secret was passed there. Pass this property as false if you want to skip this validation, and keep using a secret in a plain text environment variable.Default: true
- Parameters:
checkSecretsInPlainTextEnvVariables
- Whether to check for the presence of any secrets in the environment variables of the default type, BuildEnvironmentVariableType.PLAINTEXT. Since using a secret for the value of that kind of variable would result in it being displayed in plain text in the AWS Console, the construct will throw an exception if it detects a secret was passed there. Pass this property as false if you want to skip this validation, and keep using a secret in a plain text environment variable. This parameter is required.- Returns:
this
-
concurrentBuildLimit
Maximum number of concurrent builds.Minimum value is 1 and maximum is account build limit.
Default: - no explicit limit is set
- Parameters:
concurrentBuildLimit
- Maximum number of concurrent builds. This parameter is required.- Returns:
this
-
description
A description of the project.Use the description to identify the purpose of the project.
Default: - No description.
- Parameters:
description
- A description of the project. This parameter is required.- Returns:
this
-
encryptionKey
Encryption key to use to read and write artifacts.Default: - The AWS-managed CMK for Amazon Simple Storage Service (Amazon S3) is used.
- Parameters:
encryptionKey
- Encryption key to use to read and write artifacts. This parameter is required.- Returns:
this
-
environment
Build environment to use for the build.Default: BuildEnvironment.LinuxBuildImage.STANDARD_7_0
- Parameters:
environment
- Build environment to use for the build. This parameter is required.- Returns:
this
-
environmentVariables
@Stability(Stable) public Project.Builder environmentVariables(Map<String, ? extends BuildEnvironmentVariable> environmentVariables) Additional environment variables to add to the build environment.Default: - No additional environment variables are specified.
- Parameters:
environmentVariables
- Additional environment variables to add to the build environment. This parameter is required.- Returns:
this
-
fileSystemLocations
@Stability(Stable) public Project.Builder fileSystemLocations(List<? extends IFileSystemLocation> fileSystemLocations) An ProjectFileSystemLocation objects for a CodeBuild build project.A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System.
Default: - no file system locations
- Parameters:
fileSystemLocations
- An ProjectFileSystemLocation objects for a CodeBuild build project. This parameter is required.- Returns:
this
-
grantReportGroupPermissions
@Stability(Stable) public Project.Builder grantReportGroupPermissions(Boolean grantReportGroupPermissions) Add permissions to this project's role to create and use test report groups with name starting with the name of this project.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.
Default: true
- Parameters:
grantReportGroupPermissions
- Add permissions to this project's role to create and use test report groups with name starting with the name of this project. This parameter is required.- Returns:
this
- See Also:
-
logging
Information about logs for the build project.A project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.
Default: - no log configuration is set
- Parameters:
logging
- Information about logs for the build project. This parameter is required.- Returns:
this
-
projectName
The physical, human-readable name of the CodeBuild Project.Default: - Name is automatically generated.
- Parameters:
projectName
- The physical, human-readable name of the CodeBuild Project. This parameter is required.- Returns:
this
-
queuedTimeout
The number of minutes after which AWS CodeBuild stops the build if it's still in queue.For valid values, see the timeoutInMinutes field in the AWS CodeBuild User Guide.
Default: - no queue timeout is set
- Parameters:
queuedTimeout
- The number of minutes after which AWS CodeBuild stops the build if it's still in queue. This parameter is required.- Returns:
this
-
role
Service Role to assume while running the build.Default: - A role will be created.
- Parameters:
role
- Service Role to assume while running the build. This parameter is required.- Returns:
this
-
securityGroups
@Stability(Stable) public Project.Builder securityGroups(List<? extends ISecurityGroup> securityGroups) What security group to associate with the codebuild project's network interfaces.If no security group is identified, one will be created automatically.
Only used if 'vpc' is supplied.
Default: - Security group will be automatically created.
- Parameters:
securityGroups
- What security group to associate with the codebuild project's network interfaces. This parameter is required.- Returns:
this
-
ssmSessionPermissions
Add the permissions necessary for debugging builds with SSM Session Manager.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 withdebugSessionEnabled=true
.Default: false
- Parameters:
ssmSessionPermissions
- Add the permissions necessary for debugging builds with SSM Session Manager. This parameter is required.- Returns:
this
- See Also:
-
subnetSelection
Where to place the network interfaces within the VPC.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
- Parameters:
subnetSelection
- Where to place the network interfaces within the VPC. This parameter is required.- Returns:
this
- See Also:
-
timeout
The number of minutes after which AWS CodeBuild stops the build if it's not complete.For valid values, see the timeoutInMinutes field in the AWS CodeBuild User Guide.
Default: Duration.hours(1)
- Parameters:
timeout
- The number of minutes after which AWS CodeBuild stops the build if it's not complete. This parameter is required.- Returns:
this
-
visibility
Specifies the visibility of the project's builds.Default: - no visibility is set
- Parameters:
visibility
- Specifies the visibility of the project's builds. This parameter is required.- Returns:
this
-
vpc
VPC network to place codebuild network interfaces.Specify this if the codebuild project needs to access resources in a VPC.
Default: - No VPC is specified.
- Parameters:
vpc
- VPC network to place codebuild network interfaces. This parameter is required.- Returns:
this
-
artifacts
Defines where build artifacts will be stored.Could be: PipelineBuildArtifacts, NoArtifacts and S3Artifacts.
Default: NoArtifacts
- Parameters:
artifacts
- Defines where build artifacts will be stored. This parameter is required.- Returns:
this
-
secondaryArtifacts
@Stability(Stable) public Project.Builder secondaryArtifacts(List<? extends IArtifacts> secondaryArtifacts) The secondary artifacts for the Project.Can also be added after the Project has been created by using the
Project#addSecondaryArtifact
method.Default: - No secondary artifacts.
- Parameters:
secondaryArtifacts
- The secondary artifacts for the Project. This parameter is required.- Returns:
this
- See Also:
-
secondarySources
@Stability(Stable) public Project.Builder secondarySources(List<? extends ISource> secondarySources) The secondary sources for the Project.Can be also added after the Project has been created by using the
Project#addSecondarySource
method.Default: - No secondary sources.
- Parameters:
secondarySources
- The secondary sources for the Project. This parameter is required.- Returns:
this
- See Also:
-
source
The source of the build.Note: if
NoSource
is given as the source, then you need to provide an explicitbuildSpec
.Default: - NoSource
- Parameters:
source
- The source of the build. This parameter is required.- Returns:
this
-
build
-