pipelines
Creates, updates, deletes, gets or lists a pipelines resource.
Overview
| Name | pipelines |
| Type | Resource |
| Id | aws.codepipeline.pipelines |
Fields
The following fields are returned by SELECT queries:
- get_pipeline
- list_pipelines
| Name | Datatype | Description |
|---|---|---|
metadata | object | Represents the pipeline metadata information returned as part of the output of a GetPipeline action. |
pipeline | object | Represents the structure of actions and stages to be performed in the pipeline. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the pipeline. (pattern: <code>[A-Za-z0-9.@-_]+</code>) |
created | string (date-time) | The date and time the pipeline was created, in timestamp format. |
execution_mode | string | The method that the pipeline will use to handle multiple executions. The default mode is SUPERSEDED. (QUEUED, SUPERSEDED, PARALLEL) |
pipeline_type | string | CodePipeline provides the following pipeline types, which differ in characteristics and price, so that you can tailor your pipeline features and cost to the needs of your applications. V1 type pipelines have a JSON structure that contains standard pipeline, stage, and action-level parameters. V2 type pipelines have the same structure as a V1 type, along with additional parameters for release safety and trigger configuration. Including V2 parameters, such as triggers on Git tags, in the pipeline JSON when creating or updating a pipeline will result in the pipeline having the V2 type of pipeline and the associated costs. For information about pricing for CodePipeline, see Pricing. For information about which type of pipeline to choose, see What type of pipeline is right for me?. (V1, V2) |
updated | string (date-time) | The date and time of the last update to the pipeline, in timestamp format. |
version | integer | The version number of the pipeline. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_pipeline | select | region | Returns the metadata, structure, stages, and actions of a pipeline. Can be used to return the entire structure of a pipeline in JSON format, which can then be modified and used to update the pipeline structure with UpdatePipeline. | |
list_pipelines | select | region | Gets a summary of all of the pipelines associated with your account. | |
create_pipeline | insert | region, pipeline | Creates a pipeline. 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. | |
update_pipeline | update | region, pipeline | Updates a specified pipeline with edits or changes to its structure. Use a JSON file with the pipeline structure and UpdatePipeline to provide the full structure of the pipeline. Updating the pipeline increases the version number of the pipeline by 1. | |
put_approval_result | replace | region, pipelineName, stageName, actionName, result, token | Provides the response to a manual approval request to CodePipeline. Valid responses include Approved and Rejected. | |
put_action_revision | replace | region, pipelineName, stageName, actionName, actionRevision | Provides information to CodePipeline about new revisions to a source. | |
delete_pipeline | delete | region | Deletes the specified pipeline. | |
disable_stage_transition | exec | region, pipelineName, stageName, transitionType, reason | Prevents artifacts in a pipeline from transitioning to the next stage in the pipeline. | |
enable_stage_transition | exec | region, pipelineName, stageName, transitionType | Enables artifacts in a pipeline to transition to a stage in a pipeline. | |
rollback_stage | exec | region, pipelineName, stageName, targetPipelineExecutionId | Rolls back a stage execution. | |
start_pipeline_execution | exec | region, name | Starts the specified pipeline. Specifically, it begins processing the latest commit to the source location specified as part of the pipeline. | |
stop_pipeline_execution | exec | region, pipelineName, pipelineExecutionId | Stops the specified pipeline execution. You choose to either stop the pipeline execution by completing in-progress actions without starting subsequent actions, or by abandoning in-progress actions. While completing or abandoning in-progress actions, the pipeline execution is in a Stopping state. After all in-progress actions are completed or abandoned, the pipeline execution is in a Stopped state. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_pipeline
- list_pipelines
Returns the metadata, structure, stages, and actions of a pipeline. Can be used to return the entire structure of a pipeline in JSON format, which can then be modified and used to update the pipeline structure with UpdatePipeline.
SELECT
metadata,
pipeline
FROM aws.codepipeline.pipelines
WHERE region = '{{ region }}' -- required
;
Gets a summary of all of the pipelines associated with your account.
SELECT
name,
created,
execution_mode,
pipeline_type,
updated,
version
FROM aws.codepipeline.pipelines
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_pipeline
- Manifest
Creates a pipeline. 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.
INSERT INTO aws.codepipeline.pipelines (
pipeline,
tags,
region
)
SELECT
'{{ pipeline }}' /* required */,
'{{ tags }}',
'{{ region }}'
RETURNING
pipeline,
tags
;
# Description fields are for documentation purposes
- name: pipelines
props:
- name: region
value: "{{ region }}"
description: Required parameter for the pipelines resource.
- name: pipeline
description: |
Represents the structure of actions and stages to be performed in the pipeline.
value:
name: "{{ name }}"
roleArn: "{{ roleArn }}"
artifactStore:
type_: "{{ type_ }}"
location: "{{ location }}"
encryptionKey:
id: "{{ id }}"
type_: "{{ type_ }}"
artifactStores: "{{ artifactStores }}"
stages:
- name: "{{ name }}"
blockers: "{{ blockers }}"
actions: "{{ actions }}"
onFailure:
result: "{{ result }}"
retryConfiguration:
retryMode: "{{ retryMode }}"
conditions:
- result: "{{ result }}"
rules: "{{ rules }}"
onSuccess:
conditions:
- result: "{{ result }}"
rules: "{{ rules }}"
beforeEntry:
conditions:
- result: "{{ result }}"
rules: "{{ rules }}"
version: {{ version }}
executionMode: "{{ executionMode }}"
pipelineType: "{{ pipelineType }}"
variables:
- name: "{{ name }}"
defaultValue: "{{ defaultValue }}"
description: "{{ description }}"
triggers:
- providerType: "{{ providerType }}"
gitConfiguration:
sourceActionName: "{{ sourceActionName }}"
push:
- tags:
includes: "{{ includes }}"
excludes: "{{ excludes }}"
branches:
includes: "{{ includes }}"
excludes: "{{ excludes }}"
filePaths:
includes: "{{ includes }}"
excludes: "{{ excludes }}"
pullRequest:
- events: "{{ events }}"
branches:
includes: "{{ includes }}"
excludes: "{{ excludes }}"
filePaths:
includes: "{{ includes }}"
excludes: "{{ excludes }}"
- name: tags
description: |
The tags for the pipeline.
value:
- key: "{{ key }}"
value: "{{ value }}"
UPDATE examples
- update_pipeline
Updates a specified pipeline with edits or changes to its structure. Use a JSON file with the pipeline structure and UpdatePipeline to provide the full structure of the pipeline. Updating the pipeline increases the version number of the pipeline by 1.
UPDATE aws.codepipeline.pipelines
SET
pipeline = '{{ pipeline }}'
WHERE
region = '{{ region }}' --required
AND pipeline = '{{ pipeline }}' --required
RETURNING
pipeline;
REPLACE examples
- put_approval_result
- put_action_revision
Provides the response to a manual approval request to CodePipeline. Valid responses include Approved and Rejected.
REPLACE aws.codepipeline.pipelines
SET
pipelineName = '{{ pipelineName }}',
stageName = '{{ stageName }}',
actionName = '{{ actionName }}',
result = '{{ result }}',
token = '{{ token }}'
WHERE
region = '{{ region }}' --required
AND pipelineName = '{{ pipelineName }}' --required
AND stageName = '{{ stageName }}' --required
AND actionName = '{{ actionName }}' --required
AND result = '{{ result }}' --required
AND token = '{{ token }}' --required
RETURNING
approved_at;
Provides information to CodePipeline about new revisions to a source.
REPLACE aws.codepipeline.pipelines
SET
pipelineName = '{{ pipelineName }}',
stageName = '{{ stageName }}',
actionName = '{{ actionName }}',
actionRevision = '{{ actionRevision }}'
WHERE
region = '{{ region }}' --required
AND pipelineName = '{{ pipelineName }}' --required
AND stageName = '{{ stageName }}' --required
AND actionName = '{{ actionName }}' --required
AND actionRevision = '{{ actionRevision }}' --required
RETURNING
new_revision,
pipeline_execution_id;
DELETE examples
- delete_pipeline
Deletes the specified pipeline.
DELETE FROM aws.codepipeline.pipelines
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- disable_stage_transition
- enable_stage_transition
- rollback_stage
- start_pipeline_execution
- stop_pipeline_execution
Prevents artifacts in a pipeline from transitioning to the next stage in the pipeline.
EXEC aws.codepipeline.pipelines.disable_stage_transition
@region='{{ region }}' --required
@@json=
'{
"pipelineName": "{{ pipelineName }}",
"stageName": "{{ stageName }}",
"transitionType": "{{ transitionType }}",
"reason": "{{ reason }}"
}'
;
Enables artifacts in a pipeline to transition to a stage in a pipeline.
EXEC aws.codepipeline.pipelines.enable_stage_transition
@region='{{ region }}' --required
@@json=
'{
"pipelineName": "{{ pipelineName }}",
"stageName": "{{ stageName }}",
"transitionType": "{{ transitionType }}"
}'
;
Rolls back a stage execution.
EXEC aws.codepipeline.pipelines.rollback_stage
@region='{{ region }}' --required
@@json=
'{
"pipelineName": "{{ pipelineName }}",
"stageName": "{{ stageName }}",
"targetPipelineExecutionId": "{{ targetPipelineExecutionId }}"
}'
;
Starts the specified pipeline. Specifically, it begins processing the latest commit to the source location specified as part of the pipeline.
EXEC aws.codepipeline.pipelines.start_pipeline_execution
@region='{{ region }}' --required
@@json=
'{
"name": "{{ name }}",
"variables": "{{ variables }}",
"clientRequestToken": "{{ clientRequestToken }}",
"sourceRevisions": "{{ sourceRevisions }}"
}'
;
Stops the specified pipeline execution. You choose to either stop the pipeline execution by completing in-progress actions without starting subsequent actions, or by abandoning in-progress actions. While completing or abandoning in-progress actions, the pipeline execution is in a Stopping state. After all in-progress actions are completed or abandoned, the pipeline execution is in a Stopped state.
EXEC aws.codepipeline.pipelines.stop_pipeline_execution
@region='{{ region }}' --required
@@json=
'{
"pipelineName": "{{ pipelineName }}",
"pipelineExecutionId": "{{ pipelineExecutionId }}",
"abandon": {{ abandon }},
"reason": "{{ reason }}"
}'
;