You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error in OpenSearchIndexCRProvide lambda cloudwatch logs
INIT_START Runtime Version: python:3.12.v38 Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:xxxxx
START RequestId: b7b4dc0e-27f6-4c38-9661-c530007a4015 Version: $LATEST
[WARNING] 2025-01-14T16:55:10.881Z b7b4dc0e-27f6-4c38-9661-c530007a4015 PUT https://xxxxxx.us-east-1.aoss.amazonaws.com:443/bedrock-knowledge-base-default-index?wait_for_active_shards=all [status:403 request:0.075s]
[ERROR] 2025-01-14T16:55:10.881Z b7b4dc0e-27f6-4c38-9661-c530007a4015 Error creating index bedrock-knowledge-base-default-index
[ERROR] 2025-01-14T16:55:10.882Z b7b4dc0e-27f6-4c38-9661-c530007a4015 AuthorizationException(403, 'security_exception', 'OpenSearch exception [type=authorization_exception, reason=User does not have permissions for the requested resource]')
Traceback (most recent call last):
File "/var/task/custom_resources/opensearch_index.py", line 218, in handle_create
create_index(client, index_name, mapping, setting)
File "/var/task/custom_resources/opensearch_index.py", line 186, in create_index
client.indices.create(
File "/var/task/opensearchpy/client/utils.py", line 176, in _wrapped
return func(*args, params=params, headers=headers, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/task/opensearchpy/client/indices.py", line 244, in create
return self.transport.perform_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/task/opensearchpy/transport.py", line 457, in perform_request
raise e
File "/var/task/opensearchpy/transport.py", line 418, in perform_request
status, headers_response, data = connection.perform_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/task/opensearchpy/connection/http_requests.py", line 238, in perform_request
self._raise_error(
File "/var/task/opensearchpy/connection/base.py", line 315, in _raise_error
raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
opensearchpy.exceptions.AuthorizationException: AuthorizationException(403, 'security_exception', 'OpenSearch exception [type=authorization_exception, reason=User does not have permissions for the requested resource]')
Reproduction Steps
Create a knowledge base using @cdklabs/generative-ai-cdk-constructs
import{bedrockascdkLabsBedrock}from'@cdklabs/generative-ai-cdk-constructs';constmaintenanceKnowledgeBase=newcdkLabsBedrock.KnowledgeBase(scope,`MaintenanceKB`,{embeddingsModel: cdkLabsBedrock.BedrockFoundationModel.TITAN_EMBED_TEXT_V2_1024,instruction: `You are a helpful question answering assistant. You answer user questions factually and honestly related to industrial facility maintenance and operations`,description: 'Maintenance Knowledge Base',});
Delete the stack
Possible Solution
The aoss SecurityPolicy deletes successfully before the custom resource fails. Maybe putting a dependency so that the custom resource will delete before the SecurityPolicy will allow the custom resource to delete successfully? You could also just ignore this error on deletion.
Describe the bug
When you delete a bedrock knowledge base backed by an AOSS cluster, the delete fails. with an authorization exception.
Expected Behavior
The cloudformation stack should delete successfully
Current Behavior
Deleting the stack currently causes the errors below:
Error in cloudformatino during stack deletion:
Error in OpenSearchIndexCRProvide lambda cloudwatch logs
Reproduction Steps
Possible Solution
The aoss SecurityPolicy deletes successfully before the custom resource fails. Maybe putting a dependency so that the custom resource will delete before the SecurityPolicy will allow the custom resource to delete successfully? You could also just ignore this error on deletion.
Additional Information/Context
No response
CDK CLI Version
2.173.1 (build 4eac959)
Framework Version
@cdklabs/[email protected]
Node.js Version
v20.18.1
OS
Mac
Language
Typescript
Language Version
TypeScript (5.5.3)
Region experiencing the issue
us-east-1
Code modification
No
Other information
No response
Service quota
The text was updated successfully, but these errors were encountered: