Links
Comment on page

Configure Your Kinesis Client for WarpStream

This pages explains how to configure your AWS Kinesis client with WarpStream.
WarpStream provides API-compatibility with AWS Kinesis, so you can just connect your clients to the WarpStream agents by modifying the AWS clients endpoint resolver to use your WarpStream Magic URL (obtained from the WarpStream admin console). For example, in Go:
package main
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/kinesis"
"github.com/aws/aws-sdk-go-v2/service/kinesis/types"
)
type EndpointResolver struct {
EndpointURL string
}
func NewKinesisEndpointResolver(url string) EndpointResolver {
return EndpointResolver{
EndpointURL: url,
}
}
func (e EndpointResolver) ResolveEndpoint(
region string,
options kinesis.EndpointResolverOptions,
) (aws.Endpoint, error) {
return aws.Endpoint{URL: e.EndpointURL}, nil
}
func main() {
ctx := context.TODO()
endpointURL := "http://YOUR_MAGIC_URL:PORT"
opts := []func(*config.LoadOptions) error{
config.WithRegion("warpstream"),
config.WithCredentialsProvider(
credentials.NewStaticCredentialsProvider("none", "none", "none")),
}
cfg, _ := config.LoadDefaultConfig(ctx, opts...)
client := kinesis.NewFromConfig(cfg, kinesis.WithEndpointResolver(
NewKinesisEndpointResolver(endpointURL)))
}
Apache, Apache Kafka, Kafka, and associated open source project names are trademarks of the Apache Software Foundation. Kinesis is a trademark of Amazon Web Services.