pipelines
Creates, updates, deletes or gets a pipeline resource or lists pipelines in a region
Overview
| Name | pipelines |
| Type | Resource |
| Description | The AWS::CodePipeline::Pipeline resource creates a CodePipeline pipeline that describes how software changes go through a release process. |
| Id | awscc.codepipeline.pipelines |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
artifact_stores | array | A mapping of artifactStore objects and their corresponding AWS Regions. There must be an artifact store for the pipeline Region and for each cross-region action in the pipeline. |
disable_inbound_stage_transitions | array | Represents the input of a DisableStageTransition action. |
stages | array | Represents information about a stage and its definition. |
execution_mode | string | The method that the pipeline will use to handle multiple executions. The default mode is SUPERSEDED. |
restart_execution_on_update | boolean | Indicates whether to rerun the CodePipeline pipeline after you update it. |
triggers | array | The trigger configuration specifying a type of event, such as Git tags, that starts the pipeline. |
role_arn | string | 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 an actionRoleArn |
name | string | The name of the pipeline. |
variables | array | A list that defines the pipeline variables for a pipeline resource. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9@\-_]+. |
version | string | The version of the pipeline. |
artifact_store | object | The S3 bucket where artifacts for the pipeline are stored. |
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. |
tags | array | Specifies the tags applied to the pipeline. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the pipeline. |
region | string | AWS region. |
For more information, see AWS::CodePipeline::Pipeline.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | pipelines | INSERT | Stages, RoleArn, region |
delete_resource | pipelines | DELETE | Identifier, region |
update_resource | pipelines | UPDATE | Identifier, PatchDocument, region |
list_resources | pipelines_list_only | SELECT | region |
get_resource | pipelines | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual pipeline.
SELECT
region,
artifact_stores,
disable_inbound_stage_transitions,
stages,
execution_mode,
restart_execution_on_update,
triggers,
role_arn,
name,
variables,
version,
artifact_store,
pipeline_type,
tags
FROM awscc.codepipeline.pipelines
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}';
Lists all pipelines in a region.
SELECT
region,
name
FROM awscc.codepipeline.pipelines_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new pipeline resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.codepipeline.pipelines (
Stages,
RoleArn,
region
)
SELECT
'{{ stages }}',
'{{ role_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.codepipeline.pipelines (
ArtifactStores,
DisableInboundStageTransitions,
Stages,
ExecutionMode,
RestartExecutionOnUpdate,
Triggers,
RoleArn,
Name,
Variables,
ArtifactStore,
PipelineType,
Tags,
region
)
SELECT
'{{ artifact_stores }}',
'{{ disable_inbound_stage_transitions }}',
'{{ stages }}',
'{{ execution_mode }}',
'{{ restart_execution_on_update }}',
'{{ triggers }}',
'{{ role_arn }}',
'{{ name }}',
'{{ variables }}',
'{{ artifact_store }}',
'{{ pipeline_type }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: pipeline
props:
- name: artifact_stores
value:
- artifact_store:
type: '{{ type }}'
encryption_key:
type: '{{ type }}'
id: '{{ id }}'
location: '{{ location }}'
region: '{{ region }}'
- name: disable_inbound_stage_transitions
value:
- stage_name: '{{ stage_name }}'
reason: '{{ reason }}'
- name: stages
value:
- blockers:
- name: '{{ name }}'
type: '{{ type }}'
actions:
- action_type_id:
owner: '{{ owner }}'
category: '{{ category }}'
version: '{{ version }}'
provider: '{{ provider }}'
configuration: {}
input_artifacts:
- name: '{{ name }}'
output_artifacts:
- name: '{{ name }}'
files:
- '{{ files[0] }}'
commands:
- '{{ commands[0] }}'
output_variables:
- '{{ output_variables[0] }}'
environment_variables:
- name: '{{ name }}'
value: '{{ value }}'
type: '{{ type }}'
region: '{{ region }}'
namespace: '{{ namespace }}'
role_arn: '{{ role_arn }}'
run_order: '{{ run_order }}'
name: '{{ name }}'
timeout_in_minutes: '{{ timeout_in_minutes }}'
name: '{{ name }}'
on_failure:
result: '{{ result }}'
retry_configuration:
retry_mode: '{{ retry_mode }}'
conditions:
- result: '{{ result }}'
rules:
- rule_type_id:
owner: '{{ owner }}'
category: '{{ category }}'
version: '{{ version }}'
provider: '{{ provider }}'
configuration: {}
commands:
- '{{ commands[0] }}'
input_artifacts:
- null
region: '{{ region }}'
role_arn: '{{ role_arn }}'
name: '{{ name }}'
on_success:
conditions:
- null
before_entry:
conditions:
- null
- name: execution_mode
value: '{{ execution_mode }}'
- name: restart_execution_on_update
value: '{{ restart_execution_on_update }}'
- name: triggers
value:
- git_configuration:
push:
- file_paths:
includes:
- '{{ includes[0] }}'
excludes:
- '{{ excludes[0] }}'
branches:
includes:
- '{{ includes[0] }}'
excludes:
- '{{ excludes[0] }}'
tags:
includes:
- '{{ includes[0] }}'
excludes:
- '{{ excludes[0] }}'
source_action_name: '{{ source_action_name }}'
pull_request:
- file_paths: null
events:
- '{{ events[0] }}'
branches: null
provider_type: '{{ provider_type }}'
- name: role_arn
value: '{{ role_arn }}'
- name: name
value: '{{ name }}'
- name: variables
value:
- default_value: '{{ default_value }}'
description: '{{ description }}'
name: '{{ name }}'
- name: artifact_store
value: null
- name: pipeline_type
value: '{{ pipeline_type }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
UPDATE example
Use the following StackQL query and manifest file to update a pipeline resource, using stack-deploy.
/*+ update */
UPDATE awscc.codepipeline.pipelines
SET PatchDocument = string('{{ {
"ArtifactStores": artifact_stores,
"DisableInboundStageTransitions": disable_inbound_stage_transitions,
"Stages": stages,
"ExecutionMode": execution_mode,
"RestartExecutionOnUpdate": restart_execution_on_update,
"Triggers": triggers,
"RoleArn": role_arn,
"Variables": variables,
"ArtifactStore": artifact_store,
"PipelineType": pipeline_type,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.codepipeline.pipelines
WHERE
Identifier = '{{ name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the pipelines resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iam:GetRole,
iam:PassRole,
codepipeline:GetPipeline,
codepipeline:CreatePipeline,
codepipeline:DisableStageTransition,
codepipeline:GetPipelineState,
codepipeline:TagResource,
codestar-connections:PassConnection
codepipeline:GetPipeline,
codepipeline:ListTagsForResource,
codepipeline:GetPipelineState
iam:GetRole,
iam:PassRole,
codepipeline:EnableStageTransition,
codepipeline:StartPipelineExecution,
codepipeline:GetPipeline,
codepipeline:UpdatePipeline,
codepipeline:GetPipelineState,
codepipeline:DisableStageTransition,
codepipeline:TagResource,
codepipeline:UntagResource,
codestar-connections:PassConnection
codepipeline:GetPipeline,
codepipeline:DeletePipeline
codepipeline:ListPipelines