awswrangler.db.get_redshift_temp_engine

awswrangler.db.get_redshift_temp_engine(cluster_identifier: str, user: str, database: Optional[str] = None, duration: int = 900, auto_create: bool = True, db_groups: Optional[List[str]] = None, boto3_session: Optional[boto3.session.Session] = None) → sqlalchemy.engine.base.Engine

Get Glue connection details.

Parameters
  • cluster_identifier (str) – The unique identifier of a cluster. This parameter is case sensitive.

  • user (str, optional) – The name of a database user.

  • database (str, optional) – Database name. If None, the default Database is used.

  • duration (int, optional) – The number of seconds until the returned temporary password expires. Constraint: minimum 900, maximum 3600. Default: 900

  • auto_create (bool) – Create a database user with the name specified for the user named in user if one does not exist.

  • db_groups (List[str], optinal) – A list of the names of existing database groups that the user named in DbUser will join for the current session, in addition to any group memberships for an existing user. If not specified, a new user is added only to PUBLIC.

  • boto3_session (boto3.Session(), optional) – Boto3 Session. The default boto3 session will be used if boto3_session receive None.

Returns

SQLAlchemy Engine.

Return type

sqlalchemy.engine.Engine

Examples

>>> import awswrangler as wr
>>> engine = wr.db.get_redshift_temp_engine('my_cluster', 'my_user')