Skip to content

A self-contained dbt project for testing purposes

Notifications You must be signed in to change notification settings

ebosas/dbt-test

 
 

Repository files navigation

Testing dbt

Locally

Launch Postgres in a local container:

docker compose up

Connect to the local database:

docker run -it --rm \
    --network dbt_network \
    postgres:14-alpine \
    psql -h postgres -U postgres -d dbt

On AWS

Create an SSM parameter for the Postgres password with the name /dbt/PostgresPassword and type SecureString. Then deploy the CloudFormation stacks. First, the VPC.

cd deployments
aws cloudformation create-stack --stack-name db-vpc --template-body file://vpc.yaml

Once done, deploy the database stack.

aws cloudformation create-stack --stack-name db-postgres --template-body file://db.yaml

Seed the database:

export DBT_PASSWORD="<pg_password>"
dbt seed --profiles-dir ./ --profile dbt_dev

Connect to a remote database:

docker run -it --rm \
    postgres:14-alpine \
    psql -h <pg_endpoint> -p 5432 -U postgres -d dbt -W

About

A self-contained dbt project for testing purposes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 90.6%
  • Shell 9.4%