Class CfnProject.SourceProperty.Builder
java.lang.Object
software.amazon.awscdk.services.codebuild.CfnProject.SourceProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnProject.SourceProperty>
- Enclosing interface:
CfnProject.SourceProperty
@Stability(Stable)
public static final class CfnProject.SourceProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnProject.SourceProperty>
A builder for
CfnProject.SourceProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionauth
(IResolvable auth) Sets the value ofCfnProject.SourceProperty.getAuth()
Sets the value ofCfnProject.SourceProperty.getAuth()
build()
Builds the configured instance.Sets the value ofCfnProject.SourceProperty.getBuildSpec()
buildStatusConfig
(IResolvable buildStatusConfig) Sets the value ofCfnProject.SourceProperty.getBuildStatusConfig()
buildStatusConfig
(CfnProject.BuildStatusConfigProperty buildStatusConfig) Sets the value ofCfnProject.SourceProperty.getBuildStatusConfig()
gitCloneDepth
(Number gitCloneDepth) Sets the value ofCfnProject.SourceProperty.getGitCloneDepth()
gitSubmodulesConfig
(IResolvable gitSubmodulesConfig) Sets the value ofCfnProject.SourceProperty.getGitSubmodulesConfig()
gitSubmodulesConfig
(CfnProject.GitSubmodulesConfigProperty gitSubmodulesConfig) Sets the value ofCfnProject.SourceProperty.getGitSubmodulesConfig()
insecureSsl
(Boolean insecureSsl) Sets the value ofCfnProject.SourceProperty.getInsecureSsl()
insecureSsl
(IResolvable insecureSsl) Sets the value ofCfnProject.SourceProperty.getInsecureSsl()
Sets the value ofCfnProject.SourceProperty.getLocation()
reportBuildStatus
(Boolean reportBuildStatus) Sets the value ofCfnProject.SourceProperty.getReportBuildStatus()
reportBuildStatus
(IResolvable reportBuildStatus) Sets the value ofCfnProject.SourceProperty.getReportBuildStatus()
sourceIdentifier
(String sourceIdentifier) Sets the value ofCfnProject.SourceProperty.getSourceIdentifier()
Sets the value ofCfnProject.SourceProperty.getType()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
type
Sets the value ofCfnProject.SourceProperty.getType()
- Parameters:
type
- The type of repository that contains the source code to be built. Valid values include:. This parameter is required.BITBUCKET
: The source code is in a Bitbucket repository.CODECOMMIT
: The source code is in an CodeCommit repository.CODEPIPELINE
: The source code settings are specified in the source action of a pipeline in CodePipeline.GITHUB
: The source code is in a GitHub or GitHub Enterprise Cloud repository.GITHUB_ENTERPRISE
: The source code is in a GitHub Enterprise Server repository.NO_SOURCE
: The project does not have input source code.S3
: The source code is in an Amazon S3 bucket.
- Returns:
this
-
auth
Sets the value ofCfnProject.SourceProperty.getAuth()
- Parameters:
auth
- Information about the authorization settings for AWS CodeBuild to access the source code to be built. This information is for the AWS CodeBuild console's use only. Your code should not get or setAuth
directly.- Returns:
this
-
auth
@Stability(Stable) public CfnProject.SourceProperty.Builder auth(CfnProject.SourceAuthProperty auth) Sets the value ofCfnProject.SourceProperty.getAuth()
- Parameters:
auth
- Information about the authorization settings for AWS CodeBuild to access the source code to be built. This information is for the AWS CodeBuild console's use only. Your code should not get or setAuth
directly.- Returns:
this
-
buildSpec
Sets the value ofCfnProject.SourceProperty.getBuildSpec()
- Parameters:
buildSpec
- The build specification for the project. If this value is not provided, then the source code must contain a buildspec file namedbuildspec.yml
at the root level. If this value is provided, it can be either a single string containing the entire build specification, or the path to an alternate buildspec file relative to the value of the built-in environment variableCODEBUILD_SRC_DIR
. The alternate buildspec file can have a name other thanbuildspec.yml
, for examplemyspec.yml
orbuild_spec_qa.yml
or similar. For more information, see the Build Spec Reference in the AWS CodeBuild User Guide .- Returns:
this
-
buildStatusConfig
@Stability(Stable) public CfnProject.SourceProperty.Builder buildStatusConfig(IResolvable buildStatusConfig) Sets the value ofCfnProject.SourceProperty.getBuildStatusConfig()
- Parameters:
buildStatusConfig
- 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
.- Returns:
this
-
buildStatusConfig
@Stability(Stable) public CfnProject.SourceProperty.Builder buildStatusConfig(CfnProject.BuildStatusConfigProperty buildStatusConfig) Sets the value ofCfnProject.SourceProperty.getBuildStatusConfig()
- Parameters:
buildStatusConfig
- 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
.- Returns:
this
-
gitCloneDepth
Sets the value ofCfnProject.SourceProperty.getGitCloneDepth()
- Parameters:
gitCloneDepth
- 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.- Returns:
this
-
gitSubmodulesConfig
@Stability(Stable) public CfnProject.SourceProperty.Builder gitSubmodulesConfig(IResolvable gitSubmodulesConfig) Sets the value ofCfnProject.SourceProperty.getGitSubmodulesConfig()
- Parameters:
gitSubmodulesConfig
- Information about the Git submodules configuration for the build project.- Returns:
this
-
gitSubmodulesConfig
@Stability(Stable) public CfnProject.SourceProperty.Builder gitSubmodulesConfig(CfnProject.GitSubmodulesConfigProperty gitSubmodulesConfig) Sets the value ofCfnProject.SourceProperty.getGitSubmodulesConfig()
- Parameters:
gitSubmodulesConfig
- Information about the Git submodules configuration for the build project.- Returns:
this
-
insecureSsl
Sets the value ofCfnProject.SourceProperty.getInsecureSsl()
- Parameters:
insecureSsl
- 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
.InsecureSsl
should be used for testing purposes only. It should not be used in a production environment.- Returns:
this
-
insecureSsl
Sets the value ofCfnProject.SourceProperty.getInsecureSsl()
- Parameters:
insecureSsl
- 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
.InsecureSsl
should be used for testing purposes only. It should not be used in a production environment.- Returns:
this
-
location
Sets the value ofCfnProject.SourceProperty.getLocation()
- Parameters:
location
- Information about the location of the source code to be built. Valid values include:.- For source code settings that are specified in the source action of a pipeline in CodePipeline,
location
should not be specified. If it is specified, CodePipeline ignores it. This is because CodePipeline uses the settings in a pipeline's source action instead of this value. - For source code in an CodeCommit repository, the HTTPS clone URL to the repository that contains the source code and the buildspec file (for example,
https://git-codecommit.<region-ID>.amazonaws.com/v1/repos/<repo-name>
). - For source code in an Amazon S3 input bucket, one of the following.
- The path to the ZIP file that contains the source code (for example,
<bucket-name>/<path>/<object-name>.zip
). - The path to the folder that contains the source code (for example,
<bucket-name>/<path-to-source-code>/<folder>/
). - For source code in a GitHub repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your AWS account to your GitHub account. Use the AWS CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with GitHub, on the GitHub Authorize application page, for Organization access , choose Request access next to each repository you want to allow AWS CodeBuild to have access to, and then choose Authorize application . (After you have connected to your GitHub account, you do not need to finish creating the build project. You can leave the AWS CodeBuild console.) To instruct AWS CodeBuild to use this connection, in the
source
object, set theauth
object'stype
value toOAUTH
. - For source code in a Bitbucket repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your AWS account to your Bitbucket account. Use the AWS CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with Bitbucket, on the Bitbucket Confirm access to your account page, choose Grant access . (After you have connected to your Bitbucket account, you do not need to finish creating the build project. You can leave the AWS CodeBuild console.) To instruct AWS CodeBuild to use this connection, in the
source
object, set theauth
object'stype
value toOAUTH
.
If you specify
CODEPIPELINE
for theType
property, don't specify this property. For all of the other types, you must specifyLocation
.- For source code settings that are specified in the source action of a pipeline in CodePipeline,
- Returns:
this
-
reportBuildStatus
@Stability(Stable) public CfnProject.SourceProperty.Builder reportBuildStatus(Boolean reportBuildStatus) Sets the value ofCfnProject.SourceProperty.getReportBuildStatus()
- Parameters:
reportBuildStatus
- Set to true to report the status of a build's start and finish to your source provider. This option is valid only when your source provider is GitHub, GitHub Enterprise, or Bitbucket. If this is set and you use a different source provider, aninvalidInputException
is thrown.- Returns:
this
-
reportBuildStatus
@Stability(Stable) public CfnProject.SourceProperty.Builder reportBuildStatus(IResolvable reportBuildStatus) Sets the value ofCfnProject.SourceProperty.getReportBuildStatus()
- Parameters:
reportBuildStatus
- Set to true to report the status of a build's start and finish to your source provider. This option is valid only when your source provider is GitHub, GitHub Enterprise, or Bitbucket. If this is set and you use a different source provider, aninvalidInputException
is thrown.- Returns:
this
-
sourceIdentifier
@Stability(Stable) public CfnProject.SourceProperty.Builder sourceIdentifier(String sourceIdentifier) Sets the value ofCfnProject.SourceProperty.getSourceIdentifier()
- Parameters:
sourceIdentifier
- An identifier for this project source. The identifier can only contain alphanumeric characters and underscores, and must be less than 128 characters in length.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnProject.SourceProperty>
- Returns:
- a new instance of
CfnProject.SourceProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-