@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:16.621Z") @Stability(value=Experimental) public abstract class CodePipelineSource extends Step implements ICodePipelineActionFactory
This class contains a number of factory methods for the different types of sources that CodePipeline supports.
Example:
CodePipeline pipeline = CodePipeline.Builder.create(this, "Pipeline")
// Encrypt artifacts, required for cross-account deployments
.crossAccountKeys(true)
.synth(ShellStep.Builder.create("Synth")
.input(CodePipelineSource.connection("my-org/my-app", "main", ConnectionSourceOptions.builder()
.connectionArn("arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41")
.build()))
.commands(List.of("npm ci", "npm run build", "npx cdk synth"))
.build())
.build();
software.amazon.jsii.JsiiObject.InitializationModeICodePipelineActionFactory.Jsii$DefaultIFileSetProducer.Jsii$Default| Modifier | Constructor and Description |
|---|---|
protected |
CodePipelineSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CodePipelineSource(software.amazon.jsii.JsiiObjectRef objRef) |
protected |
CodePipelineSource(String id) |
| Modifier and Type | Method and Description |
|---|---|
static CodePipelineSource |
codeCommit(IRepository repository,
String branch)
(experimental) Returns a CodeCommit source.
|
static CodePipelineSource |
codeCommit(IRepository repository,
String branch,
CodeCommitSourceOptions props)
(experimental) Returns a CodeCommit source.
|
static CodePipelineSource |
connection(String repoString,
String branch,
ConnectionSourceOptions props)
(experimental) Returns a CodeStar connection source.
|
protected abstract Action |
getAction(Artifact output,
String actionName,
Number runOrder) |
Boolean |
getIsSource()
(experimental) Whether or not this is a Source step.
|
static CodePipelineSource |
gitHub(String repoString,
String branch)
(experimental) Returns a GitHub source, using OAuth tokens to authenticate with GitHub and a separate webhook to detect changes.
|
static CodePipelineSource |
gitHub(String repoString,
String branch,
GitHubSourceOptions props)
(experimental) Returns a GitHub source, using OAuth tokens to authenticate with GitHub and a separate webhook to detect changes.
|
CodePipelineActionFactoryResult |
produceAction(IStage stage,
ProduceActionOptions options)
(experimental) Create the desired Action and add it to the pipeline.
|
static CodePipelineSource |
s3(IBucket bucket,
String objectKey)
(experimental) Returns an S3 source.
|
static CodePipelineSource |
s3(IBucket bucket,
String objectKey,
S3SourceOptions props)
(experimental) Returns an S3 source.
|
addDependencyFileSet, configurePrimaryOutput, getDependencies, getDependencyFileSets, getId, getPrimaryOutput, toStringjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected CodePipelineSource(software.amazon.jsii.JsiiObjectRef objRef)
protected CodePipelineSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
protected CodePipelineSource(@NotNull
String id)
id - Identifier for this step. This parameter is required.@Stability(value=Experimental) @NotNull public static CodePipelineSource codeCommit(@NotNull IRepository repository, @NotNull String branch, @Nullable CodeCommitSourceOptions props)
Example:
IRepository repository; CodePipelineSource.codeCommit(repository, "main");
repository - The CodeCommit repository. This parameter is required.branch - The branch to use. This parameter is required.props - The source properties.@Stability(value=Experimental) @NotNull public static CodePipelineSource codeCommit(@NotNull IRepository repository, @NotNull String branch)
Example:
IRepository repository; CodePipelineSource.codeCommit(repository, "main");
repository - The CodeCommit repository. This parameter is required.branch - The branch to use. This parameter is required.@Stability(value=Experimental) @NotNull public static CodePipelineSource connection(@NotNull String repoString, @NotNull String branch, @NotNull ConnectionSourceOptions props)
A CodeStar connection allows AWS CodePipeline to access external resources, such as repositories in GitHub, GitHub Enterprise or BitBucket.
To use this method, you first need to create a CodeStar connection using the AWS console. In the process, you may have to sign in to the external provider -- GitHub, for example -- to authorize AWS to read and modify your repository. Once you have done this, copy the connection ARN and use it to create the source.
Example:
CodePipelineSource.connection("owner/repo", "main", ConnectionSourceOptions.builder()
.connectionArn("arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41")
.build());
repoString - A string that encodes owner and repository separated by a slash (e.g. 'owner/repo'). This parameter is required.branch - The branch to use. This parameter is required.props - The source properties, including the connection ARN. This parameter is required.https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html@Stability(value=Experimental) @NotNull public static CodePipelineSource gitHub(@NotNull String repoString, @NotNull String branch, @Nullable GitHubSourceOptions props)
This is no longer
the recommended method. Please consider using connection()
instead.
Pass in the owner and repository in a single string, like this:
CodePipelineSource.gitHub("owner/repo", "main");
Authentication will be done by a secret called github-token in AWS
Secrets Manager (unless specified otherwise).
The token should have these permissions:
repoString - This parameter is required.branch - This parameter is required.props - @Stability(value=Experimental) @NotNull public static CodePipelineSource gitHub(@NotNull String repoString, @NotNull String branch)
This is no longer
the recommended method. Please consider using connection()
instead.
Pass in the owner and repository in a single string, like this:
CodePipelineSource.gitHub("owner/repo", "main");
Authentication will be done by a secret called github-token in AWS
Secrets Manager (unless specified otherwise).
The token should have these permissions:
repoString - This parameter is required.branch - This parameter is required.@Stability(value=Experimental) @NotNull public static CodePipelineSource s3(@NotNull IBucket bucket, @NotNull String objectKey, @Nullable S3SourceOptions props)
Example:
Bucket bucket; CodePipelineSource.s3(bucket, "path/to/file.zip");
bucket - The bucket where the source code is located. This parameter is required.objectKey - This parameter is required.props - The options, which include the key that identifies the source code file and and how the pipeline should be triggered.@Stability(value=Experimental) @NotNull public static CodePipelineSource s3(@NotNull IBucket bucket, @NotNull String objectKey)
Example:
Bucket bucket; CodePipelineSource.s3(bucket, "path/to/file.zip");
bucket - The bucket where the source code is located. This parameter is required.objectKey - This parameter is required.@Stability(value=Experimental) @NotNull protected abstract Action getAction(@NotNull Artifact output, @NotNull String actionName, @NotNull Number runOrder)
output - This parameter is required.actionName - This parameter is required.runOrder - This parameter is required.@Stability(value=Experimental) @NotNull public CodePipelineActionFactoryResult produceAction(@NotNull IStage stage, @NotNull ProduceActionOptions options)
produceAction in interface ICodePipelineActionFactorystage - This parameter is required.options - This parameter is required.@Stability(value=Experimental) @NotNull public Boolean getIsSource()
What it means to be a Source step depends on the engine.
getIsSource in class StepCopyright © 2022. All rights reserved.