CDK Constructs for AWS API Gateway and Amazon Kinesis Data Streams integration.
Project description
aws-apigateway-kinesisstreams module
---All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
Reference Documentation: | https://docs.aws.amazon.com/solutions/latest/constructs/ |
---|
Language | Package |
---|---|
Python | aws_solutions_constructs.aws_apigateway_kinesisstreams |
Typescript | @aws-solutions-constructs/aws-apigateway-kinesisstreams |
Java | software.amazon.awsconstructs.services.apigatewaykinesisstreams |
Overview
This AWS Solutions Construct implements an Amazon API Gateway connected to an Amazon Kinesis Data Stream pattern.
Here is a minimal deployable pattern definition in Typescript:
import { ApiGatewayToKinesisStreams, ApiGatewayToKinesisStreamsProps } from '@aws-solutions-constructs/aws-apigateway-kinesisstreams';
new ApiGatewayToKinesisStreams(this, 'test-apigw-kinesis', {});
Initializer
new ApiGatewayToKinesisStreams(scope: Construct, id: string, props: ApiGatewayToKinesisStreamsProps);
Parameters
- scope
Construct
- id
string
- props
ApiGatewayToKinesisStreamsProps
Pattern Construct Props
Name | Type | Description |
---|---|---|
apiGatewayProps? | api.RestApiProps |
Optional user-provided props to override the default props for the API Gateway. |
putRecordRequestTemplate? | string |
API Gateway request template for the PutRecord action. If not provided, a default one will be used. |
putRecordRequestModel? | api.ModelOptions |
API Gateway request model for the PutRecord action. If not provided, a default one will be created. |
putRecordsRequestTemplate? | string |
API Gateway request template for the PutRecords action. If not provided, a default one will be used. |
putRecordsRequestModel? | api.ModelOptions |
API Gateway request model for the PutRecords action. If not provided, a default one will be created. |
existingStreamObj? | kinesis.Stream |
Existing instance of Kinesis Stream, if this is set then kinesisStreamProps is ignored. |
kinesisStreamProps? | kinesis.StreamProps |
Optional user-provided props to override the default props for the Kinesis stream. |
Pattern Properties
Name | Type | Description |
---|---|---|
apiGateway | api.RestApi |
Returns an instance of the API Gateway REST API created by the pattern. |
apiGatewayRole | iam.Role |
Returns an instance of the iam.Role created by the construct for API Gateway. |
apiGatewayCloudWatchRole | iam.Role |
Returns an instance of the iam.Role created by the construct for API Gateway for CloudWatch access. |
apiGatewayLogGroup | logs.LogGroup |
Returns an instance of the LogGroup created by the construct for API Gateway access logging to CloudWatch. |
kinesisStream | kinesis.Stream |
Returns an instance of the Kinesis stream created or used by the pattern. |
Sample API Usage
Method | Request Path | Request Body | Stream Action | Description |
---|---|---|---|---|
POST | /record |
{ "data": "Hello World!", "partitionKey": "pk001" } |
kinesis:PutRecord |
Writes a single data record into the stream. |
POST | /records |
{ "records": [{ "data": "abc", "partitionKey": "pk001" }, { "data": "xyz", "partitionKey": "pk001" }] } |
kinesis:PutRecords |
Writes multiple data records into the stream in a single call. |
Default settings
Out of the box implementation of the Construct without any override will set the following defaults:
Amazon API Gateway
- Deploy an edge-optimized API endpoint
- Enable CloudWatch logging for API Gateway
- Configure least privilege access IAM role for API Gateway
- Set the default authorizationType for all API methods to IAM
- Enable X-Ray Tracing
- Validate request body before passing data to Kinesis
Amazon Kinesis Data Stream
- Configure least privilege access IAM role for Kinesis Stream
- Enable server-side encryption for Kinesis Stream using AWS Managed KMS Key
Architecture
© Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aws-solutions-constructs.aws-apigateway-kinesisstreams-1.64.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08671530a23791c5c060f84225dde34b0a08adc88397876deba9754c44666fed |
|
MD5 | c229eb59bff4308b4af3e57296eb394e |
|
BLAKE2b-256 | 999fa03250dc91578581397eb6ad86c943477f8a1578cc1415274dca3dff68bb |
Hashes for aws_solutions_constructs.aws_apigateway_kinesisstreams-1.64.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a1d28f9eb0a2818186171aed56716737f341ba4ca974412304c9c4e14e51e7e |
|
MD5 | 92c0e0d7b2409525f0736a3638bdb6e7 |
|
BLAKE2b-256 | 4c121cb347752baa19914e872f9f754a8ba15b1320b905df0aece1771839b788 |