Skip to content

Instantly share code, notes, and snippets.

@fsanal
Created December 12, 2022 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fsanal/6c527154cd292f99c36b432d0732b1fb to your computer and use it in GitHub Desktop.
Save fsanal/6c527154cd292f99c36b432d0732b1fb to your computer and use it in GitHub Desktop.
private void createMobileCollectionResource(RestApi api, String platformResourceName) {
Resource mobileResource = api.getRoot().addResource(platformResourceName);
KinesisPipeline pipeline = createKinesisPipeline(platformResourceName);
kinesisPipelines.add(pipeline);
AnalyticsEventProcessor processor = AnalyticsEventProcessor.Builder.create(this,
String.format("Analytics%sEventProcessor", capitalize(platformResourceName)))
.platformName(platformResourceName)
.stream(pipeline.getStream())
.lambdaExecutionRole(awsLambdaAnalyticsExecution)
.routingLambda(routingLambda)
.reprocessingLambda(reprocessingLambda)
.build();
lambdaDlqTopics.add(processor.getDlqTopic());
Resource batch = mobileResource.addResource("batch");
attachStreamResourceMethods(batch, platformResourceName, "PutRecords", false);
Resource sourceConfig = mobileResource.addResource("sourceConfig");
sourceConfig.addMethod("GET",
createSourceConfigMockIntegration(false),
createMethodOptions(false)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment