Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Redshift to prefer SSL in generate as well #4849

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ The types of changes are:
### Added
- Added multiple language translations support for privacy center consent page [#4785](https://github.com/ethyca/fides/pull/4785)

### Changed
- Sets `sslmode` to prefer for Redshift connections when generating datasets [#4849](https://github.com/ethyca/fides/pull/4849)

## [2.35.0](https://github.com/ethyca/fides/compare/2.34.0...2.35.0)

### Added
Expand Down
8 changes: 6 additions & 2 deletions src/fides/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from os import getenv
from os.path import isfile
from pathlib import Path
from typing import Dict, Iterator, List
from typing import Any, Dict, Iterator, List

import sqlalchemy
import toml
Expand Down Expand Up @@ -36,7 +36,11 @@ def get_db_engine(connection_string: str) -> Engine:
"""

# Pymssql doesn't support this arg
connect_args = {"connect_timeout": 10} if "pymssql" not in connection_string else {}
connect_args: Dict[str, Any] = (
{"connect_timeout": 10} if "pymssql" not in connection_string else {}
)
if "redshift" in connection_string:
connect_args["sslmode"] = "prefer"
try:
engine = sqlalchemy.create_engine(connection_string, connect_args=connect_args)
except Exception as err:
Expand Down
Loading