Skip to content

CodePipeline

CloudMock emulates AWS CodePipeline, supporting pipeline CRUD, execution management, approval actions, stage retries, and tagging.

OperationStatusNotes
CreatePipelineSupportedCreates a pipeline
GetPipelineSupportedReturns pipeline definition
ListPipelinesSupportedLists all pipelines
UpdatePipelineSupportedUpdates pipeline definition
DeletePipelineSupportedDeletes a pipeline
GetPipelineStateSupportedReturns current pipeline state
GetPipelineExecutionSupportedReturns execution details
ListPipelineExecutionsSupportedLists pipeline executions
StartPipelineExecutionSupportedStarts a pipeline execution
StopPipelineExecutionSupportedStops a pipeline execution
PutApprovalResultSupportedApproves or rejects a manual approval
RetryStageExecutionSupportedRetries a failed stage
TagResourceSupportedAdds tags to a pipeline
UntagResourceSupportedRemoves tags from a pipeline
ListTagsForResourceSupportedLists tags for a pipeline
import { CodePipelineClient, CreatePipelineCommand } from '@aws-sdk/client-codepipeline';
const client = new CodePipelineClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
await client.send(new CreatePipelineCommand({
pipeline: {
name: 'my-pipeline',
roleArn: 'arn:aws:iam::000000000000:role/pipeline-role',
stages: [
{ name: 'Source', actions: [{ name: 'Source', actionTypeId: { category: 'Source', owner: 'AWS', provider: 'S3', version: '1' }, configuration: { S3Bucket: 'my-bucket', S3ObjectKey: 'source.zip' }, outputArtifacts: [{ name: 'SourceOutput' }] }] },
{ name: 'Deploy', actions: [{ name: 'Deploy', actionTypeId: { category: 'Deploy', owner: 'AWS', provider: 'S3', version: '1' }, inputArtifacts: [{ name: 'SourceOutput' }], configuration: { BucketName: 'deploy-bucket', Extract: 'true' } }] },
],
artifactStore: { type: 'S3', location: 'artifact-bucket' },
},
}));
import boto3
client = boto3.client('codepipeline',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
client.create_pipeline(pipeline={
'name': 'my-pipeline',
'roleArn': 'arn:aws:iam::000000000000:role/pipeline-role',
'stages': [
{'name': 'Source', 'actions': [{'name': 'Source', 'actionTypeId': {'category': 'Source', 'owner': 'AWS', 'provider': 'S3', 'version': '1'}, 'configuration': {'S3Bucket': 'my-bucket', 'S3ObjectKey': 'source.zip'}, 'outputArtifacts': [{'name': 'SourceOutput'}]}]},
{'name': 'Deploy', 'actions': [{'name': 'Deploy', 'actionTypeId': {'category': 'Deploy', 'owner': 'AWS', 'provider': 'S3', 'version': '1'}, 'inputArtifacts': [{'name': 'SourceOutput'}], 'configuration': {'BucketName': 'deploy-bucket', 'Extract': 'true'}}]},
],
'artifactStore': {'type': 'S3', 'location': 'artifact-bucket'},
})
cloudmock.yml
services:
codepipeline:
enabled: true
  • Pipeline executions do not actually run actions against real services
  • Stage transitions are simulated
  • Artifact stores are referenced but artifacts are not transferred