Sharing artifacts and files between actions - Amazon CodeCatalyst

Sharing artifacts and files between actions

An artifact is the output of a workflow action, and typically consists of a folder or archive of files. Artifacts are important because they allow you to share files and information between actions.

For example, you might have a build action that generates a sam-template.yml file, but you want a deploy action to use it. In this scenario, you would use an artifact to allow the build action to share the sam-template.yml file with the deploy action. The code might look something like this:

Actions: BuildAction: Identifier: aws/build@v1 Steps: - Run: sam package --output-template-file sam-template.yml Outputs: Artifacts: - Name: MYARTIFACT Files: - sam-template.yml DeployAction: Identifier: aws/cfn-deploy@v1 Inputs: Artifacts: - MYARTIFACT Configuration: template: sam-template.yml

In the previous code, the build action (BuildAction) generates a sam-template.yml file, and then adds it to an output artifact called MYARTIFACT. A subsequent deploy action (DeployAction) specifies MYARTIFACT as an input, giving it access to the sam-template.yml file.

Can I share artifacts without specifying them as outputs and inputs?

Yes, you can share artifacts between actions without specifying them in the Outputs and Inputs sections of your actions' YAML code. To do this, you must turn on compute sharing. For more information about compute sharing and how to specify artifacts when it is turned on, see Sharing compute across actions.

Note

Although the compute sharing feature allows you to simplify your workflow's YAML code by eliminating the need for the Outputs and Inputs sections, the feature has limitations that you should be aware of before you turn it on. For information about these limitations, see Considerations for compute sharing.

Can I share artifacts between workflows?

No, you cannot share artifacts between different workflows; however, you can share artifacts between actions within the same workflow.