|
14 | 14 |
|
15 | 15 | from __future__ import annotations |
16 | 16 |
|
17 | | -from typing import TYPE_CHECKING, Dict, Optional, Tuple, Union |
| 17 | +from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union |
18 | 18 |
|
19 | 19 | if TYPE_CHECKING: |
20 | 20 | from aws_advanced_python_wrapper.pep249 import Connection |
21 | 21 |
|
22 | | -import psycopg # type: ignore |
| 22 | +import psycopg # type: ignore |
23 | 23 |
|
24 | 24 | from aws_advanced_python_wrapper import AwsWrapperConnection |
25 | 25 | from aws_advanced_python_wrapper.errors import ( |
26 | 26 | FailoverFailedError, FailoverSuccessError, |
27 | 27 | TransactionResolutionUnknownError) |
28 | | -from aws_advanced_python_wrapper.host_monitoring_plugin import MonitoringThreadContainer |
| 28 | + |
29 | 29 |
|
30 | 30 | def configure_initial_session_states(conn: Connection): |
31 | 31 | awscursor = conn.cursor() |
@@ -61,15 +61,15 @@ def execute_queries_with_failover_handling(conn: Connection, sql: str, params: O |
61 | 61 |
|
62 | 62 |
|
63 | 63 | if __name__ == "__main__": |
64 | | - params = { |
| 64 | + params: Any = { |
65 | 65 | "host": "rds-proxy-name.proxy-xyz.us-east-1.rds.amazonaws.com", |
66 | 66 | "dbname": "postgres", |
67 | 67 | "user": "john", |
68 | 68 | "password": "pwd", |
69 | 69 | "plugins": "srw,failover", |
70 | | - "srw_write_endpoint": "rds-proxy-name.proxy-xyz.us-east-1.rds.amazonaws.com", # Replace with write endpoint |
71 | | - "srw_read_endpoint": "rds-proxy-name-read-only.endpoint.proxy-xyz.us-east-1.rds.amazonaws.com", # Replace with read endpoint |
72 | | - "srw_verify_new_connections": "True", # Enables role-verification for new endpoints |
| 70 | + "srw_write_endpoint": "rds-proxy-name.proxy-xyz.us-east-1.rds.amazonaws.com", |
| 71 | + "srw_read_endpoint": "rds-proxy-name-read-only.endpoint.proxy-xyz.us-east-1.rds.amazonaws.com", |
| 72 | + "srw_verify_new_connections": "True", |
73 | 73 | "wrapper_dialect": "aurora-pg", |
74 | 74 | "autocommit": True, |
75 | 75 | } |
|
0 commit comments