berachain-models/macros/admin/run_streamline_dev_api_integration_permissions.sql
2025-01-04 22:10:50 -08:00

23 lines
837 B
SQL

{% macro run_streamline_dev_api_integration_permissions(project_name) %}
--This will run after api integration is created
{% set sql %}
use role accountadmin;
use warehouse dbt;
--Grant usage on api integration
grant usage on integration aws_{{ project_name }}_api_stg_v2 to role dbt_cloud_{{ project_name }};
grant usage on integration aws_{{ project_name }}_api_stg_v2 to role aws_lambda_{{ project_name }}_api;
grant usage on integration aws_{{ project_name }}_api_stg_v2 to role internal_dev;
--Grant usage on stage
grant usage on stage streamline.bronze.{{ project_name }}_serverless_stg to role internal_dev;
{% endset %}
{% do log(sql, info=true)%}
{% do run_query(sql) %}
{% do log("Streamline DEV API Integration Permissions for " ~ project_name ~ " successfully ran", true) %}
{% endmacro %}