|
399 | 399 | }, |
400 | 400 | { |
401 | 401 | "cell_type": "markdown", |
| 402 | + "metadata": {}, |
402 | 403 | "source": [ |
403 | 404 | "# Connecting to a Redshift Serverless Endpoint\n", |
404 | 405 | "\n", |
|
407 | 408 | "### Using Database credentials (Native authentication)\n", |
408 | 409 | "\n", |
409 | 410 | "Provide the Redshift Serverless Endpoint to the `host` parameter of `redshift_connector.connect()`." |
410 | | - ], |
411 | | - "metadata": { |
412 | | - "collapsed": false |
413 | | - } |
| 411 | + ] |
414 | 412 | }, |
415 | 413 | { |
416 | 414 | "cell_type": "code", |
417 | 415 | "execution_count": null, |
| 416 | + "metadata": {}, |
418 | 417 | "outputs": [], |
419 | 418 | "source": [ |
420 | 419 | "import redshift_connector\n", |
|
426 | 425 | " # port value of 5439 is specified by default\n", |
427 | 426 | ") as conn:\n", |
428 | 427 | " pass" |
429 | | - ], |
430 | | - "metadata": { |
431 | | - "collapsed": false |
432 | | - } |
| 428 | + ] |
433 | 429 | }, |
434 | 430 | { |
435 | 431 | "cell_type": "markdown", |
| 432 | + "metadata": {}, |
436 | 433 | "source": [ |
437 | 434 | "### Using IAM or Identity Provider (IdP) Plugins\n", |
438 | 435 | "\n", |
439 | 436 | "Provide the Redshift Serverless Endpoint to the `host` parameter of `redshift_connector.connect()` along with the necessary connection parameter." |
440 | | - ], |
441 | | - "metadata": { |
442 | | - "collapsed": false |
443 | | - } |
| 437 | + ] |
444 | 438 | }, |
445 | 439 | { |
446 | 440 | "cell_type": "code", |
447 | 441 | "execution_count": null, |
| 442 | + "metadata": {}, |
448 | 443 | "outputs": [], |
449 | 444 | "source": [ |
450 | 445 | "import redshift_connector\n", |
|
459 | 454 | " region='us-east-2'\n", |
460 | 455 | " ) as conn:\n", |
461 | 456 | " pass\n" |
462 | | - ], |
463 | | - "metadata": { |
464 | | - "collapsed": false |
465 | | - } |
| 457 | + ] |
| 458 | + }, |
| 459 | + { |
| 460 | + "cell_type": "markdown", |
| 461 | + "metadata": {}, |
| 462 | + "source": [ |
| 463 | + "# Connecting using Azure Native Identity Provider Plugin (IdP)\n", |
| 464 | + "\n", |
| 465 | + "To establish a connection to Redshift using Native Azure AD, the following connection parameters may be used." |
| 466 | + ] |
| 467 | + }, |
| 468 | + { |
| 469 | + "cell_type": "code", |
| 470 | + "execution_count": null, |
| 471 | + "metadata": {}, |
| 472 | + "outputs": [], |
| 473 | + "source": [ |
| 474 | + "import redshift_connector\n", |
| 475 | + "\n", |
| 476 | + "with redshift_connector.connect(\n", |
| 477 | + " iam=True,\n", |
| 478 | + " credentials_provider='BrowserAzureOAuth2CredentialsProvider',\n", |
| 479 | + " host='test-cluster.abcdefghijkl.us-east-1.redshift.amazonaws.com',\n", |
| 480 | + " scope='api://123456-7891-j3jk3-9dd2-c423434f0037/jdbc_login',\n", |
| 481 | + " idp_tenant='e42343b2-1234-5678-8768-5db01232131d72',\n", |
| 482 | + " cluster_identifier='test-cluster',\n", |
| 483 | + " region='us-east-1',\n", |
| 484 | + " listen_port=7890,\n", |
| 485 | + " idp_response_timeout=50,\n", |
| 486 | + " client_id='343432-492d-j3jk3-9dd2-c423434f0037',\n", |
| 487 | + " database='dev',\n", |
| 488 | + " ssl=True,\n", |
| 489 | + " sslmode='verify-ca',\n", |
| 490 | + " #ssl_insecure=False\n", |
| 491 | + " # port value of 5439 is specified by default\n", |
| 492 | + ") as conn:\n", |
| 493 | + " pass" |
| 494 | + ] |
466 | 495 | } |
467 | 496 | ], |
468 | 497 | "metadata": { |
469 | 498 | "kernelspec": { |
470 | | - "display_name": "Python 3", |
| 499 | + "display_name": "Python 3 (ipykernel)", |
471 | 500 | "language": "python", |
472 | 501 | "name": "python3" |
473 | 502 | }, |
|
481 | 510 | "name": "python", |
482 | 511 | "nbconvert_exporter": "python", |
483 | 512 | "pygments_lexer": "ipython3", |
484 | | - "version": "3.9.6" |
| 513 | + "version": "3.9.0" |
485 | 514 | } |
486 | 515 | }, |
487 | 516 | "nbformat": 4, |
|
0 commit comments