Defining an input artifact - Amazon CodeCatalyst

Defining an input artifact

If you want to use an artifact generated by another Amazon CodeCatalyst action, you must specify it as an input to the current action. You may be able to specify multiple artifacts as input—it depends on the action. For more information, see the Workflow YAML definition for your action.

Note

You cannot reference artifacts from other workflows.

Use the following instructions to specify an artifact from another action as input to the current action.

Prerequisite

Before you begin, make sure you have output the artifact from the other action. For more information, see Defining an output artifact. Outputting the artifact makes it available for other actions to use.

Visual
To specify an artifact as input to an action (visual editor)
  1. Open the CodeCatalyst console at https://codecatalyst.aws/.

  2. Choose your project.

  3. In the navigation pane, choose CI/CD, and then choose Workflows.

  4. Choose the name of your workflow. You can filter by the source repository or branch name where the workflow is defined, or filter by workflow name or status.

  5. Choose Edit.

  6. Choose Visual.

  7. In the workflow diagram, choose the action where you want to specify an artifact as input.

  8. Choose Inputs.

  9. In Artifacts - optional, do the following:

    Specify artifacts from previous actions that you want to provide as input to this action. These artifacts must already be defined as output artifacts in previous actions.

    If you do not specify any input artifacts, then you must specify at least one source repository under action-name/Inputs/Sources.

    For more information about artifacts, including examples, see Sharing artifacts and files between actions.

    Note

    If the Artifacts - optional drop-down list is unavailable (visual editor), or if you get errors in when you validate your YAML (YAML editor), it might be because the action only supports one input. In this case, try removing the source input.

  10. (Optional) Choose Validate to validate the workflow's YAML code before committing.

  11. Choose Commit, enter a commit message, and choose Commit again.

YAML
To specify an artifact as input to an action (YAML editor)
  1. Open the CodeCatalyst console at https://codecatalyst.aws/.

  2. Choose your project.

  3. In the navigation pane, choose CI/CD, and then choose Workflows.

  4. Choose the name of your workflow. You can filter by the source repository or branch name where the workflow is defined, or filter by workflow name or status.

  5. Choose Edit.

  6. Choose YAML.

  7. In the action where you want to specify the artifact as input, add code similar to the following:

    action-name: Inputs: Artifacts: - artifact-name

    For more examples, see Examples of artifacts.

  8. (Optional) Choose Validate to validate the workflow's YAML code before committing.

  9. Choose Commit, enter a commit message, and choose Commit again.