Skip to main content

MiniStack Deployment

Deploy synthesized CloudFormation to MiniStack through the Interactive Deployer or MiniStackCli.

See also: Setup · Jenkins on MiniStack · Verification · Advanced Configuration


From cfc-testing, after building (see Setup) and starting MiniStack:

# Walks configuration prompts when deployment-context.json is missing,
# then shows the deploy menu
java -cp "target/classes:target/dependency/*" \
com.cloudforgeci.samples.app.InteractiveDeployer

When prompts appear

SituationBehavior
No deployment-context.jsonFull configuration questionnaire, then the deploy menu
Saved deployment-context.jsonSkips the questionnaire; shows the deploy menu
--interactive / -i or INTERACTIVE=trueIgnores the saved context and runs the questionnaire
--force / -fDeletes the saved context file, then runs the questionnaire
cdk synth / cdk deployNo prompts; synthesizes the saved context for AWS

Other arguments: --context <file> (or -c, or CFC_CONTEXT_FILE) selects the context file, and a trailing digit selects the menu option without prompting, for example:

java -cp "target/classes:target/dependency/*" \
com.cloudforgeci.samples.app.InteractiveDeployer \
--context deployment-contexts/Jenkins-Stack.json 6

Every option except 9 and 0 synthesizes the canonical template first.

OptionAction
1Synthesize only (canonical AWS template in cdk.out/)
2Deploy to AWS (cdk deploy)
3Redeploy to AWS (delete + deploy)
4Dry run: write the MiniStack adapted template + report; print the AWS change-set command
5Export template (YAML/JSON)
6Deploy to MiniStack (preflight, adapt template, create/update stack)
7MiniStack pipeline: cfn-guard validation → deploy → stack verification
8Deploy to LocalStack (see LocalStack)
9Reconfigure (fresh interactive setup)
0Cancel

Typical first-time flow​

  1. Complete Setup: build and start MiniStack.
  2. Run the Interactive Deployer and complete configuration (or pass a sample context with --context).
  3. Choose 6 (Deploy to MiniStack).

The MiniStack CloudFormation stack is always named <stackName>-ministack.

Redeploying the same applicationId under a new stack name deletes the earlier MiniStack stack for that application first. Set CFC_MINISTACK_REPLACE_SAME_APP=false to keep both.

Deployment artifacts​

Each deploy writes to cfc-testing/cdk.out/:

FileDescription
<stackName>.template.jsonCanonical AWS template (unchanged)
<stackName>.ministack.template.jsonAdapted template deployed to MiniStack
<stackName>.ministack-adaptations.jsonAudit trail of every local change

MiniStackCli (Non-Interactive)​

For scripts, run MiniStackCli against an already-synthesized canonical template:

cd cfc-testing

java -cp "target/classes:target/dependency/*" \
com.cloudforgeci.ministack.MiniStackCli \
deploy <stackName>-ministack cdk.out/<stackName>.template.json

java -cp "target/classes:target/dependency/*" \
com.cloudforgeci.ministack.MiniStackCli \
verify <stackName>-ministack

java -cp "target/classes:target/dependency/*" \
com.cloudforgeci.ministack.MiniStackCli \
delete <stackName>-ministack

deploy derives the stack name from the template file name (<stackName>.template.json → <stackName>-ministack), writes the adapted template and adaptation report beside it, then creates or updates the stack. It does not run preflight. verify prints stack outputs and polls MiniStackLocalUrl until it returns HTTP < 500 (up to 3 minutes; set MINISTACK_HTTP_VERIFY=false to skip the HTTP check).


Base Jenkins on MiniStack (walkthrough)​

Minimal Fargate Jenkins with no domain and no auth.

1. Prerequisites​

# Repository root
mvn -f cfc-testing package -Dmaven.test.skip=true
cd cfc-testing

# Start MiniStack (ministack → start) and check health
java -cp "target/classes:target/dependency/*" \
com.cloudforgeci.samples.app.InteractiveDeployer --platform
curl -s http://localhost:4566/_ministack/health

# Optional: delete the saved context to walk all prompts
rm -f deployment-context.json

2. Configure and deploy​

java -cp "target/classes:target/dependency/*" \
com.cloudforgeci.samples.app.InteractiveDeployer

Complete the prompts (Jenkins, Fargate, no domain), then choose 6. With a saved deployment-context.json, the Deployer skips the prompts and shows the menu.

3. Confirm deployment succeeded​

The deployer prints change-set actions and stack outputs. You should see at minimum:

  • MiniStackLocalUrl: ALB data-plane entry (http://localhost:4566/_alb/<name>/)
  • MiniStackApplicationUrl: direct ECS port (http://localhost:<port>)

MiniStackAuthenticatedUrl is absent for this configuration.

4. Reach Jenkins​

MiniStack's ALB cannot forward to ECS; the adapter redirects listeners to the local ECS port. Use the application URL:

curl -s -o /dev/null -w "%{http_code}\n" http://localhost:8080/
open http://localhost:8080/

Or follow the ALB redirect:

curl -sIL "<MiniStackLocalUrl>" | tail -5

Jenkins can take 1–3 minutes after the ECS task starts before HTTP returns < 500. Prefer MiniStackApplicationUrl over the /_alb/... URL; see Troubleshooting.

5. Verify​

Follow Verification to confirm all resources deployed as expected.


Next Steps​