AWS CloudFormation
User Guide (Version )

AWS::CodePipeline::Pipeline

The AWS::CodePipeline::Pipeline resource creates a CodePipeline pipeline that describes how software changes go through a release process. For more information, see What Is CodePipeline? in the AWS CodePipeline User Guide.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::CodePipeline::Pipeline", "Properties" : { "ArtifactStore" : ArtifactStore, "ArtifactStores" : [ ArtifactStoreMap, ... ], "DisableInboundStageTransitions" : [ StageTransition, ... ], "Name" : String, "RestartExecutionOnUpdate" : Boolean, "RoleArn" : String, "Stages" : [ StageDeclaration, ... ] } }

Properties

ArtifactStore

The Amazon S3 bucket where artifacts are stored for the pipeline.

Required: No

Type: ArtifactStore

Update requires: No interruption

ArtifactStores

A mapping of artifactStore objects and their corresponding regions. There must be an artifact store for the pipeline region and for each cross-region action within the pipeline. You can only use either artifactStore or artifactStores, not both.

If you create a cross-region action in your pipeline, you must use artifactStores.

Required: No

Type: List of ArtifactStoreMap

Update requires: No interruption

DisableInboundStageTransitions

Represents the input of a DisableStageTransition action.

Required: No

Type: List of StageTransition

Update requires: No interruption

Name

The name of the pipeline.

Required: No

Type: String

Minimum: 1

Maximum: 100

Pattern: [A-Za-z0-9.@\-_]+

Update requires: Replacement

RestartExecutionOnUpdate

Indicates whether to rerun the CodePipeline pipeline after you update it.

Required: No

Type: Boolean

Update requires: No interruption

RoleArn

The Amazon Resource Name (ARN) for AWS CodePipeline to use to either perform actions with no actionRoleArn, or to use to assume roles for actions with an actionRoleArn.

Required: Yes

Type: String

Maximum: 1024

Pattern: arn:aws(-[\w]+)*:iam::[0-9]{12}:role/.*

Update requires: No interruption

Stages

Represents information about a stage and its definition.

Required: Yes

Type: List of StageDeclaration

Update requires: No interruption

Return Values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the pipeline name, such as mysta-MyPipeline-A1BCDEFGHIJ2.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Version

The version of the pipeline.

Note

A new pipeline is always assigned a version number of 1. This number increments when a pipeline is updated.

Examples

Pipeline Resource Configuration

The following example creates a pipeline with a source, beta, and release stage. For the source stage, CodePipeline detects changes to the application that is stored in the S3 bucket and pulls them into the pipeline. The beta stage deploys those changes to EC2 instances by using CodeDeploy. For the release stage, inbound transitions are disabled, which enables you to control when the changes are ready to be deployed to release.

JSON

"AppPipeline": { "Type": "AWS::CodePipeline::Pipeline", "Properties": { "RoleArn": { "Ref" : "CodePipelineServiceRole" }, "Stages": [ { "Name": "Source", "Actions": [ { "Name": "SourceAction", "ActionTypeId": { "Category": "Source", "Owner": "AWS", "Version": "1", "Provider": "S3" }, "OutputArtifacts": [ { "Name": "SourceOutput" } ], "Configuration": { "S3Bucket": { "Ref" : "SourceS3Bucket" }, "S3ObjectKey": { "Ref" : "SourceS3ObjectKey" } }, "RunOrder": 1 } ] }, { "Name": "Beta", "Actions": [ { "Name": "BetaAction", "InputArtifacts": [ { "Name": "SourceOutput" } ], "ActionTypeId": { "Category": "Deploy", "Owner": "AWS", "Version": "1", "Provider": "CodeDeploy" }, "Configuration": { "ApplicationName": {"Ref" : "ApplicationName"}, "DeploymentGroupName": {"Ref" : "DeploymentGroupName"} }, "RunOrder": 1 } ] }, { "Name": "Release", "Actions": [ { "Name": "ReleaseAction", "InputArtifacts": [ { "Name": "SourceOutput" } ], "ActionTypeId": { "Category": "Deploy", "Owner": "AWS", "Version": "1", "Provider": "CodeDeploy" }, "Configuration": { "ApplicationName": {"Ref" : "ApplicationName"}, "DeploymentGroupName": {"Ref" : "DeploymentGroupName"} }, "RunOrder": 1 } ] } ], "ArtifactStore": { "Type": "S3", "Location": { "Ref" : "ArtifactStoreS3Location" } }, "DisableInboundStageTransitions": [ { "StageName": "Release", "Reason": "Disabling the transition until integration tests are completed" } ] } }

YAML

AppPipeline: Type: AWS::CodePipeline::Pipeline Properties: RoleArn: Ref: CodePipelineServiceRole Stages: - Name: Source Actions: - Name: SourceAction ActionTypeId: Category: Source Owner: AWS Version: 1 Provider: S3 OutputArtifacts: - Name: SourceOutput Configuration: S3Bucket: Ref: SourceS3Bucket S3ObjectKey: Ref: SourceS3ObjectKey RunOrder: 1 - Name: Beta Actions: - Name: BetaAction InputArtifacts: - Name: SourceOutput ActionTypeId: Category: Deploy Owner: AWS Version: 1 Provider: CodeDeploy Configuration: ApplicationName: Ref: ApplicationName DeploymentGroupName: Ref: DeploymentGroupName RunOrder: 1 - Name: Release Actions: - Name: ReleaseAction InputArtifacts: - Name: SourceOutput ActionTypeId: Category: Deploy Owner: AWS Version: 1 Provider: CodeDeploy Configuration: ApplicationName: Ref: ApplicationName DeploymentGroupName: Ref: DeploymentGroupName RunOrder: 1 ArtifactStore: Type: S3 Location: Ref: ArtifactStoreS3Location DisableInboundStageTransitions: - StageName: Release Reason: "Disabling the transition until integration tests are completed"