-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: "Test AWS Cost Policies: Postgres" | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "transformations/aws/cost/**" | ||
- ".github/workflows/transformations_aws_cost_postgres.yml" | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "transformations/aws/cost/**" | ||
- ".github/workflows/transformations_aws_cost_postgres.yml" | ||
|
||
jobs: | ||
transformations-aws-cost: | ||
name: transformations/aws/cost | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./transformations/aws/cost | ||
services: | ||
postgres: | ||
image: postgres:11 | ||
env: | ||
POSTGRES_PASSWORD: pass | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: postgres | ||
ports: | ||
- 5432:5432 | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
cache: "pip" | ||
cache-dependency-path: "./transformations/aws/cost/requirements.txt" | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Setup CloudQuery | ||
uses: cloudquery/setup-cloudquery@v3 | ||
with: | ||
version: v4.0.0 | ||
# Test unpacked version | ||
- name: Migrate DB | ||
run: cloudquery migrate tests/postgres.yml | ||
env: | ||
CQ_DSN: postgresql://postgres:pass@localhost:5432/postgres | ||
- name: Run Policies | ||
run: | | ||
dbt run --target dev-pg --profiles-dir ./tests | ||
# Test packed version | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
cache: 'npm' | ||
cache-dependency-path: scripts/dbt-pack/package-lock.json | ||
- name: Install Dependencies | ||
run: npm ci | ||
working-directory: ./scripts/dbt-pack | ||
- name: Pack DBT | ||
working-directory: ./scripts/dbt-pack | ||
run: node index.js dbt-pack --project-dir=../../transformations/aws/cost | ||
- name: Unzip Packed DBT | ||
run: unzip -o build/aws_cost.zip -d build/aws_cost | ||
- name: Run Unpacked DBT | ||
working-directory: ./transformations/aws/cost/build/aws_cost | ||
run: | | ||
dbt run --target dev-pg --profiles-dir ../../tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"schema_version": 1, | ||
"type": "addon", | ||
"team_name": "cloudquery", | ||
"addon_name": "aws-cost", | ||
"addon_type": "transformation", | ||
"addon_format": "zip", | ||
"message": "@./changelog.md", | ||
"doc": "./README.md", | ||
"path": "./build/aws_cost.zip", | ||
"plugin_deps": ["cloudquery/source/[email protected]"], | ||
"addon_deps": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dbt-postgres==1.6.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dbt-postgres==1.6.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# CloudQuery × dbt: AWS Encryption Package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"schema_version": 1, | ||
"type": "addon", | ||
"team_name": "cloudquery", | ||
"addon_name": "aws-encryption", | ||
"addon_type": "transformation", | ||
"addon_format": "zip", | ||
"message": "@./changelog.md", | ||
"doc": "./README.md", | ||
"path": "./build/aws_encryption.zip", | ||
"plugin_deps": ["cloudquery/source/[email protected]"], | ||
"addon_deps": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dbt-postgres==1.6.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
kind: source | ||
spec: | ||
name: aws | ||
path: cloudquery/aws | ||
version: "v22.19.0" # latest version of source aws plugin | ||
destinations: ["postgresql"] | ||
tables: ["*"] | ||
--- | ||
kind: destination | ||
spec: | ||
name: "postgresql" | ||
path: "cloudquery/postgresql" | ||
registry: cloudquery | ||
version: "v7.1.0" # latest version of postgresql plugin | ||
spec: | ||
batch_size: 10000 | ||
connection_string: ${CQ_DSN} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
aws_encryption: # This should match the name in your dbt_project.yml | ||
target: dev | ||
outputs: | ||
dev-pg: | ||
type: postgres | ||
host: 127.0.0.1 | ||
user: postgres | ||
pass: pass | ||
port: 5432 | ||
dbname: postgres | ||
schema: public # default schema where dbt will build the models | ||
threads: 1 # number of threads to use when running in parallel |