Terraform – Conerting docker-compose command to terraform?

  docker, terraform

I am having trouble converting my airflow-webserver command in my docker-compose file to terraform. The command is as follows and works on my local development.

command: bash -c "airflow version && airflow webserver"

In my container definitions I have:

"command": ["bash", "-c", "airflow version && airflow webserver"],

When I run terraform creates all of the assets; however when I go to the web endpoint I am unable to log into the Airflow UI.

Inspecting the postgres database I am seeing it is not creating the user in ab_user nor is it creating any of metadata tables (eg. dags, sla_misses, variable).

When I check the logs I can see:

2021-06-10T15:18:08.499-07:00   [[34m2021-06-10 22:18:08,498[0m] {[34mmanager.py:[0m784} WARNING[0m - No user yet created, use flask fab command to do it.[0m

This is for airflow version 2.1.0

Source: Docker Questions