Skip to content

Commit 97d60cb

Browse files
authored
Fix(redshift): add missing db_user parameter for IAM auth (#5687)
Signed-off-by: Bram Deenik <2051506+synthpieter@users.noreply.github.com>
1 parent 417573f commit 97d60cb

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

docs/integrations/engines/redshift.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pip install "sqlmesh[redshift]"
2929
| `region` | The AWS region of the Amazon Redshift cluster | string | N |
3030
| `cluster_identifier` | The cluster identifier of the Amazon Redshift cluster | string | N |
3131
| `iam` | If IAM authentication is enabled. IAM must be True when authenticating using an IdP | dict | N |
32+
| `db_user` | The database user to authenticate as. Required when using IAM authentication | string | N |
3233
| `is_serverless` | If the Amazon Redshift cluster is serverless (Default: `False`) | bool | N |
3334
| `serverless_acct_id` | The account ID of the serverless cluster | string | N |
3435
| `serverless_work_group` | The name of work group for serverless end point | string | N |

sqlmesh/core/config/connection.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,7 @@ class RedshiftConnectionConfig(ConnectionConfig):
13351335
region: The AWS region where the Amazon Redshift cluster is located.
13361336
cluster_identifier: The cluster identifier of the Amazon Redshift cluster.
13371337
iam: If IAM authentication is enabled. Default value is False. IAM must be True when authenticating using an IdP.
1338+
db_user: The database user to authenticate as. Required when using IAM authentication.
13381339
is_serverless: Redshift end-point is serverless or provisional. Default value false.
13391340
serverless_acct_id: The account ID of the serverless. Default value None
13401341
serverless_work_group: The name of work group for serverless end point. Default value None.
@@ -1360,6 +1361,7 @@ class RedshiftConnectionConfig(ConnectionConfig):
13601361
region: t.Optional[str] = None
13611362
cluster_identifier: t.Optional[str] = None
13621363
iam: t.Optional[bool] = None
1364+
db_user: t.Optional[str] = None
13631365
is_serverless: t.Optional[bool] = None
13641366
serverless_acct_id: t.Optional[str] = None
13651367
serverless_work_group: t.Optional[str] = None
@@ -1397,6 +1399,7 @@ def _connection_kwargs_keys(self) -> t.Set[str]:
13971399
"region",
13981400
"cluster_identifier",
13991401
"iam",
1402+
"db_user",
14001403
"is_serverless",
14011404
"serverless_acct_id",
14021405
"serverless_work_group",

tests/cli/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ def test_init_dbt_template(runner: CliRunner, tmp_path: Path):
19541954
@time_machine.travel(FREEZE_TIME)
19551955
def test_init_project_engine_configs(tmp_path):
19561956
engine_type_to_config = {
1957-
"redshift": "# concurrent_tasks: 4\n # register_comments: True\n # pre_ping: False\n # pretty_sql: False\n # schema_differ_overrides: \n # catalog_type_overrides: \n # user: \n # password: \n # database: \n # host: \n # port: \n # source_address: \n # unix_sock: \n # ssl: \n # sslmode: \n # timeout: \n # tcp_keepalive: \n # application_name: \n # preferred_role: \n # principal_arn: \n # credentials_provider: \n # region: \n # cluster_identifier: \n # iam: \n # is_serverless: \n # serverless_acct_id: \n # serverless_work_group: \n # enable_merge: ",
1957+
"redshift": "# concurrent_tasks: 4\n # register_comments: True\n # pre_ping: False\n # pretty_sql: False\n # schema_differ_overrides: \n # catalog_type_overrides: \n # user: \n # password: \n # database: \n # host: \n # port: \n # source_address: \n # unix_sock: \n # ssl: \n # sslmode: \n # timeout: \n # tcp_keepalive: \n # application_name: \n # preferred_role: \n # principal_arn: \n # credentials_provider: \n # region: \n # cluster_identifier: \n # iam: \n # db_user: \n # is_serverless: \n # serverless_acct_id: \n # serverless_work_group: \n # enable_merge: ",
19581958
"bigquery": "# concurrent_tasks: 1\n # register_comments: True\n # pre_ping: False\n # pretty_sql: False\n # schema_differ_overrides: \n # catalog_type_overrides: \n # method: oauth\n # project: \n # execution_project: \n # quota_project: \n # location: \n # keyfile: \n # keyfile_json: \n # token: \n # refresh_token: \n # client_id: \n # client_secret: \n # token_uri: \n # scopes: \n # impersonated_service_account: \n # job_creation_timeout_seconds: \n # job_execution_timeout_seconds: \n # job_retries: 1\n # job_retry_deadline_seconds: \n # priority: \n # maximum_bytes_billed: \n # reservation: ",
19591959
"snowflake": "account: \n # concurrent_tasks: 4\n # register_comments: True\n # pre_ping: False\n # pretty_sql: False\n # schema_differ_overrides: \n # catalog_type_overrides: \n # user: \n # password: \n # warehouse: \n # database: \n # role: \n # authenticator: \n # token: \n # host: \n # port: \n # application: Tobiko_SQLMesh\n # private_key: \n # private_key_path: \n # private_key_passphrase: \n # session_parameters: ",
19601960
"databricks": "# concurrent_tasks: 1\n # register_comments: True\n # pre_ping: False\n # pretty_sql: False\n # schema_differ_overrides: \n # catalog_type_overrides: \n # server_hostname: \n # http_path: \n # access_token: \n # auth_type: \n # oauth_client_id: \n # oauth_client_secret: \n # catalog: \n # http_headers: \n # session_configuration: \n # databricks_connect_server_hostname: \n # databricks_connect_access_token: \n # databricks_connect_cluster_id: \n # databricks_connect_use_serverless: False\n # force_databricks_connect: False\n # disable_databricks_connect: False\n # disable_spark_session: False",

0 commit comments

Comments
 (0)