Skip to content

bug: passwords regenerate on every AWS init, breaking existing resources #363

@cherriechang

Description

@cherriechang

Problem

pushkin aws init regenerates random passwords on every run, causing authentication failures when resources already exist.

Current Behavior

  1. First run: Creates RabbitMQ with password abc123
  2. Second run: Generates NEW password xyz789, updates task definitions
  3. RabbitMQ container still expects abc123 but API tries xyz789 → Auth failure
  4. Same issue with RDS database passwords during migrations

Cause

Line 1817 in aws/index.js/ecsTaskCreator(): (RabbitMQ)

const rabbitPW = Math.random().toString(); // Always generates new password

Line 1199 in aws/index.js/initDb(): (RDS database)

dbPassword = generateSecurePassword(); // Always generates new password

But there are no check for existing passwords in pushkin.yaml

Wanted Behavior

  • Resource exist + password in pushkin.yaml → reuse
  • Resource don't exist → generate new password and update pushkin.yaml

Extra enhancements

  • Use crypto.randomBytes() for password generation instead of Math.random() for both

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions