Workflow output variable reference - Amazon CodeCatalyst

Workflow output variable reference

Certain Amazon CodeCatalyst workflow actions, as well as the input source, emit variables automatically and make them available for you to use in other workflow actions. These variables are called workflow output variables, or simply output variables. There is no need for you to define or set these variables; they are output without requiring any configuration on your part. An example of such a variable is the CommitId variable.

Consult the following sections to view the workflow output variables produced automatically by each workflow action.

Note

For information about how to use these variables in a workflow, see Working with variables.

Note

This reference only lists output variables emitted by actions authored by the CodeCatalyst development team. If you're using a third-party action, see instead Determining which workflow output variables an action emits.

WorkflowSource output variables

The WorkflowSource input source produces the following output variables.

Key Value

CommitId

The commit ID representing the state of the repository at the time the workflow run started.

Example: example3819261db00a3ab59468c8b

See also: Example: Referencing the "CommitId" workflow output variable

BranchName

The name of the branch against which the workflow run started.

Examples: main, feature/branch, test-LiJuan

See also: Example: Referencing the "BranchName" workflow output variable

Build and test action output variables

The build and test actions do not produce output variables automatically.

"Amazon S3 publish" action output variables

The Amazon S3 publish action does not produce output variables automatically.

"AWS CDK bootstrap" action output variables

The AWS CDK bootstrap action produces the following output variables.

Key Value

deployment-platform

The name of the deployment platform.

Hardcoded to AWS:CloudFormation.

region

The region code of the AWS Region that the AWS CDK bootstrap stack was deployed to during the workflow run.

Example: us-west-2

stack-id

The Amazon Resource Name (ARN) of the deployed AWS CDK bootstrap stack.

Example: arn:aws:cloudformation:us-west-2:111122223333:stack/codecatalyst-cdk-bootstrap-stack/6aad4380-100a-11ec-a10a-03b8a84d40df

SKIP-DEPLOYMENT

A value of true indicates that deployment of your AWS CDK bootstrap stack was skipped during the workflow run. A stack deployment will be skipped if there is no change in the stack since the last deployment.

This variable is only produced if its value is true.

Hardcoded to true.

"AWS CDK deploy" action output variables

The AWS CDK deploy action produces the following output variables.

Key Value

stack-id

The Amazon Resource Name (ARN) of the AWS CDK application stack that was deployed to during the workflow run.

Example: arn:aws:cloudformation:us-west-2:111122223333:stack/codecatalyst-cdk-app-stack/6aad4380-100a-11ec-a10a-03b8a84d40df

deployment-platform

The name of the deployment platform.

Hardcoded to AWS:CloudFormation.

region

The region code of the AWS Region that was deployed to during the workflow run.

Example: us-west-2

SKIP-DEPLOYMENT

A value of true indicates that deployment of your AWS CDK application stack was skipped during the workflow run. A stack deployment will be skipped if there is no change in the stack since the last deployment.

This variable is only produced if its value is true.

Hardcoded to true.

AWS CloudFormation output variables

In addition to generating the variables listed previously, the AWS CDK deploy action also exposes CloudFormation output variables as workflow output variables for use in subsequent workflow actions. By default, the action only exposes the first four (or fewer) CloudFormation output variables that it finds. To determine which ones are exposed, run the AWS CDK deploy action once, and then look in the Variables tab of the run details page. If the variables listed on the Variables tab are not what you want, you can configure different ones using the CfnOutputVariables YAML property. For more information, see the CfnOutputVariables property description in the "AWS CDK deploy" action reference.

"AWS Lambda invoke" action output variables

By default, the AWS Lambda invoke action produces one variable per top-level key in the Lambda response payload.

For example, if the response payload looks like this:

responsePayload = { "name": "Saanvi", "location": "Seattle", "department": { "company": "Amazon", "team": "AWS" } }

...then the action would generate the following output variables.

Key Value

name

Saanvi

location

Seattle

department

{"company": "Amazon", "team": "AWS"}

Note

You can change which output variables are generated using the ResponseFilters YAML property. For more information, see the ResponseFilters in the "AWS Lambda invoke" action reference.

"Deploy AWS CloudFormation stack" action output variables

The Deploy AWS CloudFormation stack action produces the following output variables.

Key Value

deployment-platform

The name of the deployment platform.

Hardcoded to AWS:CloudFormation.

region

The region code of the AWS Region that was deployed to during the workflow run.

Example: us-west-2

stack-id

The Amazon Resource Name (ARN) of the deployed stack.

Example: arn:aws:cloudformation:us-west-2:111122223333:stack/codecatalyst-cfn-stack/6aad4380-100a-11ec-a10a-03b8a84d40df

"Deploy to Amazon ECS" action output variables

The Deploy to Amazon ECS action produces the following output variables.

Key Value

cluster

The name of the Amazon ECS cluster that was deployed to during the workflow run.

Example: codecatalyst-ecs-cluster

deployment-platform

The name of the deployment platform.

Hardcoded to AWS:ECS.

service

The name of the Amazon ECS service that was deployed to during the workflow run.

Example: codecatalyst-ecs-service

task-definition-arn

The Amazon Resource Name (ARN) of the task definition that was registered during the workflow run.

Example: arn:aws:ecs:us-west-2:111122223333:task-definition/codecatalyst-task-def:8

The :8 in the preceding example indicates the revision that was registered.

deployment-url

A link to the Amazon ECS console's Events tab, where you can view details of the Amazon ECS deployment associated with the workflow run.

Example: https://console.aws.amazon.com/ecs/home?region=us-west-2#/clusters/codecatalyst-ecs-cluster/services/codecatalyst-ecs-service/events

region

The region code of the AWS Region that was deployed to during the workflow run.

Example: us-west-2

"Render Amazon ECS task definition" action output variables

The Render Amazon ECS task definition action produces the following output variables.

Key Value

task-definition

The name given to the task definition file that was updated by the Render Amazon ECS task definition action. The name follows the format task-definition-random-string.json.

Example: task-definition--259-0a2r7gxlTF5Xr.json

"GitHub Actions" action output variables

The "GitHub Actions" action does not produce output variables automatically.