@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:36:52.216Z") public class Pipeline extends Resource implements IPipeline
Example:
// create a pipeline import software.amazon.awscdk.services.codecommit.*; // add a source action to the stage Repository repo; Artifact sourceArtifact; Pipeline pipeline = new Pipeline(this, "Pipeline"); // add a stage IStage sourceStage = pipeline.addStage(StageOptions.builder().stageName("Source").build()); sourceStage.addAction(CodeCommitSourceAction.Builder.create() .actionName("Source") .output(sourceArtifact) .repository(repo) .build());
Modifier and Type | Class and Description |
---|---|
static class |
Pipeline.Builder
A fluent builder for
Pipeline . |
IPipeline.Jsii$Default, IPipeline.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
Pipeline(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Pipeline(software.amazon.jsii.JsiiObjectRef objRef) |
|
Pipeline(software.constructs.Construct scope,
java.lang.String id) |
|
Pipeline(software.constructs.Construct scope,
java.lang.String id,
PipelineProps props) |
Modifier and Type | Method and Description |
---|---|
IStage |
addStage(StageOptions props)
Creates a new Stage, and adds it to this Pipeline.
|
void |
addToRolePolicy(PolicyStatement statement)
Adds a statement to the pipeline role.
|
NotificationRuleSourceConfig |
bindAsNotificationRuleSource(software.constructs.Construct _scope)
Returns a source configuration for notification rule.
|
static IPipeline |
fromPipelineArn(software.constructs.Construct scope,
java.lang.String id,
java.lang.String pipelineArn)
Import a pipeline into this app.
|
IBucket |
getArtifactBucket()
Bucket used to store output artifacts.
|
java.util.Map<java.lang.String,CrossRegionSupport> |
getCrossRegionSupport()
Returns all of the
CrossRegionSupportStack s that were generated automatically when dealing with Actions that reside in a different region than the Pipeline itself. |
java.lang.String |
getPipelineArn()
ARN of this pipeline.
|
java.lang.String |
getPipelineName()
The name of the pipeline.
|
java.lang.String |
getPipelineVersion()
The version of the pipeline.
|
IRole |
getRole()
The IAM role AWS CodePipeline will use to perform actions or assume roles for actions with a more specific IAM role.
|
java.lang.Number |
getStageCount()
Get the number of Stages in this Pipeline.
|
java.util.List<IStage> |
getStages()
Returns the stages that comprise the pipeline.
|
INotificationRule |
notifyOn(java.lang.String id,
INotificationRuleTarget target,
PipelineNotifyOnOptions options)
Defines a CodeStar notification rule triggered when the pipeline events emitted by you specified, it very similar to `onEvent` API.
|
INotificationRule |
notifyOnAnyActionStateChange(java.lang.String id,
INotificationRuleTarget target)
Define an notification rule triggered by the set of the "Action execution" events emitted from this pipeline.
|
INotificationRule |
notifyOnAnyActionStateChange(java.lang.String id,
INotificationRuleTarget target,
NotificationRuleOptions options)
Define an notification rule triggered by the set of the "Action execution" events emitted from this pipeline.
|
INotificationRule |
notifyOnAnyManualApprovalStateChange(java.lang.String id,
INotificationRuleTarget target)
Define an notification rule triggered by the set of the "Manual approval" events emitted from this pipeline.
|
INotificationRule |
notifyOnAnyManualApprovalStateChange(java.lang.String id,
INotificationRuleTarget target,
NotificationRuleOptions options)
Define an notification rule triggered by the set of the "Manual approval" events emitted from this pipeline.
|
INotificationRule |
notifyOnAnyStageStateChange(java.lang.String id,
INotificationRuleTarget target)
Define an notification rule triggered by the set of the "Stage execution" events emitted from this pipeline.
|
INotificationRule |
notifyOnAnyStageStateChange(java.lang.String id,
INotificationRuleTarget target,
NotificationRuleOptions options)
Define an notification rule triggered by the set of the "Stage execution" events emitted from this pipeline.
|
INotificationRule |
notifyOnExecutionStateChange(java.lang.String id,
INotificationRuleTarget target)
Define an notification rule triggered by the set of the "Pipeline execution" events emitted from this pipeline.
|
INotificationRule |
notifyOnExecutionStateChange(java.lang.String id,
INotificationRuleTarget target,
NotificationRuleOptions options)
Define an notification rule triggered by the set of the "Pipeline execution" events emitted from this pipeline.
|
Rule |
onEvent(java.lang.String id)
Defines an event rule triggered by this CodePipeline.
|
Rule |
onEvent(java.lang.String id,
OnEventOptions options)
Defines an event rule triggered by this CodePipeline.
|
Rule |
onStateChange(java.lang.String id)
Defines an event rule triggered by the "CodePipeline Pipeline Execution State Change" event emitted from this pipeline.
|
Rule |
onStateChange(java.lang.String id,
OnEventOptions options)
Defines an event rule triggered by the "CodePipeline Pipeline Execution State Change" event emitted from this pipeline.
|
IStage |
stage(java.lang.String stageName)
Access one of the pipeline's stages by stage name.
|
protected java.util.List<java.lang.String> |
validate()
Validate the pipeline structure.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected Pipeline(software.amazon.jsii.JsiiObjectRef objRef)
protected Pipeline(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public Pipeline(software.constructs.Construct scope, java.lang.String id, PipelineProps props)
scope
- This parameter is required.id
- This parameter is required.props
- public Pipeline(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public static IPipeline fromPipelineArn(software.constructs.Construct scope, java.lang.String id, java.lang.String pipelineArn)
scope
- the scope into which to import this pipeline. This parameter is required.id
- the logical ID of the returned pipeline construct. This parameter is required.pipelineArn
- The ARN of the pipeline (e.g. `arn:aws:codepipeline:us-east-1:123456789012:MyDemoPipeline`). This parameter is required.public IStage addStage(StageOptions props)
props
- the creation properties of the new Stage. This parameter is required.public void addToRolePolicy(PolicyStatement statement)
statement
- This parameter is required.public NotificationRuleSourceConfig bindAsNotificationRuleSource(software.constructs.Construct _scope)
bindAsNotificationRuleSource
in interface INotificationRuleSource
_scope
- This parameter is required.public INotificationRule notifyOn(java.lang.String id, INotificationRuleTarget target, PipelineNotifyOnOptions options)
You can also use the methods notifyOnExecutionStateChange
, notifyOnAnyStageStateChange
,
notifyOnAnyActionStateChange
and notifyOnAnyManualApprovalStateChange
to define rules for these specific event emitted.
public INotificationRule notifyOnAnyActionStateChange(java.lang.String id, INotificationRuleTarget target, NotificationRuleOptions options)
notifyOnAnyActionStateChange
in interface IPipeline
id
- This parameter is required.target
- This parameter is required.options
- public INotificationRule notifyOnAnyActionStateChange(java.lang.String id, INotificationRuleTarget target)
notifyOnAnyActionStateChange
in interface IPipeline
id
- This parameter is required.target
- This parameter is required.public INotificationRule notifyOnAnyManualApprovalStateChange(java.lang.String id, INotificationRuleTarget target, NotificationRuleOptions options)
notifyOnAnyManualApprovalStateChange
in interface IPipeline
id
- This parameter is required.target
- This parameter is required.options
- public INotificationRule notifyOnAnyManualApprovalStateChange(java.lang.String id, INotificationRuleTarget target)
notifyOnAnyManualApprovalStateChange
in interface IPipeline
id
- This parameter is required.target
- This parameter is required.public INotificationRule notifyOnAnyStageStateChange(java.lang.String id, INotificationRuleTarget target, NotificationRuleOptions options)
notifyOnAnyStageStateChange
in interface IPipeline
id
- This parameter is required.target
- This parameter is required.options
- public INotificationRule notifyOnAnyStageStateChange(java.lang.String id, INotificationRuleTarget target)
notifyOnAnyStageStateChange
in interface IPipeline
id
- This parameter is required.target
- This parameter is required.public INotificationRule notifyOnExecutionStateChange(java.lang.String id, INotificationRuleTarget target, NotificationRuleOptions options)
notifyOnExecutionStateChange
in interface IPipeline
id
- This parameter is required.target
- This parameter is required.options
- public INotificationRule notifyOnExecutionStateChange(java.lang.String id, INotificationRuleTarget target)
notifyOnExecutionStateChange
in interface IPipeline
id
- This parameter is required.target
- This parameter is required.public Rule onEvent(java.lang.String id, OnEventOptions options)
public Rule onEvent(java.lang.String id)
public Rule onStateChange(java.lang.String id, OnEventOptions options)
onStateChange
in interface IPipeline
id
- Identifier for this event handler. This parameter is required.options
- Additional options to pass to the event rule.public Rule onStateChange(java.lang.String id)
onStateChange
in interface IPipeline
id
- Identifier for this event handler. This parameter is required.public IStage stage(java.lang.String stageName)
stageName
- This parameter is required.protected java.util.List<java.lang.String> validate()
Validation happens according to the rules documented at
https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#pipeline-requirements
public IBucket getArtifactBucket()
public java.util.Map<java.lang.String,CrossRegionSupport> getCrossRegionSupport()
CrossRegionSupportStack
s that were generated automatically when dealing with Actions that reside in a different region than the Pipeline itself.public java.lang.String getPipelineArn()
getPipelineArn
in interface IPipeline
public java.lang.String getPipelineName()
getPipelineName
in interface IPipeline
public java.lang.String getPipelineVersion()
public IRole getRole()
public java.lang.Number getStageCount()
public java.util.List<IStage> getStages()
Note: the returned array is a defensive copy, so adding elements to it has no effect. Instead, use the {@link addStage} method if you want to add more stages to the pipeline.