polygon-models/macros/streamline/api_integrations.sql
Ryan-Loofy fc211f5fbd
Polygon Overhaul (#233)
* Polygon Overhaul

- Update DBT models to match streamline optimizations
- Standardization
- Added more recent DBT optimizations

* Add livequery infra

* Add PROD integration
2023-10-18 13:13:59 -04:00

22 lines
1006 B
SQL

{% macro create_aws_polygon_api() %}
{{ log(
"Creating integration for target:" ~ target
) }}
{% if target.name == "prod" %}
{% set sql %}
CREATE api integration IF NOT EXISTS aws_polygon_api api_provider = aws_api_gateway api_aws_role_arn = 'arn:aws:iam::490041342817:role/polygon-api-prod-rolesnowflakeudfsAF733095-9hTxS6yYCWlj' api_allowed_prefixes = (
'https://p6dhi5vxn4.execute-api.us-east-1.amazonaws.com/prod/'
) enabled = TRUE;
{% endset %}
{% do run_query(sql) %}
{% elif target.name == "dev" %}
{% set sql %}
CREATE api integration IF NOT EXISTS aws_polygon_api_dev api_provider = aws_api_gateway api_aws_role_arn = 'arn:aws:iam::490041342817:role/polygon-api-dev-rolesnowflakeudfsAF733095-10H2D361D3DJD' api_allowed_prefixes = (
'https://rzyjrd54s6.execute-api.us-east-1.amazonaws.com/dev/'
) enabled = TRUE;
{% endset %}
{% do run_query(sql) %}
{% endif %}
{% endmacro %}