Show / Hide Table of Contents

Class Pipeline

An AWS CodePipeline pipeline with its associated IAM role and S3 bucket.

Inheritance
System.Object
Construct
Resource
Pipeline
Implements
IPipeline
IResource
IConstruct
Constructs.IConstruct
IDependable
INotificationRuleSource
Inherited Members
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Resource.Stack
Construct.IsConstruct(Object)
Construct.OnPrepare()
Construct.OnSynthesize(ISynthesisSession)
Construct.OnValidate()
Construct.Prepare()
Construct.Synthesize(ISynthesisSession)
Construct.Node
Namespace: Amazon.CDK.AWS.CodePipeline
Assembly: Amazon.CDK.AWS.CodePipeline.dll
Syntax (csharp)
public class Pipeline : Resource, IPipeline, IResource, IConstruct, IConstruct, IDependable, INotificationRuleSource
Syntax (vb)
Public Class Pipeline
    Inherits Resource
    Implements IPipeline, IResource, IConstruct, IConstruct, IDependable, INotificationRuleSource
Examples
// create a pipeline
using Amazon.CDK.AWS.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(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 {@link CrossRegionSupportStack}s that were generated automatically when dealing with Actions that reside in a different region than the Pipeline itself.

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.

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 onEvent API.

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.

Validate()

Validate the pipeline structure.

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

IBucket

CrossRegionSupport

Returns all of the {@link 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

IRole

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 {@link 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

IStage

the newly created Stage

AddToRolePolicy(PolicyStatement)

Adds a statement to the pipeline role.

public virtual void AddToRolePolicy(PolicyStatement statement)
Parameters
statement PolicyStatement

BindAsNotificationRuleSource(Construct)

Returns a source configuration for notification rule.

public virtual INotificationRuleSourceConfig BindAsNotificationRuleSource(Construct scope)
Parameters
scope Constructs.Construct
Returns

INotificationRuleSourceConfig

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

IPipeline

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

INotificationRule

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

INotificationRule

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

INotificationRule

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

INotificationRule

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

INotificationRule

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

Rule

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

Rule

Stage(String)

Access one of the pipeline's stages by stage name.

public virtual IStage Stage(string stageName)
Parameters
stageName System.String
Returns

IStage

Validate()

Validate the pipeline structure.

protected override string[] Validate()
Returns

System.String[]

Overrides
Construct.Validate()
Remarks

Validation happens according to the rules documented at

https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#pipeline-requirements

Override: true

Implements

IPipeline
IResource
IConstruct
Constructs.IConstruct
IDependable
INotificationRuleSource
Back to top Generated by DocFX