Skip to content
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

Add SigV4 support #78

Merged
merged 1 commit into from
Nov 20, 2024
Merged

Add SigV4 support #78

merged 1 commit into from
Nov 20, 2024

Conversation

trevorbonas
Copy link
Contributor

Issue #, if available:

N/A.

Description of changes:

  • Connector:

    • enable_sigv4_auth environment variable has been added. If this environment variable is true, basic auth headers will be ignored and the connector will attempt to use local credentials.
  • SAM template:

    • EnableSigV4Auth parameter has been added, which sets authentication to AWS_IAM for the routes (/write and /read) and passes in the enable_sigv4_auth environment variable to the connector Lambda function with the value true.
    • Events have been removed from the Lambda function and replaced with routes to configure SigV4 authentication.
    • The APIGateway resource has been changed to an AWS::ApiGatewayV2::Api with protocol set to HTTP. This was done because using API Gateway resources (such as AWS::ApiGatewayV2::Route resources) on an AWS::Serverless::HttpApi resource has undefined behaviour.
  • Documentation:

    • Launch (SigV4) links have been added to the DEVELOPER_README, which set the EnableSigV4Auth parameter to true.
  • Integration tests passed (go test -v ./integration/).

  • Unit tests passed (go test -tags=unit -cover -v ./timestream ./).

  • TLS tests passed (go test -v ./integration/tls).

  • Correctness tests passed (go test -v ./correctness).

  • Stack deployment tested with SigV4 enabled using the OpenTelemetry collector.

  • Stack deployment tested with SigV4 disabled using Prometheus for reading and writing.

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

Changes:
- Connector:
    - `enable_sigv4_auth` environment variable has been added. If this environment variable is true, basic auth headers will be ignored and the connector will attempt to use local credentials.
- SAM template:
    - `EnableSigV4Auth` parameter has been added, which sets authentication to `AWS_IAM` for the routes (`/write` and `/read`) and passes in the `enable_sigv4_auth` environment variable to the connector Lambda function with the value `true`.
    - Events have been removed from the Lambda function and replaced with routes to configure SigV4 authentication.
    - The `APIGateway` resource has been changed to an `AWS::ApiGatewayV2::Api` with protocol set to `HTTP`. This was done because using API Gateway resources (such as `AWS::ApiGatewayV2::Route` resources) on an `AWS::Serverless::HttpApi` resource has undefined behaviour.
- Documentation:
    - `Launch (SigV4)` links have been added to the DEVELOPER_README, which set the `EnableSigV4Auth` parameter to `true`.

- [x] Integration tests passed (`go test -v ./integration/`).
- [x] Unit tests passed (`go test -tags=unit -cover -v ./timestream ./`).
- [x] TLS tests passed (`go test -v ./integration/tls`).
- [x] Correctness tests passed (`go test -v ./correctness`).
- [x] Stack deployment tested with SigV4 enabled using the OpenTelemetry collector.
- [x] Stack deployment tested with SigV4 disabled using Prometheus for reading and writing.
Copy link
Contributor

@forestmvey forestmvey left a comment

Choose a reason for hiding this comment

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

Thanks for the change.

I have validated tests are passing, SigV4 authenticated deployment can ingest data, and the non-sigv4 deployment works with Prometheus.

@forestmvey forestmvey merged commit 0c51013 into awslabs:main Nov 20, 2024
4 checks passed
@forestmvey forestmvey deleted the integ-sigv4 branch November 20, 2024 17:43
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.

2 participants