[BUG] error message: At least RES stage is required

Open
#124 20 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
aws, typescript
Domain
ci-cd, devops

Research direction

Start at PipelineBlueprint.ts, especially generateDeploymentDefinitions around the reported line 519, then trace the call from bin/pipeline-ci-cd-wrapper.ts. Compare the documented stages setup with the sample repository and the Bootstrap your stages documentation. Done means the reproduced DEV, INT, and PROD configuration can synthesize and deploy without the RES-stage error.

Written by the indexing model from the issue text.

Description

bug
Describe the bug

I want to deploy to prod as described here: Bootstrap your stages

I copied the stages configuration from the docuemntation:

.defineStages([Stage.DEV, Stage.INT, Stage.PROD])

When I run this command:

CDK_QUALIFIER=$(jq -r '.config.cdkQualifier' package.json)
npx dotenv-cli -- npm run cdk bootstrap -- --profile $RES_ACCOUNT_AWS_PROFILE --qualifier ${CDK_QUALIFIER} aws://${ACCOUNT_RES}/${AWS_REGION}

or this command:

npx dotenv-cli -- npm run cdk deploy -- --all --region ${AWS_REGION} --profile $RES_ACCOUNT_AWS_PROFILE --qualifier ${CDK_QUALIFIER}

I get this error message:

throw new Error('At least RES stage is required');
Expected Behavior

No error

Current Behavior
➜  pipeline-ci-cd-wrapper git:(main) npx dotenv-cli -- npm run cdk deploy -- --all --region ${AWS_REGION} --profile $RES_ACCOUNT_AWS_PROFILE --qualifier ${CDK_QUALIFIER}


> [email protected] cdk
> cdk deploy --all --region eu-west-1 --profile res --qualifier hnb659fds

/Users/julian/dev/pipeline-ci-cd-wrapper/node_modules/@cdklabs/cdk-cicd-wrapper/src/stacks/PipelineBlueprint.ts:519
      throw new Error('At least RES stage is required');
            ^
Error: At least RES stage is required
    at PipelineBlueprintBuilder.generateDeploymentDefinitions (/Users/julian/dev/pipeline-ci-cd-wrapper/node_modules/@cdklabs/cdk-cicd-wrapper/src/stacks/PipelineBlueprint.ts:519:13)
    at PipelineBlueprintBuilder.synth (/Users/julian/dev/pipeline-ci-cd-wrapper/node_modules/@cdklabs/cdk-cicd-wrapper/src/stacks/PipelineBlueprint.ts:442:44)
    at Object.<anonymous> (/Users/julian/dev/pipeline-ci-cd-wrapper/bin/pipeline-ci-cd-wrapper.ts:19:4)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module.m._compile (/Users/julian/dev/pipeline-ci-cd-wrapper/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/julian/dev/pipeline-ci-cd-wrapper/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1019:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
Subprocess exited with error 1
Reproduction Steps

Define PROD stage as described in the documentation:

PipelineBlueprint.builder().defineStages([Stage.DEV, Stage.INT, Stage.PROD]).addStack({
    provide: (context) => {
        // Create your stacks here
        new PipelineCiCdWrapperStack(context.scope, `${context.blueprintProps.applicationName}PipelineCiCdWrapperStack`);

    }
}).synth(app);

See sample repo: https://github.com/jumic/pipeline-ci-cd-wrapper

Possible Solution

No response

Additional Information/Context

No response

CDK CI/CD Wrapper version used

latest

Environment details (OS name and version, etc.)

macOS 15.3.1

Dominant language
TypeScript
Stars
33
Forks
9
Avg merge
14h 32m
Merged PRs (30d)
25

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cdklabs/cdk-cicd-wrapper

All issues in cdklabs/cdk-cicd-wrapper

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.