Skip to content

Feat/kinesis e2e infra#6693

Open
ekjotmultani wants to merge 27 commits intomainfrom
feat/kinesis-e2e-infra
Open

Feat/kinesis e2e infra#6693
ekjotmultani wants to merge 27 commits intomainfrom
feat/kinesis-e2e-infra

Conversation

@ekjotmultani
Copy link
Member

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ekjotmultani ekjotmultani changed the base branch from main to feat/amplify-foundation-dart-minimal February 27, 2026 20:28
@ekjotmultani ekjotmultani marked this pull request as ready for review February 27, 2026 20:32
@ekjotmultani ekjotmultani requested a review from a team as a code owner February 27, 2026 20:32
Copy link
Member

@cadivus cadivus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be integrated into infra_gen2.

Comment on lines +1 to +7
name: Kinesis E2E Tests
on:
pull_request:
paths:
- "packages/kinesis/**"
- ".github/workflows/kinesis_e2e.yaml"
workflow_dispatch:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this differ so much from all the other e2e tests that we need to implement everything custom?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this custom code is outdated sorry, but still kinesis E2E is fundamentally different, it needs OIDC + Secrets Manager for credentials rather than fetch_backends + amplify pull

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it needs OIDC + Secrets Manager for credentials rather than fetch_backends + amplify pull

But fetch_backends already uses OIDC + Secrets Manager. The only thing it does on top is run tool/pull_test_backend.sh to download amplify_outputs.dart from S3.

For the credentials, the Android PR shows the better approach:
Include auth as a category and grant Kinesis permissions to the authenticated IAM role:

// Android: aws-kinesis/infra/amplify/backend.ts
const backend = defineBackend({ auth });

backend.auth.resources.authenticatedUserIamRole.addToPrincipalPolicy(
    new PolicyStatement({
        actions: ['kinesis:PutRecord', 'kinesis:PutRecords', 'kinesis:DescribeStream'],
        resources: [stream.streamArn],
    })
);

(link)

This is exactly the same pattern the Flutter repo already uses for Analytics/Pinpoint, which also isn't a "native" Amplify category but piggybacks on auth + custom CDK resources + backend.addOutput().

Also, using some tokens in the app is not a real e2e test. This is not what customers most likely do. Using Cognito instead of some "injected" credentials is way closer to what a customer would to.
And this way, we need the amplify_outputs.dart.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that these dart only next version packages could be decoupled from the cognito pattern, but for consistency I have updated them to match the other platforms and our own packages

Comment on lines +41 to +42
- name: Install native sqlite3
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? For building on Android?

smithy_aws:
path: ../../smithy/smithy_aws
EOF

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we use the aft bootstrapping? Why this custom solution?

Comment on lines +8 to +9
AuthIntegrationTestStack,
AuthIntegrationTestStackEnvironmentProps,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these infra changes? Isn't infra unrelated to this PR?

Comment on lines +96 to +107
new secretsmanager.Secret(kinesisStack, "KinesisE2ESecret", {
secretName: "kinesis-e2e",
description: "Kinesis E2E test credentials and resource names",
secretObjectValue: {
ACCESS_KEY_ID: cdk.SecretValue.unsafePlainText(accessKey.accessKeyId),
SECRET_ACCESS_KEY: accessKey.secretAccessKey,
STREAM_NAME: cdk.SecretValue.unsafePlainText(stream.streamName),
DELIVERY_STREAM_NAME: cdk.SecretValue.unsafePlainText(
deliveryStream.deliveryStreamName!,
),
},
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these secrets needed for? If they are for fetching the e2e backends, I don't think this is the right place.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not for fetching but for creating

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but I am pushing out the updated branch, this whole commit was outdated and mistakenly pushed

@cadivus cadivus force-pushed the feat/amplify-foundation-dart-minimal branch from 000928f to 9b582eb Compare March 3, 2026 15:57
@ekjotmultani ekjotmultani force-pushed the feat/kinesis-e2e-infra branch from 0a451d4 to a04df03 Compare March 4, 2026 05:56
@cadivus cadivus force-pushed the feat/amplify-foundation-dart-minimal branch 2 times, most recently from 1f9c2b1 to 93c5331 Compare March 5, 2026 16:39
Base automatically changed from feat/amplify-foundation-dart-minimal to main March 5, 2026 16:48
ekjotmultani and others added 19 commits March 5, 2026 23:36
Adds the foundational package with minimal constructs needed for
the Kinesis client libraries:
- AmplifyException base class
- AWSCredentialsProvider<T> and AWSCredentials sealed hierarchy
- Logger interface with AmplifyLogger implementation
- LogLevel enum
- Result<T, E> sealed type
Provides V2CredentialsProviderBridge to bridge aws_common (V2)
credentials to amplify_foundation_dart (V3) credentials.
Shared by kinesis client packages to avoid duplicating bridge logic.
…plify backend

Provisions Kinesis Data Stream, Firehose delivery stream, IAM user,
and Secrets Manager secret via an Amplify Gen 2 backend using
backend.createStack() to access CDK directly — no auth or other
Amplify categories needed.

Removes the standalone KinesisTestStack and KinesisTestResources
construct from infra/, along with references in the main integ stack
and GitHub stack.
- Revert unrelated whitespace changes to infra/lib/stack.ts and
  infra/lib/github/github.ts
- Replace manual pubspec_overrides.yaml with aft bootstrap
- Update workflow to match repo conventions (action versions,
  submodule init, log_cw_metric_wrapper, timeout, defaults)
- Remove IAM user, access key, and Secrets Manager secret from
  backend.ts (credentials managed outside stack)
…lid category list in log_cw_metric so that\nthe kinesis package working directory is recognized by the CI\nmetric logging step."
…e same pattern as Analytics/Pinpoint and the Android KDS\nlibrary: include auth (Cognito) in the backend and grant the\nauthenticated IAM role permissions to Kinesis/Firehose resources.\n\nThis replaces the custom Secrets Manager credential injection with\nthe standard fetch_backends workflow pattern, making E2E tests use\nCognito-authenticated credentials like real customers would.\n\n- Add auth resource with pre-sign-up auto-confirm trigger\n- Grant authenticatedUserIamRole Kinesis and Firehose permissions\n- Rewrite E2E workflow to use fetch_backends composite action\n- Remove custom KINESIS_E2E secret fetching from workflow"
@ekjotmultani ekjotmultani force-pushed the feat/kinesis-e2e-infra branch from a04df03 to 18f1e9f Compare March 6, 2026 08:01
…ory.kinesis so deploy_gen2.dart can deploy the kinesis\nbackend and upload amplify_outputs.dart to S3. The kinesis backend\nshares its config with both aws_kinesis_datastreams and\naws_amazon_firehose packages via sharedOutputs."
enforceSSL: true,
});

// --- IAM role for Firehose → S3 ---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is unrelated to Kinesis. Can we handle this separately and remove from this PR?

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.

3 participants