DEV Community

Discussion on: Deploy Elixir + Phoenix to AWS ECS with GitLab CI and Terraform

Collapse
 
mstibbard profile image
mstibbard • Edited

Thanks for the fantastic write up!

1) FYI as of 1 October 2020 the GitLab free tier was reduced to 400 minutes of CI/CD.

2) The initial CI/CD run failed for me with below message in the test stage. I haven't figured out the fix for this yet.

** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
    (db_connection 2.3.1) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
    (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for Hello.Repo couldn't be created: killed
Cleaning up file based variables
00:00
ERROR: Job failed: exit code 1
Enter fullscreen mode Exit fullscreen mode

3) Further down in the tutorial (code block for rds.tf) you've got:

availability_zone = var.aws_default_zone
Enter fullscreen mode Exit fullscreen mode

but you haven't defined it in your variables.tf

Collapse
 
hlappa profile image
Aleksi Holappa

Sorry for a late reply to you comment, good points!

1) Article is now updated. I didn't know GitLab reduced the minutes from 2000 to 400, which is kinda sad :(

2) Make sure you have Postgres as a service for the test job, the DB url is correctly setup and check your config/test.ex that is has proper configuration. Seems like when establishing the connection to DB fails.

3) Added to variables.tf! :)