Invalid Password for AWS RDS Instance

I tried to set up a Phoenix application on AWS with a Postgres RDS.

While the connection to the Postgres works locally fine, I couldn’t get it working on AWS.
The access the RDS outside Phoenix from my local machine via the internet works fine where I used the same credentials. So I guess there must be any problem inside the Phoenix connection.

My database connection setup is the following which I even set up locally in a successful way:

  config :app, App.Repo,
    adapter: Ecto.Adapters.Postgres,
    username: System.get_env("POSTGRES_USER"),
    password: System.get_env("POSTGRES_PW"),
    hostname: System.get_env("POSTGRES_HOST"),
    database: "app_prod",
    pool_size: 20

My error messages are the following:

[error] Postgrex.Protocol (#PID<0.257.0>) failed to connect: ** (Postgrex.Error)
FATAL 28P01 (invalid_password): password authentication failed for user

What could be a problem I have overseen?

Are you using an application release via Distillery on AWS?

No. I set it up on my own on AWS.

Funnily, when I start to ask here, it seems I have fixed my problems somehow.
I passed the parameters in the “run task” form instead in the “task definition”.
So far, I guess this change solved this specific problem.