Skip to content

AWS.CodePipeline reference

Source: src/AWS/CodePipeline/AcknowledgeJob.ts

Runtime binding for codepipeline:AcknowledgeJob — confirms receipt of a job returned by PollForJobs so the pipeline knows a worker has claimed it. Used for custom actions only; the nonce must be the one returned with the polled job.

CodePipeline job operations do not support resource-level permissions, so the grant is on *. The binding takes no resource — job ids come from polling.

const acknowledgeJob = yield* AWS.CodePipeline.AcknowledgeJob();
const { status } = yield* acknowledgeJob({ jobId, nonce });

Source: src/AWS/CodePipeline/DisableStageTransition.ts

Runtime binding for codepipeline:DisableStageTransition — freezes a transition into (Inbound) or out of (Outbound) a stage, e.g. to gate deploys during an incident.

const disableTransition =
yield* AWS.CodePipeline.DisableStageTransition(pipeline);
yield* disableTransition({
stageName: "Deploy",
transitionType: "Inbound",
reason: "incident in progress",
});

Source: src/AWS/CodePipeline/EnableStageTransition.ts

Runtime binding for codepipeline:EnableStageTransition — re-opens a transition into (Inbound) or out of (Outbound) a stage that was previously disabled.

const enableTransition =
yield* AWS.CodePipeline.EnableStageTransition(pipeline);
yield* enableTransition({
stageName: "Deploy",
transitionType: "Inbound",
});

Source: src/AWS/CodePipeline/GetJobDetails.ts

Runtime binding for codepipeline:GetJobDetails — fetches the details of a job handed to a custom/Invoke action, including input artifacts and the temporary artifact-store credentials (returned as Redacted values).

CodePipeline job operations do not support resource-level permissions, so the grant is on *. The binding takes no resource — the job id arrives with the invocation event.

const getJobDetails = yield* AWS.CodePipeline.GetJobDetails();
const { jobDetails } = yield* getJobDetails({ jobId });

Source: src/AWS/CodePipeline/GetPipelineExecution.ts

Runtime binding for codepipeline:GetPipelineExecution — returns the status, source revisions, and trigger of one execution.

const getExecution = yield* AWS.CodePipeline.GetPipelineExecution(pipeline);
const { pipelineExecution } = yield* getExecution({
pipelineExecutionId: executionId,
});

Source: src/AWS/CodePipeline/GetPipelineState.ts

Runtime binding for codepipeline:GetPipelineState — returns the current state of every stage and action in the pipeline, including in-flight executions, transition states, and manual-approval tokens.

const getState = yield* AWS.CodePipeline.GetPipelineState(pipeline);
const state = yield* getState();
const approval = state.stageStates
?.find((s) => s.stageName === "Approve")
?.actionStates?.find((a) => a.actionName === "ManualApproval");

Source: src/AWS/CodePipeline/ListActionExecutions.ts

Runtime binding for codepipeline:ListActionExecutions — enumerates the action-level execution history of the pipeline, optionally filtered to a single execution.

const listActions = yield* AWS.CodePipeline.ListActionExecutions(pipeline);
const { actionExecutionDetails } = yield* listActions({
filter: { pipelineExecutionId: executionId },
});

Source: src/AWS/CodePipeline/ListDeployActionExecutionTargets.ts

Runtime binding for codepipeline:ListDeployActionExecutionTargets — enumerates the targets (instances, tasks, functions) a deploy action execution rolled out to.

ListDeployActionExecutionTargets: Observing Pipelines

Section titled “ListDeployActionExecutionTargets: Observing Pipelines”
const listTargets =
yield* AWS.CodePipeline.ListDeployActionExecutionTargets(pipeline);
const { targets } = yield* listTargets({
actionExecutionId: actionExecutionId,
});

Source: src/AWS/CodePipeline/ListPipelineExecutions.ts

Runtime binding for codepipeline:ListPipelineExecutions — enumerates recent executions of the pipeline (newest first).

ListPipelineExecutions: Observing Pipelines

Section titled “ListPipelineExecutions: Observing Pipelines”
const listExecutions = yield* AWS.CodePipeline.ListPipelineExecutions(pipeline);
const { pipelineExecutionSummaries } = yield* listExecutions({
maxResults: 10,
});

Source: src/AWS/CodePipeline/ListRuleExecutions.ts

Runtime binding for codepipeline:ListRuleExecutions — enumerates the execution history of stage-condition rules (V2 pipelines).

const listRules = yield* AWS.CodePipeline.ListRuleExecutions(pipeline);
const { ruleExecutionDetails } = yield* listRules();

Source: src/AWS/CodePipeline/OverrideStageCondition.ts

Runtime binding for codepipeline:OverrideStageCondition — overrides a stage condition (e.g. a failing BEFORE_ENTRY or ON_SUCCESS check) so the execution can proceed (V2 pipelines).

const overrideCondition =
yield* AWS.CodePipeline.OverrideStageCondition(pipeline);
yield* overrideCondition({
stageName: "Deploy",
pipelineExecutionId: executionId,
conditionType: "BEFORE_ENTRY",
});

Source: src/AWS/CodePipeline/Pipeline.ts

An AWS CodePipeline continuous-delivery pipeline: an ordered set of stages, each running one or more actions (source → build → deploy), with an S3 artifact store carrying outputs between them.

Defining and updating the pipeline is instant. Pipelines that use a git source require a CodeConnections connection whose OAuth handshake is completed manually — use an S3 source to avoid the handshake.

