I'm able to successfully connect to my Redshift cluster via my IAM role with the following from the redshift_connector package:
import redshift_connector
conn = redshift_connector.connect(
iam=True,
database='dbname',
db_user='user',
password='',
cluster_identifier='clusterID',
profile='aws_credential_profile',
region='region',
ssl=True,
ssl_insecure=True
)
However, when I try to recreate this with SQLAlchemy and run via ipython-sql I a) can't run without a user and just a dbuser and b) get authentication errors. Are there any configurations I'm missing?
url="""redshift+redshift_connector://hostname:post/dbname?ssl=true&ssl_insecure=true&iam=true®ion=region&cluster_identifier=clusterid&profile=aws_credential_profile&db_user=user"""
%sql $url