test(cli): local AWS e2e harness + fail-fast validation guards - #18
Closed
kylehounslow wants to merge 1 commit into
Closed
test(cli): local AWS e2e harness + fail-fast validation guards#18kylehounslow wants to merge 1 commit into
kylehounslow wants to merge 1 commit into
Conversation
kylehounslow
force-pushed
the
feat/vpc-support
branch
from
July 23, 2026 00:24
8ed0798 to
52d2a0d
Compare
kylehounslow
force-pushed
the
feat/aws-e2e-local-tests
branch
from
July 27, 2026 18:18
cf1b90c to
08d6ba4
Compare
… add e2e harness Users reported a silent failure on the VPC install: a security group with no egress rule left the demo EC2 instance unable to send anything out, so no data reached OpenSearch. The stack built clean and stayed empty, no error. Add checkSecurityGroupRules (in aws.mjs, called from executePipeline after VPC topology validation): describe the stack's security groups and warn about rules that break the data path, before the ~30-minute build. It validates existing bring-your-own groups rather than creating or modifying one, and warns without blocking (traffic may route via other groups, a NAT, or NACLs the CLI can't see). Checks intra-VPC egress 443, internet egress 443 to 0.0.0.0/0 when a demo launches, and intra-VPC ingress 443. Degrades to a single manual-verify warning when the role lacks ec2:DescribeSecurityGroups. Add a local AWS e2e harness under test/e2e/ that creates a full stack against a real account, drives telemetry through it, verifies documents land via the OpenSearch Application endpoint, and tears it down. Covers managed/serverless, public/VPC, and demo/no-demo. Not run in CI (no AWS credentials); live scenarios are opt-in and VPC scenarios skip when their env vars are unset. 41 harness unit tests run with the src suite (134 total). Signed-off-by: Kyle Hounslow <kylhouns@amazon.com>
kylehounslow
force-pushed
the
feat/aws-e2e-local-tests
branch
from
July 27, 2026 18:31
08d6ba4 to
f77b2c7
Compare
Owner
Author
|
Superseded by upstream opensearch-project#344 (same head branch). |
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.
What
Users reported a silent failure running the VPC install: a security group with no egress rule left the demo EC2 instance unable to send anything out, so no data reached OpenSearch. Nothing errored, the stack built clean and stayed empty.
This PR adds a security-group check to catch that class of failure up front, plus a local e2e test harness that reproduces and guards the full VPC data path (which is how the failure was confirmed and fixed).
Additional Note to reviewers.
There is currently no security-approved mechanism to run e2e tests on an AWS account from GitHub. These e2e tests can be run on developer AWS accounts until automation is available.
Security-group check
checkSecurityGroupRules(inaws.mjs, called fromexecutePipelineafter VPC topology validation) describes the stack's security groups and warns about rules that break the data path, before the ~30-minute build. It validates existing bring-your-own groups; it does not create or modify one. Warnings only, never blocks: traffic may route via other groups, a NAT, or NACLs the CLI can't see.Rules checked across the union of the stack's groups:
0.0.0.0/0(only with a demo): the instance bootstraps over the public internet (package install, GitHub clone, image pulls), which does not use the VPC-private endpoint. A VPC-scoped rule does not satisfy this.When the role lacks
ec2:DescribeSecurityGroups, it returns one warning listing the rules to verify by hand.Not covered: routing. A
0.0.0.0/0egress rule is useless if a private subnet has no NAT route or a public one has no IGW. The check does not inspect route tables or NACLs.E2E harness
E2E tests don't run in CI (GitHub Actions has no AWS credentials), so the VPC data path had no repeatable proof. The harness under
aws/cli-installer/test/e2e/creates a full stack against a real account, drives telemetry through it, verifies the data lands, and tears it down.scenarios.mjs: scenario matrix and a pure CLI-arg builder.verify.mjs: synthetic OTLP push and data-flow verification via the OpenSearch Application endpoint (/api/console/proxy_count).run.mjs: live runner (create, drive, verify, destroy).e2e-unit.test.mjs: 41 unit tests over the pure logic, no AWS calls.npm testruns the src unit tests plus the harness unit tests (134 total). Live scenarios are opt-in; VPC scenarios needE2E_VPC_ID/E2E_SUBNET_IDS/E2E_SECURITY_GROUP_IDSand are reportedskipped, not failed, when unset.managed-public-demomanaged-public-nodemoserverless-public-nodemomanaged-vpc-demomanaged-vpc-nodemoVerification queries through the Application endpoint, which is reachable from outside the VPC.
managed-vpc-nodemois create/destroy only because its ingest endpoint is VPC-private (RFC-1918);managed-vpc-demoproves in-VPC data flow because the demo runs in-VPC.Validation
managed-vpc-demoverified logs=965 / spans=633 / service-map=4 through the Application endpoint from outside the VPC.--skip-demo; a self-referencing group with default egress produces none.