Skip to content
Merged
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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So for VPC endpoints there are multiple endpoints? Trying to understand the Endpoints objects. What else does this contain?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returned a Map including 'vpc':'vpc-endpoint-h2dsd34efgyghrtguk5gt6j2foh4.us-east-1.es.amazonaws.com'.

" 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