Skip to content

fix returned security options for opensearch domain #8084

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 2 additions & 3 deletions localstack-core/localstack/services/opensearch/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,8 @@ def get_domain_status(domain_key: DomainKey, deleted=False) -> DomainStatus:
),
DomainEndpointOptions=stored_status.get("DomainEndpointOptions")
or DEFAULT_OPENSEARCH_DOMAIN_ENDPOINT_OPTIONS,
AdvancedSecurityOptions=AdvancedSecurityOptions(
Enabled=False, InternalUserDatabaseEnabled=False
),
AdvancedSecurityOptions=stored_status.get("AdvancedSecurityOptions")
or AdvancedSecurityOptions(Enabled=False, InternalUserDatabaseEnabled=False),
AutoTuneOptions=AutoTuneOptionsOutput(State=AutoTuneState.ENABLE_IN_PROGRESS),
)
return new_status
Expand Down
17 changes: 17 additions & 0 deletions tests/aws/services/opensearch/test_opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,23 @@ def test_cloudformation_deployment(self, deploy_cfn_template, aws_client):
domain_names = [domain["DomainName"] for domain in response["DomainNames"]]
assert domain_name in domain_names

# TODO: You must enable node-to-node encryption to use advanced security options.
@markers.aws.needs_fixing
def test_advanced_security_options(self, opensearch_create_domain, aws_client, snapshot):
advanced_security_options = AdvancedSecurityOptionsInput(
Enabled=True,
InternalUserDatabaseEnabled=True,
MasterUserOptions=MasterUserOptions(
MasterUserName="master-user",
MasterUserPassword="12345678Aa!",
),
)
domain_name = opensearch_create_domain(
EngineVersion="OpenSearch_2.3", AdvancedSecurityOptions=advanced_security_options
)
describe_domain = aws_client.opensearch.describe_domain(DomainName=domain_name)
assert describe_domain["DomainStatus"]["AdvancedSecurityOptions"]["Enabled"] is True


@markers.skip_offline
class TestEdgeProxiedOpensearchCluster:
Expand Down
Loading