const pipeline = yield* CodePipeline.Pipeline("Release", {
roleArn: role.roleArn,
artifactStore: { type: "S3", location: artifactBucket.bucketName },
stages: [
{
name: "Source",
actions: [{
name: "S3Source",
category: "Source",
owner: "AWS",
provider: "S3",
outputArtifacts: ["SourceOutput"],
configuration: {
S3Bucket: sourceBucket.bucketName,
S3ObjectKey: "source.zip",
PollForSourceChanges: "false",
},
}],
},
{
name: "Build",
actions: [{
name: "Build",
category: "Build",
owner: "AWS",
provider: "CodeBuild",
inputArtifacts: ["SourceOutput"],
configuration: { ProjectName: project.projectName },
}],
},
],
});

Source: src/AWS/CodePipeline/PollForJobs.ts

Runtime binding for codepipeline:PollForJobs — fetches pending jobs for a custom action type so a job worker can claim and execute them. Valid only for action types with Custom in the owner field; returned jobs include the temporary artifact-store credentials (as Redacted values) and any secret configuration values.

CodePipeline grants job-worker polling on * (the action-type sub-ARN is also honored, but the binding takes no resource — the action type is a request field).

const pollForJobs = yield* AWS.CodePipeline.PollForJobs();
const { jobs } = yield* pollForJobs({
actionTypeId: {
category: "Build",
owner: "Custom",
provider: "MyBuilder",
version: "1",
},
maxBatchSize: 1,
});

Source: src/AWS/CodePipeline/PutActionRevision.ts

Runtime binding for codepipeline:PutActionRevision — informs CodePipeline about a new revision available to a source action, starting an execution if the revision is new.

const putRevision = yield* AWS.CodePipeline.PutActionRevision(pipeline);
const { newRevision, pipelineExecutionId } = yield* putRevision({
stageName: "Source",
actionName: "S3Source",
actionRevision: {
revisionId: versionId,
revisionChangeId: changeId,
created: new Date(),
},
});

Source: src/AWS/CodePipeline/PutApprovalResult.ts

Runtime binding for codepipeline:PutApprovalResult — answers a manual approval action with Approved or Rejected. The approval token comes from the action’s latestExecution in GetPipelineState.

const putApproval = yield* AWS.CodePipeline.PutApprovalResult(pipeline);
yield* putApproval({
stageName: "Approve",
actionName: "ManualApproval",
token: approvalToken,
result: { status: "Approved", summary: "LGTM" },
});

Source: src/AWS/CodePipeline/PutJobFailureResult.ts

Runtime binding for codepipeline:PutJobFailureResult — reports failure for a job handed to the workload by a pipeline Invoke (Lambda) or custom action, failing the action immediately instead of timing out.

CodePipeline job operations do not support resource-level permissions, so the grant is on *. The binding takes no resource — the job id arrives with the invocation event.

const putJobFailure = yield* AWS.CodePipeline.PutJobFailureResult();
yield* putJobFailure({
jobId: event["CodePipeline.job"].id,
failureDetails: { type: "JobFailed", message: "smoke test failed" },
});

Source: src/AWS/CodePipeline/PutJobSuccessResult.ts

Runtime binding for codepipeline:PutJobSuccessResult — reports success for a job handed to the workload by a pipeline Invoke (Lambda) or custom action. Without this call the action times out.

CodePipeline job operations do not support resource-level permissions, so the grant is on *. The binding takes no resource — the job id arrives with the invocation event.

const putJobSuccess = yield* AWS.CodePipeline.PutJobSuccessResult();
yield* putJobSuccess({
jobId: event["CodePipeline.job"].id,
outputVariables: { RELEASE: version },
});

Source: src/AWS/CodePipeline/RetryStageExecution.ts

Runtime binding for codepipeline:RetryStageExecution — re-runs a failed stage, either just the failed actions (FAILED_ACTIONS) or the whole stage from its first action (ALL_ACTIONS).

const retryStage = yield* AWS.CodePipeline.RetryStageExecution(pipeline);
yield* retryStage({
stageName: "Deploy",
pipelineExecutionId: executionId,
retryMode: "FAILED_ACTIONS",
});

Source: src/AWS/CodePipeline/RollbackStage.ts

Runtime binding for codepipeline:RollbackStage — rolls a stage back to the state of a previous successful execution (V2 pipelines).

const rollbackStage = yield* AWS.CodePipeline.RollbackStage(pipeline);
yield* rollbackStage({
stageName: "Deploy",
targetPipelineExecutionId: lastGoodExecutionId,
});

Source: src/AWS/CodePipeline/StartPipelineExecution.ts

Runtime binding for codepipeline:StartPipelineExecution — lets a workload kick off an execution of a pipeline (optionally overriding pipeline variables or source revisions).

The response carries the pipelineExecutionId, which can be observed with the GetPipelineExecution binding.

const startExecution = yield* AWS.CodePipeline.StartPipelineExecution(pipeline);
const { pipelineExecutionId } = yield* startExecution({
variables: [{ name: "ENV", value: "prod" }],
});

Source: src/AWS/CodePipeline/StopPipelineExecution.ts

Runtime binding for codepipeline:StopPipelineExecution — stops an in-progress execution, either finishing in-flight actions first or abandoning them (abandon: true).

const stopExecution = yield* AWS.CodePipeline.StopPipelineExecution(pipeline);
yield* stopExecution({
pipelineExecutionId: executionId,
abandon: true,
reason: "superseded by hotfix",
});