Skip to content

fix the tutorial in AIConnectorHelper when fetching domain_url #3852

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
15 changes: 14 additions & 1 deletion docs/tutorials/aws/AIConnectorHelper.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,22 @@
" domain_info = response['DomainStatus']\n",
"\n",
" # Extract the domain URL and ARN\n",
" domain_url = domain_info['Endpoint']\n",
" domain_arn = domain_info['ARN']\n",
"\n",
" # Check if domain has VPC endpoints\n",
" if 'Endpoints' in domain_info:\n",
" # VPC domain case\n",
" if 'vpc' in domain_info['Endpoints']:\n",
" domain_url = domain_info['Endpoints']['vpc']\n",
" else:\n",
" domain_url = next(iter(domain_info['Endpoints'].values()))\n",
" # Non-VPC domain case\n",
" elif 'Endpoint' in domain_info:\n",
" domain_url = domain_info['Endpoint']\n",
" else:\n",
" print(f\"No endpoint found for domain '{domain_name}'\")\n",
" return None, None\n",
"\n",
" return f'https://{domain_url}', domain_arn\n",
"\n",
" except opensearch_client.exceptions.ResourceNotFoundException:\n",
Expand Down
Loading