mirror of
https://github.com/FlipsideCrypto/berachain-models.git
synced 2026-02-06 11:16:47 +00:00
20 lines
688 B
SQL
20 lines
688 B
SQL
{% macro create_api_integration(project_name, snowflake_role_arn, endpoint_urls) %}
|
|
|
|
{% set allowed_prefixes = [] %}
|
|
{% for url in endpoint_urls %}
|
|
{% do allowed_prefixes.append("'" ~ url ~ "'") %}
|
|
{% endfor %}
|
|
{% set allowed_prefixes = allowed_prefixes|join(", ") %}
|
|
{% set sql %}
|
|
CREATE OR REPLACE API INTEGRATION {{ project_name ~ "_v2" }}
|
|
API_PROVIDER = aws_api_gateway
|
|
API_AWS_ROLE_ARN = '{{ snowflake_role_arn }}'
|
|
API_ALLOWED_PREFIXES = ({{ allowed_prefixes }})
|
|
ENABLED=true
|
|
{% endset %}
|
|
|
|
{% do log(sql, info=true)%}
|
|
|
|
{% do run_query(sql) %}
|
|
{% do log("API Integration " ~ integration_name ~ " successfully created", true) %}
|
|
{% endmacro %} |