codepipeline: v2 pipelines generate invalid cfn if artifacts specify a filename with a non-compute action
Author: JenniferPylkoCreated Sep 18, 2026Updated Sep 18, 2026
Labelsbug@aws-cdk/aws-codepipelineneeds-triage
Describe the bug
codepipeline v2 resources fail to create if both of the following conditions are true:
- a non-compute action (such as a codebuild action) specifies output artifacts
- the output artifacts specified by said action are defined with a file path (2nd parameter to Artifact() constructor)
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Library Version
No response
Expected Behavior
The cfn deployment should succeed, creating a pipeline that includes the specified action.
Current Behavior
The cfn deployment fails with the error message The following action cannot contain a commands field: BuildDebugAction. To use the commands field, use a compute action.
The error message appears to be both irrelevant and misleading.
Reproduction Steps
const debug_apk = new Artifact("debug_apk", [debug_apk_path])
//...
const build_debug = new CodeBuildAction({
actionName: "BuildDebugAction",
runOrder: 1,
input: sourceArtifact,
project: build_debug_project,
outputs: [debug_apk],
})Possible Solution
When building the stack, non-compute codepipeline actions should throw an error if any specified output artifacts include file paths.
Additional Information/Context
No response
AWS CDK Library version (aws-cdk-lib)
2.270.0
AWS CDK CLI version
2.1142.0 (build a73eebf)
Node.js Version
26
OS
Arch Linux
Language
TypeScript
Language Version
tsc 6.0.3
Other information
No response
Source: aws/aws-cdk