Interface CfnProject.SourceProperty
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnProject.SourceProperty.Jsii$Proxy
- Enclosing class:
CfnProject
Source is 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.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.codebuild.*;
SourceProperty sourceProperty = SourceProperty.builder()
.type("type")
// the properties below are optional
.auth(SourceAuthProperty.builder()
.type("type")
// the properties below are optional
.resource("resource")
.build())
.buildSpec("buildSpec")
.buildStatusConfig(BuildStatusConfigProperty.builder()
.context("context")
.targetUrl("targetUrl")
.build())
.gitCloneDepth(123)
.gitSubmodulesConfig(GitSubmodulesConfigProperty.builder()
.fetchSubmodules(false)
.build())
.insecureSsl(false)
.location("location")
.reportBuildStatus(false)
.sourceIdentifier("sourceIdentifier")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnProject.SourcePropertystatic final classAn implementation forCfnProject.SourceProperty -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default ObjectgetAuth()Information about the authorization settings for AWS CodeBuild to access the source code to be built.default StringThe build specification for the project.default ObjectContains information that defines how the build project reports the build status to the source provider.default NumberThe depth of history to download.default ObjectInformation about the Git submodules configuration for the build project.default ObjectThis is used with GitHub Enterprise only.default StringInformation about the location of the source code to be built.default ObjectSet to true to report the status of a build's start and finish to your source provider.default StringAn identifier for this project source.getType()The type of repository that contains the source code to be built.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getType
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 Also:
-
getAuth
Information about the authorization settings for AWS CodeBuild to access the source code to be built.Returns union: either
IResolvableorCfnProject.SourceAuthProperty- See Also:
-
getBuildSpec
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 .- See Also:
-
getBuildStatusConfig
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.Returns union: either
IResolvableorCfnProject.BuildStatusConfigProperty- See Also:
-
getGitCloneDepth
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.
- See Also:
-
getGitSubmodulesConfig
Information about the Git submodules configuration for the build project.Returns union: either
IResolvableorCfnProject.GitSubmodulesConfigProperty- See Also:
-
getInsecureSsl
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.Returns union: either
BooleanorIResolvable- See Also:
-
getLocation
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 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 Also:
- For source code settings that are specified in the source action of a pipeline in CodePipeline,
-
getReportBuildStatus
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.Returns union: either
BooleanorIResolvable- See Also:
-
getSourceIdentifier
An identifier for this project source.The identifier can only contain alphanumeric characters and underscores, and must be less than 128 characters in length.
- See Also:
-
builder
- Returns:
- a
CfnProject.SourceProperty.BuilderofCfnProject.SourceProperty
-