mirror of
https://github.com/FlipsideCrypto/aleo-models.git
synced 2026-02-06 13:26:47 +00:00
prod api integration
This commit is contained in:
parent
6aad0ff961
commit
404893008f
@ -97,15 +97,15 @@ vars:
|
||||
- INTERNAL_DEV
|
||||
|
||||
prod:
|
||||
API_INTEGRATION: aws_aleo_api
|
||||
EXTERNAL_FUNCTION_URI: vnmhcb1q2j.execute-api.us-east-1.amazonaws.com/prod/
|
||||
API_INTEGRATION: aws_aleo_api_prod_v2
|
||||
EXTERNAL_FUNCTION_URI: onyzmq60n9.execute-api.us-east-1.amazonaws.com/prod/
|
||||
ROLES:
|
||||
- AWS_LAMBDA_ALEO_API
|
||||
- INTERNAL_DEV
|
||||
- DBT_CLOUD_ALEO
|
||||
prod-2xl:
|
||||
API_INTEGRATION: aws_aleo_api
|
||||
EXTERNAL_FUNCTION_URI: vnmhcb1q2j.execute-api.us-east-1.amazonaws.com/prod/
|
||||
API_INTEGRATION: aws_aleo_api_prod_v2
|
||||
EXTERNAL_FUNCTION_URI: onyzmq60n9.execute-api.us-east-1.amazonaws.com/prod/
|
||||
ROLES:
|
||||
- AWS_LAMBDA_ALEO_API
|
||||
- INTERNAL_DEV
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
{% macro create_sps() %}
|
||||
{% if target.database == 'aleo' %}
|
||||
{% if target.database == 'ALEO' %}
|
||||
CREATE SCHEMA IF NOT EXISTS _internal;
|
||||
{{ sp_create_prod_clone('_internal') }};
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro enable_search_optimization(schema_name, table_name, condition = '') %}
|
||||
{% if target.database == 'aleo' %}
|
||||
{% if target.database == 'ALEO' %}
|
||||
ALTER TABLE {{ schema_name }}.{{ table_name }} ADD SEARCH OPTIMIZATION {{ condition }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
@ -1,2 +1,8 @@
|
||||
{% macro create_udfs() %}
|
||||
{% if var("UPDATE_UDFS_AND_SPS") %}
|
||||
{% set sql %}
|
||||
{{ create_udf_bulk_rest_api_v2() }};
|
||||
{% endset %}
|
||||
{% do run_query(sql) %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
{% macro create_aws_aleo_api() %}
|
||||
{{ log(
|
||||
"Creating integration for target:" ~ target
|
||||
) }}
|
||||
|
||||
{% if target.name == "prod" %} -- TODO WHEN PROD DEPLOYS
|
||||
{% set sql %}
|
||||
CREATE api integration IF NOT EXISTS aws_aleo_api_prod_v2 api_provider = aws_api_gateway api_aws_role_arn = 'arn:aws:iam::704693948482:role/aleo-api-stg-rolesnowflakeudfsAF733095-JHFljSYqZXeT' api_allowed_prefixes = (
|
||||
'https://gvmfebiq6g.execute-api.us-east-1.amazonaws.com/stg/'
|
||||
) enabled = TRUE;
|
||||
{% endset %}
|
||||
{% do run_query(sql) %}
|
||||
{% else %}
|
||||
{% set sql %}
|
||||
CREATE api integration IF NOT EXISTS aws_aleo_api_stg_v2 api_provider = aws_api_gateway api_aws_role_arn = 'arn:aws:iam::704693948482:role/aleo-api-stg-rolesnowflakeudfsAF733095-JHFljSYqZXeT' api_allowed_prefixes = (
|
||||
'https://gvmfebiq6g.execute-api.us-east-1.amazonaws.com/stg/'
|
||||
) enabled = TRUE;
|
||||
{% endset %}
|
||||
{% do run_query(sql) %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
@ -3,7 +3,7 @@
|
||||
OR REPLACE EXTERNAL FUNCTION streamline.udf_bulk_rest_api_v2(
|
||||
json OBJECT
|
||||
) returns ARRAY api_integration = {% if target.name == "prod" %}
|
||||
aws_aleo_api_prod_v2 AS 'https://gvmfebiq6g.execute-api.us-east-1.amazonaws.com/stg/udf_bulk_rest_api' -- CHANGE TO PROD URL WHEN DEPLOYED
|
||||
aws_aleo_api_prod_v2 AS 'https://onyzmq60n9.execute-api.us-east-1.amazonaws.com/prod/udf_bulk_rest_api'
|
||||
{% else %}
|
||||
aws_aleo_api_stg_v2 AS 'https://gvmfebiq6g.execute-api.us-east-1.amazonaws.com/stg/udf_bulk_rest_api'
|
||||
{%- endif %};
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
func = 'streamline.udf_bulk_rest_api_v2',
|
||||
target = "{{this.schema}}.{{this.identifier}}",
|
||||
params ={ "external_table" :"blocks",
|
||||
"sql_limit" :"3000",
|
||||
"producer_batch_size" :"100",
|
||||
"worker_batch_size" :"100",
|
||||
"sql_limit" :"20000",
|
||||
"producer_batch_size" :"5000",
|
||||
"worker_batch_size" :"1000",
|
||||
"sql_source" :"{{this.identifier}}",
|
||||
"order_by_column": "block_number",}
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user