# Runs the EF Core migrations bundle on the leader instance only, before the new # application version becomes active. The bundle is a self-contained linux-x64 # executable placed at the root of the deployment archive by # scripts/package-elastic-beanstalk.sh. # # The connection string is provided at runtime by the existing Elastic Beanstalk # environment property ConnectionStrings__DefaultConnection. It must NOT be # passed on the command line (it would leak into the process table and logs); the # bundle reads it through the application configuration environment provider. # # A non-zero exit fails the deployment (Elastic Beanstalk aborts on container # command failure), so a migration error never yields a live broken deployment. container_commands: 01_run_ef_migrations: command: "chmod +x ./efbundle && ./efbundle" leader_only: true