AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::CodePipeline::Pipeline

The AWS::CodePipeline::Pipeline resource creates an AWS CodePipeline pipeline that describes how software changes go through a release process. For more information, see What Is AWS 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, "DisableInboundStageTransitions" : [ DisableInboundStageTransitions, ... ], "Name" : String, "RestartExecutionOnUpdate" : Boolean, "RoleArn" : String, "Stages" : [ Stages, ... ] } }

YAML

Type: AWS::CodePipeline::Pipeline Properties: ArtifactStore: ArtifactStore DisableInboundStageTransitions: - DisableInboundStageTransitions Name: String RestartExecutionOnUpdate: Boolean RoleArn: String Stages: - Stages

Properties

ArtifactStore

The Amazon Simple Storage Service (Amazon S3) location where AWS CodePipeline stores pipeline artifacts. For more information, see Create an Amazon S3 Bucket for Your Application in the AWS CodePipeline User Guide.

Required: Yes

Type: AWS CodePipeline Pipeline ArtifactStore

Update requires: No interruption

DisableInboundStageTransitions

Prevents artifacts in a pipeline from transitioning to the stage that you specified. This enables you to manually control transitions.

Required: No

Type: List of AWS CodePipeline Pipeline DisableInboundStageTransitions

Update requires: No interruption

Name

The name of your AWS CodePipeline pipeline.

Required: No

Type: String

Update requires: Replacement

RestartExecutionOnUpdate

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

Required: No

Type: Boolean

Update requires: No interruption

RoleArn

A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf. For more information, see AWS CodePipeline Access Permissions Reference in the AWS CodePipeline User Guide.

Required: Yes

Type: String

Update requires: No interruption

Stages

Defines the AWS CodePipeline pipeline stages.

Required: Yes

Type: AWS CodePipeline Pipeline Stages

Update requires: No interruption

Return Value

Ref

When you pass the logical ID of an AWS::CodePipeline::Pipeline resource to the intrinsic Ref function, the function returns the pipeline name, such as mysta-MyPipeline-A1BCDEFGHIJ2.

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

Fn::GetAtt

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

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.

For more information about using Fn::GetAtt, see Fn::GetAtt.

Example

The following example creates a pipeline with a source, beta, and release stage. For the source stage, AWS 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 AWS 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"