Skip to content

test(e2e): encrypt @searchable test domains - #15015

Open
sarayev wants to merge 1 commit into
devfrom
fix/e2e-searchable-encryption
Open

sarayev wants to merge 1 commit into
devfrom
fix/e2e-searchable-encryption

Conversation

@sarayev

@sarayev sarayev commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Description of changes

E2E tests that use @searchable now create search domains with node-to-node encryption and encryption at rest turned on. Test code only.

How the tests worked before

  • api_6c and searchable-datastore already used overrides/override-api-gql-searchable.ts, but it only set HTTPS and the TLS policy. Node-to-node encryption stayed off (the CLI default for new domains), there was no encryption at rest, and the default instance type (t2.small.elasticsearch) does not support it.
  • schema-searchable (searchable-usage) used the v1 transformer, which has no encryption settings.

What changes

  • overrides/override-api-gql-searchable.ts: also turns on node-to-node encryption and encryption at rest, and sets ElasticsearchClusterConfig.InstanceType to m5.large.elasticsearch. Applies to api_6c and searchable-datastore.
  • searchable-usage (schema-searchable) moves from the v1 to the v2 transformer and uses the same override. The override is v2-only, so this is the only way to encrypt its domain. The schema gets @auth(rules: [{ allow: public }]), because on v2 a model without auth rules is not reachable with the API key the test uses (the test replaces the whole schema, so the default global auth rule is gone). Queries and expected results are unchanged.

Why it is okay to change

  • The override keeps the HTTPS and TLS settings it had, so api_6c and searchable-datastore still test the same behavior.
  • v1 @searchable stays covered: searchable-migration still pushes a v1 project and queries it before migrating to v2.
  • m5.large.elasticsearch is the instance type the amplify-category-api transformer e2e tests use.

Not changed

  • searchable-migration must deploy a v1 domain first (that is what it tests), and v1 has no encryption settings. Its v2 domain does not use the override either.

Description of how you validated changes

  • tsc passes for amplify-e2e-tests and the override file.
  • Split e2e on 8382e053a: Linux 160/160 and Windows 134/134 passed, including api_6c, searchable-datastore, schema-searchable and searchable-migration on both.
  • cloud-pr (AmplifyCLI-PR-Testing): passed.

Checklist

  • PR description included
  • Tests are changed or added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The shared searchable override now turns on node-to-node encryption and encryption at rest and uses m5.large.elasticsearch, since t2.small does not support encryption at rest. searchable-usage moves to the v2 transformer and uses the same override.
@sarayev
sarayev marked this pull request as ready for review December 1, 2026 08:43
@sarayev
sarayev requested a review from a team as a code owner December 1, 2026 08:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant