-
Notifications
You must be signed in to change notification settings - Fork 0
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
106 changed files
with
181 additions
and
62 deletions.
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
61 changes: 61 additions & 0 deletions
61
.github/workflows/transformations_gcp_compliance_premium_postgres.yml
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,61 @@ | ||
name: "Test GCP Compliance Premium Policies: Postgres" | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "transformations/gcp/compliance-premium/**" | ||
- ".github/workflows/transformations_gcp_compliance_premium_postgres.yml" | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "transformations/gcp/compliance-premium/**" | ||
- ".github/workflows/transformations_gcp_compliance_premium_postgres.yml" | ||
|
||
jobs: | ||
transformations-gcp-compliance-premium: | ||
name: transformations/gcp/compliance-premium | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./transformations/gcp/compliance-premium | ||
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/gcp/compliance-premium/requirements.txt" | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Setup CloudQuery | ||
uses: cloudquery/setup-cloudquery@v3 | ||
with: | ||
version: v4.0.0 | ||
- name: Migrate DB | ||
run: cloudquery migrate tests/spec.yml | ||
env: | ||
CQ_DSN: postgresql://postgres:pass@localhost:5432/postgres | ||
- name: DBT dependencies | ||
run: | | ||
dbt deps --target dev-pg --profiles-dir ./tests | ||
- name: Run Policies | ||
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
"addon_type": "transformation", | ||
"addon_format": "zip", | ||
"message": "@./changelog.md", | ||
"doc": "./README-free.md", | ||
"doc": "./README.md", | ||
"path": "./build/gcp_compliance_free.zip", | ||
"plugin_deps": ["cloudquery/source/[email protected]"], | ||
"addon_deps": [] | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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: gcp | ||
path: cloudquery/gcp | ||
version: "v10.0.0" # latest version of source gcp 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,4 @@ | ||
|
||
target/ | ||
dbt_packages/ | ||
logs/ |
File renamed without changes.
File renamed without changes.
Empty file.
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,40 @@ | ||
|
||
# Name your project! Project names should contain only lowercase characters | ||
# and underscores. A good package name should reflect your organization's | ||
# name or the intended use of these models | ||
name: 'gcp_compliance' | ||
version: '1.0.0' | ||
config-version: 2 | ||
|
||
# This setting configures which "profile" dbt uses for this project. | ||
profile: 'gcp_compliance' | ||
|
||
# These configurations specify where dbt should look for different types of files. | ||
# The `model-paths` config, for example, states that models in this project can be | ||
# found in the "models/" directory. You probably won't need to change these! | ||
model-paths: ["models", "../models"] | ||
analysis-paths: ["analyses"] | ||
test-paths: ["tests"] | ||
seed-paths: ["seeds"] | ||
macro-paths: ["macros", "../macros"] | ||
snapshot-paths: ["snapshots"] | ||
|
||
clean-targets: # directories to be removed by `dbt clean` | ||
- "target" | ||
- "dbt_packages" | ||
|
||
# Configuring models | ||
# Full documentation: https://docs.getdbt.com/docs/configuring-models | ||
|
||
# In this example config, we tell dbt to build all models in the example/ | ||
# directory as views. These settings can be overridden in the individual model | ||
# files using the `{{ config(...) }}` macro. | ||
models: | ||
gcp_compliance: | ||
# Config indicated by + and applies to all files under models/example/ | ||
# example: | ||
# +materialized: view | ||
|
||
|
||
|
||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
"addon_type": "transformation", | ||
"addon_format": "zip", | ||
"message": "@./changelog.md", | ||
"doc": "./README-premium.md", | ||
"doc": "./README.md", | ||
"path": "./build/gcp_compliance_premium.zip", | ||
"plugin_deps": ["cloudquery/source/[email protected]"], | ||
"addon_deps": [] | ||
|
File renamed without changes.
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 |
Empty file.
Empty file.
Empty file.
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,23 @@ | ||
gcp_compliance: # This should match the name in your dbt_project.yml | ||
target: dev | ||
outputs: | ||
dev-snowflake: | ||
type: snowflake | ||
account: "{{ env_var('SNOW_ACCOUNT') }}" | ||
|
||
# User/password auth | ||
user: "{{ env_var('SNOW_USER') }}" | ||
password: "{{ env_var('SNOW_PASSWORD') }}" | ||
|
||
database: "{{ env_var('SNOW_DATABASE') }}" | ||
warehouse: "{{ env_var('SNOW_WAREHOUSE') }}" | ||
schema: "{{ env_var('SNOW_SCHEMA') }}" | ||
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 |
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: gcp | ||
path: cloudquery/gcp | ||
version: "v10.0.0" # latest version of source gcp 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} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.