Feat/opensearch migration#2927
Open
Dreamstick9 wants to merge 3 commits into
Open
Conversation
- Switch boto3 client from 'es' to 'opensearch'
- Use describe_domains() instead of deprecated describe_elasticsearch_domains()
- Update test fixtures with OpenSearch versions and instance types
Signed-off-by: Kushagar Garg <dreamstick909@gmail.com>
- Use EngineVersion || ElasticsearchVersion for version field
- Use ClusterConfig || ElasticsearchClusterConfig for cluster config
- Update test fixtures to use real opensearch client field names
- Maintains backwards compatibility with es client responses
Signed-off-by: Kushagar Garg <dreamstick909@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Summary
Switches the AWS OpenSearch/Elasticsearch intel module from the deprecated
esboto3 client to theopensearchclient.What changed:
create_boto3_clientnow uses"opensearch"instead of"es"client.describe_elasticsearch_domains()replaced withclient.describe_domains()(equivalent OpenSearch API)_transform_es_domainsnow readsEngineVersionandClusterConfig(OpenSearch API field names) with fallbacks toElasticsearchVersionandElasticsearchClusterConfigfor backward compatibility with any data returned by the legacyesclientWhy: AWS renamed Elasticsearch Service to OpenSearch Service and the
esboto3 client is deprecated in favor of theopensearchclient. No changes to the graph schema — theESDomainnode and all its properties and relationships are unchanged.Related issues or links
How was this tested?
tests/integration/cartography/intel/aws/test_elasticsearch.pytests/data/aws/elasticsearch.pyupdated to use the realopensearchclient field names (EngineVersion,ClusterConfig) so the tests validate the actual code path rather than the legacy field namesChecklist
General
make test_lint).Proof of functionality
If you are adding or modifying a synced entity
If you are changing a node or relationship
N/A — no node or relationship schema changes.
If you are implementing a new intel module
N/A
Notes for reviewers
The
_transform_es_domainsfunction retains fallback reads for the legacyElasticsearchVersionandElasticsearchClusterConfigfield names. This is intentional: it keeps the transform function safe if it ever receives data from the oldesclient path (e.g. in tests or future callers), and documents the API difference inline. All other field names (EBSOptions,EncryptionAtRestOptions,LogPublishingOptions,VPCOptions,DomainId,ARN, etc.) are identical between the two clients and required no changes.