CreatePipeline - CodePipeline

CreatePipeline

Creates a pipeline.

Note

In the pipeline structure, you must include either artifactStore or artifactStores in your pipeline, but you cannot use both. If you create a cross-region action in your pipeline, you must use artifactStores.

Request Syntax

{ "pipeline": { "artifactStore": { "encryptionKey": { "id": "string", "type": "string" }, "location": "string", "type": "string" }, "artifactStores": { "string" : { "encryptionKey": { "id": "string", "type": "string" }, "location": "string", "type": "string" } }, "executionMode": "string", "name": "string", "pipelineType": "string", "roleArn": "string", "stages": [ { "actions": [ { "actionTypeId": { "category": "string", "owner": "string", "provider": "string", "version": "string" }, "configuration": { "string" : "string" }, "inputArtifacts": [ { "name": "string" } ], "name": "string", "namespace": "string", "outputArtifacts": [ { "name": "string" } ], "region": "string", "roleArn": "string", "runOrder": number, "timeoutInMinutes": number } ], "blockers": [ { "name": "string", "type": "string" } ], "name": "string" } ], "triggers": [ { "gitConfiguration": { "pullRequest": [ { "branches": { "excludes": [ "string" ], "includes": [ "string" ] }, "events": [ "string" ], "filePaths": { "excludes": [ "string" ], "includes": [ "string" ] } } ], "push": [ { "branches": { "excludes": [ "string" ], "includes": [ "string" ] }, "filePaths": { "excludes": [ "string" ], "includes": [ "string" ] }, "tags": { "excludes": [ "string" ], "includes": [ "string" ] } } ], "sourceActionName": "string" }, "providerType": "string" } ], "variables": [ { "defaultValue": "string", "description": "string", "name": "string" } ], "version": number }, "tags": [ { "key": "string", "value": "string" } ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

pipeline

Represents the structure of actions and stages to be performed in the pipeline.

Type: PipelineDeclaration object

Required: Yes

tags

The tags for the pipeline.

Type: Array of Tag objects

Required: No

Response Syntax

{ "pipeline": { "artifactStore": { "encryptionKey": { "id": "string", "type": "string" }, "location": "string", "type": "string" }, "artifactStores": { "string" : { "encryptionKey": { "id": "string", "type": "string" }, "location": "string", "type": "string" } }, "executionMode": "string", "name": "string", "pipelineType": "string", "roleArn": "string", "stages": [ { "actions": [ { "actionTypeId": { "category": "string", "owner": "string", "provider": "string", "version": "string" }, "configuration": { "string" : "string" }, "inputArtifacts": [ { "name": "string" } ], "name": "string", "namespace": "string", "outputArtifacts": [ { "name": "string" } ], "region": "string", "roleArn": "string", "runOrder": number, "timeoutInMinutes": number } ], "blockers": [ { "name": "string", "type": "string" } ], "name": "string" } ], "triggers": [ { "gitConfiguration": { "pullRequest": [ { "branches": { "excludes": [ "string" ], "includes": [ "string" ] }, "events": [ "string" ], "filePaths": { "excludes": [ "string" ], "includes": [ "string" ] } } ], "push": [ { "branches": { "excludes": [ "string" ], "includes": [ "string" ] }, "filePaths": { "excludes": [ "string" ], "includes": [ "string" ] }, "tags": { "excludes": [ "string" ], "includes": [ "string" ] } } ], "sourceActionName": "string" }, "providerType": "string" } ], "variables": [ { "defaultValue": "string", "description": "string", "name": "string" } ], "version": number }, "tags": [ { "key": "string", "value": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

pipeline

Represents the structure of actions and stages to be performed in the pipeline.

Type: PipelineDeclaration object

tags

Specifies the tags applied to the pipeline.

Type: Array of Tag objects

Errors

For information about the errors that are common to all actions, see Common Errors.

ConcurrentModificationException

Unable to modify the tag due to a simultaneous update request.

HTTP Status Code: 400

InvalidActionDeclarationException

The action declaration was specified in an invalid format.

HTTP Status Code: 400

InvalidBlockerDeclarationException

Reserved for future use.

HTTP Status Code: 400

InvalidStageDeclarationException

The stage declaration was specified in an invalid format.

HTTP Status Code: 400

InvalidStructureException

The structure was specified in an invalid format.

HTTP Status Code: 400

InvalidTagsException

The specified resource tags are invalid.

HTTP Status Code: 400

LimitExceededException

The number of pipelines associated with the AWS account has exceeded the limit allowed for the account.

HTTP Status Code: 400

PipelineNameInUseException

The specified pipeline name is already in use.

HTTP Status Code: 400

TooManyTagsException

The tags limit for a resource has been exceeded.

HTTP Status Code: 400

ValidationException

The validation was specified in an invalid format.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of CreatePipeline.

Sample Request

POST / HTTP/1.1 Host: codepipeline.us-east-1.amazonaws.com Accept-Encoding: identity Content-Length: 923 X-Amz-Target: CodePipeline_20150709.CreatePipeline X-Amz-Date: 20160707T175936Z User-Agent: aws-cli/1.7.38 Python/2.7.9 Windows/7 Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20160707/us-east-1/codepipeline/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz-target, Signature=8d9b5998EXAMPLE { "pipeline": { "roleArn": "arn:aws:iam::111111111111:role/AWS-CodePipeline-Service", "stages": [ { "name": "Source", "actions": [ { "inputArtifacts": [], "name": "Source", "actionTypeId": { "category": "Source", "owner": "AWS", "version": "1", "provider": "S3" }, "outputArtifacts": [ { "name": "MyApp" } ], "configuration": { "S3Bucket": "awscodepipeline-demo-bucket", "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip" }, "runOrder": 1 } ] }, { "name": "Staging", "actions": [ { "inputArtifacts": [ { "name": "MyApp" } ], "name": "CodePipelineDemoFleet", "actionTypeId": { "category": "Deploy", "owner": "AWS", "version": "1", "provider": "CodeDeploy" }, "outputArtifacts": [], "configuration": { "ApplicationName": "CodePipelineDemoApplication", "DeploymentGroupName": "CodePipelineDemoFleet" }, "runOrder": 1 } ] } ], "artifactStore": { "type": "S3", "location": "codepipeline-us-east-1-11EXAMPLE11" }, "name": "MySecondPipeline", "version": 1 } }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: 620484b7-88cb-11e5-b497-75c49EXAMPLE Content-Type: application/x-amz-json-1.1 Content-Length: 907 { "pipeline": { "artifactStore": { "location": "codepipeline-us-east-1-11EXAMPLE11", "type": "S3" }, "name": "MySecondPipeline", "roleArn": "arn:aws:iam::111111111111:role/AWS-CodePipeline-Service", "stages": [ { "actions": [ { "actionTypeId": { "__type": "ActionTypeId", "category": "Source", "owner": "AWS", "provider": "S3", "version": "1" }, "configuration": { "S3Bucket": "awscodepipeline-demo-bucket", "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip" }, "inputArtifacts": [], "name": "Source", "outputArtifacts": [ { "name": "MyApp" } ], "runOrder": 1 } ], "name": "Source" }, { "actions": [ { "actionTypeId": { "__type": "ActionTypeId", "category": "Deploy", "owner": "AWS", "provider": "CodeDeploy", "version": "1" }, "configuration": { "ApplicationName": "CodePipelineDemoApplication", "DeploymentGroupName": "CodePipelineDemoFleet" }, "inputArtifacts": [ { "name": "MyApp" } ], "name": "CodePipelineDemoFleet", "outputArtifacts": [], "runOrder": 1 } ], "name": "Staging" } ], "version": 1 } }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: