Saturday, February 4, 2017

Where are my Codepipeline artifacts?

AWS Codepipeline is a CICD service that lets automate running changes through a "pipeline" and performing different actions at different stages. Getting started with it through the GUI was relatively simple, but after a few months of using it I wondered what it was doing behind the scenes.

One question that kept bothering me was, "Where is it storing my artifacts?" Codepipeline can monitor a number of different sources for changes that need to be run through the pipeline such as CodeCommit, Github, and S3, but it isn't obvious how it gets these changes somewhere it can start operating on.

As is often the case with AWS the CLI (or Powershell tools) are the easiest way to dig a little deeper. First, use the command

aws codepipeline list-pipelines

on the CLI to list pipelines or

Get-CPPipelineList

in powershell to list the Pipelines you have in that region. After that you can get more information about the Pipeline with

aws codepipeline get-pipeline --name 

or in Powershell


(Get-CPPipeline -name ).artifactstore

For the CLI you can find the JSON object "ArtifactStore", or in powershell you can access the attribute directly. It turns out that Codepipeline creates an S3 bucket for you behind the scenes, and gives it a unique name. Your artifacts get stored here under a key that's a truncated version of the Output artifact name, and a version guid.