Skip to content

CloudFormation Template in Chapter 16 Missing Application Code Setup Instructions #33

@arahas

Description

@arahas

Bug Description

The CloudFormation template in chapter16/template.yaml assumes the existence of Node.js applications in /home/ec2-user/worker/ and /home/ec2-user/server/ directories, but these directories and the required application code are not created during instance launch.

Current Behavior

  1. Template deploys successfully
  2. EC2 instances launch (both server and worker)
  3. Web interface loads and allows file uploads
  4. Files upload to S3 bucket successfully
  5. SQS messages go into "in-flight" state but never get processed
  6. When SSH'ing into worker instance, the error shows:
    sh-4.2$ cd /home/ec2-user/worker
    sh: cd: /home/ec2-user/worker: Not a directory

Expected Behavior

The UserData script should either:

  • Install required Node.js applications and code
  • OR documentation should clearly indicate pre-requisite steps for installing the required application code before deploying the template

Steps to Reproduce

  1. Clone repository
  2. Deploy chapter16/template.yaml using CloudFormation
  3. Access the web interface through ALB URL
  4. Upload an image
  5. Image stays in "uploaded" state
  6. Check SQS queue - messages remain "in-flight"
  7. SSH into worker instance - worker directory doesn't exist

Additional Context

The template's UserData sections assume the existence of:

  • /home/ec2-user/worker/worker.js
  • /home/ec2-user/server/server.js

But these files and their containing directories are not created during instance launch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions