Skip to content

Deployment

dbmiller1128 edited this page Apr 3, 2017 · 5 revisions

Once you've completed development and feel you've sufficiently tested your lambda function, the next step is to register and add it to the mParticle platform. This is a multistep process:

Step 1 - Grant Permissions

You will need to grant mParticle permissions to call your lambda function. Using the Amazon CLI tool, execute the commands below, altering them for your environment:

  • change the --function-name argument (arn:aws:lambda:us-east-1:123456789:function:myLambdaFunction:production) to the full ARN of your lambda function. This can be found by navigating to your AWS Lambda console and selecting your lambda function.
  • you should be using an alias for your lambda function to allow for additional development and testing while your integration is live. In the commands below, be sure to append your production alias name to your lambda-function's ARN. The examples below use an alias named "production". See here for more information on Aliases.
  • statement-id must be unique - if you receive an error stating that the provided statement-id already exists, increment the statement-id(s) to a higher value.
aws lambda add-permission \
--region us-east-1 \
--function-name arn:aws:lambda:us-east-1:123456789:function:myLambdaFunction:production \
--statement-id 1 \
--principal 338661164609 \
--action lambda:InvokeFunction
aws lambda add-permission \
--region us-east-1 \
--function-name arn:aws:lambda:us-east-1:123456789:function:myLambdaFunction:production \
--statement-id 2 \
--principal 457804467337 \
--action lambda:InvokeFunction

Step 2 - Notify mParticle and send logo

Once permissions have been granted, mParticle will use an internal tool to send a registration request to your lambda function. We will work with you to ensure that your registration response looks correct and that it includes what's necessary for your service.

mParticle requires a high-resolution logo to represent your service in our dashboard. The logo should ideally have a transparent background in vector format (svg), and must be easily readable when set on top of a white or light-colored page.

Provide mParticle with credentials for the required fields from your registration response for testing configuration.

Step 3 - Final testing and release

Once your lambda-function has been registered and added to the mParticle platform, we will work with you to perform final testing prior to making your service available to all mParticle customers.

Data Rate and Volume

mParticle servers will stream data to your function at the same rate at which it is received. By default, AWS lambda allows for 100 concurrent executions of your function. If your lambda function reaches this limit, mParticle will continually retry requests with a back-off until they have succeeded. If you are expecting a large customer integration, it is recommended that you request a higher limit by opening a case with AWS Support.

See here for more information on AWS rate limiting and how to increase your limit.

Keep this in mind as you're developing your lambda function as it may determine how it should process and to which of your APIs you should send data. Data rate and volume will depend on:

  1. The size of the customer that has enabled your integration.
  2. The amount of/types of data for which you register.
  3. If you've registered to receive Audience data, the volatility and size of a given customer's audiences.