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 Amazon CodePipeline User Guide.
Syntax
To declare this entity in your Amazon 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, ... ], "Tags" :[ Tag, ... ]} }
YAML
Type: AWS::CodePipeline::Pipeline Properties: ArtifactStore:ArtifactStoreArtifactStores:- ArtifactStoreMapDisableInboundStageTransitions:- StageTransitionName:StringRestartExecutionOnUpdate:BooleanRoleArn:StringStages:- StageDeclarationTags:- Tag
Properties
ArtifactStore-
The S3 bucket where artifacts for the pipeline are stored.
Note
You must include either
artifactStoreorartifactStoresin your pipeline, but you cannot use both. If you create a cross-region action in your pipeline, you must useartifactStores.Required: Conditional
Type: ArtifactStore
Update requires: No interruption
ArtifactStores-
A mapping of
artifactStoreobjects and their corresponding Amazon Regions. There must be an artifact store for the pipeline Region and for each cross-region action in the pipeline.Note
You must include either
artifactStoreorartifactStoresin your pipeline, but you cannot use both. If you create a cross-region action in your pipeline, you must useartifactStores.Required: Conditional
Type: List of ArtifactStoreMap
Update requires: No interruption
DisableInboundStageTransitions-
Represents the input of a
DisableStageTransitionaction.Required: No
Type: List of StageTransition
Update requires: No interruption
Name-
The name of the pipeline.
Required: No
Type: String
Minimum:
1Maximum:
100Pattern:
[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 CodePipeline to use to either perform actions with no
actionRoleArn, or to use to assume roles for actions with anactionRoleArn.Required: Yes
Type: String
Maximum:
1024Pattern:
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
Tags-
Specifies the tags applied to the pipeline.
Required: No
Type: List of Tag
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Reffunction, Refreturns the pipeline name, such as
mysta-MyPipeline-A1BCDEFGHIJ2.
For more information about using the Reffunction, see Ref.
Fn::GetAtt
The Fn::GetAttintrinsic 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::GetAttintrinsic function, see Fn::GetAtt.
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" }, "EncryptionKey": { "Id": "arn:aws:kms:useast-1:ACCOUNT-ID:key/KEY-ID", "Type": "KMS" }, "DisableInboundStageTransitions": [ { "StageName": "Release", "Reason": "Disabling the transition until integration tests are completed" } ], "Tags": [ { "Key": "Project", "Value": "ProjectA" }, { "Key": "IsContainerBased", "Value": "true" } ] } }
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 EncryptionKey: Id: arn:aws:kms:useast-1:ACCOUNT-ID:key/KEY-ID Type: KMS DisableInboundStageTransitions: - StageName: Release Reason: "Disabling the transition until integration tests are completed" Tags: - Key: Project Value: ProjectA - Key: IsContainerBased Value: 'true'