Class Pipeline
An AWS CodePipeline pipeline with its associated IAM role and S3 bucket.
Inherited Members
Namespace: Amazon.CDK.AWS.CodePipeline
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Pipeline : Resource, IPipeline, IResource, INotificationRuleSource
Syntax (vb)
Public Class Pipeline
Inherits Resource
Implements IPipeline, IResource, INotificationRuleSource
Examples
// create a pipeline
using Amazon.CDK.AWS.CodeCommit;
// add a source action to the stage
Repository repo;
Artifact sourceArtifact;
var pipeline = new Pipeline(this, "Pipeline");
// add a stage
var sourceStage = pipeline.AddStage(new StageOptions { StageName = "Source" });
sourceStage.AddAction(new CodeCommitSourceAction(new CodeCommitSourceActionProps {
ActionName = "Source",
Output = sourceArtifact,
Repository = repo
}));
Synopsis
Constructors
Pipeline(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Pipeline(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Pipeline(Construct, String, IPipelineProps) |
Properties
ArtifactBucket | Bucket used to store output artifacts. |
CrossRegionSupport | Returns all of the |
PipelineArn | ARN of this pipeline. |
PipelineName | The name of the pipeline. |
PipelineVersion | The version of the pipeline. |
Role | The IAM role AWS CodePipeline will use to perform actions or assume roles for actions with a more specific IAM role. |
StageCount | Get the number of Stages in this Pipeline. |
Stages | Returns the stages that comprise the pipeline. |
Methods
AddStage(IStageOptions) | Creates a new Stage, and adds it to this Pipeline. |
AddToRolePolicy(PolicyStatement) | Adds a statement to the pipeline role. |
AddTrigger(ITriggerProps) | Adds a new Trigger to this Pipeline. |
AddVariable(Variable) | Adds a new Variable to this Pipeline. |
BindAsNotificationRuleSource(Construct) | Returns a source configuration for notification rule. |
FromPipelineArn(Construct, String, String) | Import a pipeline into this app. |
NotifyOn(String, INotificationRuleTarget, IPipelineNotifyOnOptions) | Defines a CodeStar notification rule triggered when the pipeline events emitted by you specified, it very similar to |
NotifyOnAnyActionStateChange(String, INotificationRuleTarget, INotificationRuleOptions) | Define an notification rule triggered by the set of the "Action execution" events emitted from this pipeline. |
NotifyOnAnyManualApprovalStateChange(String, INotificationRuleTarget, INotificationRuleOptions) | Define an notification rule triggered by the set of the "Manual approval" events emitted from this pipeline. |
NotifyOnAnyStageStateChange(String, INotificationRuleTarget, INotificationRuleOptions) | Define an notification rule triggered by the set of the "Stage execution" events emitted from this pipeline. |
NotifyOnExecutionStateChange(String, INotificationRuleTarget, INotificationRuleOptions) | Define an notification rule triggered by the set of the "Pipeline execution" events emitted from this pipeline. |
OnEvent(String, IOnEventOptions) | Defines an event rule triggered by this CodePipeline. |
OnStateChange(String, IOnEventOptions) | Defines an event rule triggered by the "CodePipeline Pipeline Execution State Change" event emitted from this pipeline. |
Stage(String) | Access one of the pipeline's stages by stage name. |
Constructors
Pipeline(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Pipeline(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Pipeline(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Pipeline(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Pipeline(Construct, String, IPipelineProps)
public Pipeline(Construct scope, string id, IPipelineProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IPipelineProps
Properties
ArtifactBucket
Bucket used to store output artifacts.
public virtual IBucket ArtifactBucket { get; }
Property Value
CrossRegionSupport
Returns all of the CrossRegionSupportStack
s that were generated automatically when dealing with Actions that reside in a different region than the Pipeline itself.
public virtual IDictionary<string, ICrossRegionSupport> CrossRegionSupport { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, ICrossRegionSupport>
PipelineArn
ARN of this pipeline.
public virtual string PipelineArn { get; }
Property Value
System.String
PipelineName
The name of the pipeline.
public virtual string PipelineName { get; }
Property Value
System.String
PipelineVersion
The version of the pipeline.
public virtual string PipelineVersion { get; }
Property Value
System.String
Remarks
Attribute: true
Role
The IAM role AWS CodePipeline will use to perform actions or assume roles for actions with a more specific IAM role.
public virtual IRole Role { get; }
Property Value
StageCount
Get the number of Stages in this Pipeline.
public virtual double StageCount { get; }
Property Value
System.Double
Stages
Returns the stages that comprise the pipeline.
public virtual IStage[] Stages { get; }
Property Value
IStage[]
Remarks
Note: the returned array is a defensive copy,
so adding elements to it has no effect.
Instead, use the addStage
method if you want to add more stages
to the pipeline.
Methods
AddStage(IStageOptions)
Creates a new Stage, and adds it to this Pipeline.
public virtual IStage AddStage(IStageOptions props)
Parameters
- props IStageOptions
the creation properties of the new Stage.
Returns
the newly created Stage
AddToRolePolicy(PolicyStatement)
Adds a statement to the pipeline role.
public virtual void AddToRolePolicy(PolicyStatement statement)
Parameters
- statement PolicyStatement
AddTrigger(ITriggerProps)
Adds a new Trigger to this Pipeline.
public virtual Trigger AddTrigger(ITriggerProps props)
Parameters
- props ITriggerProps
Trigger property to add to this Pipeline.
Returns
the newly created trigger
AddVariable(Variable)
Adds a new Variable to this Pipeline.
public virtual Variable AddVariable(Variable variable)
Parameters
- variable Variable
Variable instance to add to this Pipeline.
Returns
the newly created variable
BindAsNotificationRuleSource(Construct)
Returns a source configuration for notification rule.
public virtual INotificationRuleSourceConfig BindAsNotificationRuleSource(Construct scope)
Parameters
- scope Constructs.Construct
Returns
FromPipelineArn(Construct, String, String)
Import a pipeline into this app.
public static IPipeline FromPipelineArn(Construct scope, string id, string pipelineArn)
Parameters
- scope Constructs.Construct
the scope into which to import this pipeline.
- id System.String
the logical ID of the returned pipeline construct.
- pipelineArn System.String
The ARN of the pipeline (e.g.
arn:aws:codepipeline:us-east-1:123456789012:MyDemoPipeline
).
Returns
NotifyOn(String, INotificationRuleTarget, IPipelineNotifyOnOptions)
Defines a CodeStar notification rule triggered when the pipeline events emitted by you specified, it very similar to onEvent
API.
public virtual INotificationRule NotifyOn(string id, INotificationRuleTarget target, IPipelineNotifyOnOptions options)
Parameters
- id System.String
- target INotificationRuleTarget
- options IPipelineNotifyOnOptions
Returns
Remarks
You can also use the methods notifyOnExecutionStateChange
, notifyOnAnyStageStateChange
,
notifyOnAnyActionStateChange
and notifyOnAnyManualApprovalStateChange
to define rules for these specific event emitted.
NotifyOnAnyActionStateChange(String, INotificationRuleTarget, INotificationRuleOptions)
Define an notification rule triggered by the set of the "Action execution" events emitted from this pipeline.
public virtual INotificationRule NotifyOnAnyActionStateChange(string id, INotificationRuleTarget target, INotificationRuleOptions options = null)
Parameters
- id System.String
- target INotificationRuleTarget
- options INotificationRuleOptions
Returns
NotifyOnAnyManualApprovalStateChange(String, INotificationRuleTarget, INotificationRuleOptions)
Define an notification rule triggered by the set of the "Manual approval" events emitted from this pipeline.
public virtual INotificationRule NotifyOnAnyManualApprovalStateChange(string id, INotificationRuleTarget target, INotificationRuleOptions options = null)
Parameters
- id System.String
- target INotificationRuleTarget
- options INotificationRuleOptions
Returns
NotifyOnAnyStageStateChange(String, INotificationRuleTarget, INotificationRuleOptions)
Define an notification rule triggered by the set of the "Stage execution" events emitted from this pipeline.
public virtual INotificationRule NotifyOnAnyStageStateChange(string id, INotificationRuleTarget target, INotificationRuleOptions options = null)
Parameters
- id System.String
- target INotificationRuleTarget
- options INotificationRuleOptions
Returns
NotifyOnExecutionStateChange(String, INotificationRuleTarget, INotificationRuleOptions)
Define an notification rule triggered by the set of the "Pipeline execution" events emitted from this pipeline.
public virtual INotificationRule NotifyOnExecutionStateChange(string id, INotificationRuleTarget target, INotificationRuleOptions options = null)
Parameters
- id System.String
- target INotificationRuleTarget
- options INotificationRuleOptions
Returns
OnEvent(String, IOnEventOptions)
Defines an event rule triggered by this CodePipeline.
public virtual Rule OnEvent(string id, IOnEventOptions options = null)
Parameters
- id System.String
Identifier for this event handler.
- options IOnEventOptions
Additional options to pass to the event rule.
Returns
OnStateChange(String, IOnEventOptions)
Defines an event rule triggered by the "CodePipeline Pipeline Execution State Change" event emitted from this pipeline.
public virtual Rule OnStateChange(string id, IOnEventOptions options = null)
Parameters
- id System.String
Identifier for this event handler.
- options IOnEventOptions
Additional options to pass to the event rule.
Returns
Stage(String)
Access one of the pipeline's stages by stage name.
public virtual IStage Stage(string stageName)
Parameters
- stageName System.String
Returns