aio-crm-integration-processor

2.10.2-alpha.1 • Public • Published

aio-crm-integration-processor

Purpose

The AIO crm integration processor stores a CRM Lead Payload object (Defined in the types folder) that is uploaded to an S3 bucket. Currently that S3 Bucket has a listener attached to it that Vin Integration listens to in order to respond to new S3 bucket uploads which are then propagated into their system.

The conditions for this Lambda to upload to an S3 bucket are:

  1. The Message Type is in the White List
export const TYPE_WHITELIST = [
    eventTypes.ACCEPTANCE_UPDATE,
    eventTypes.FNI_FAILURE,
    eventTypes.FNI_SUCCESS,
    eventTypes.RESERVATION_UPDATE,
    eventTypes.TEST_DRIVE_UPDATE,
    eventTypes.OFFER // TODO: temporariy until client changes for secondary interactions go out
];

2.The Dealer has Vin Integration Enabled. This can be enabled in Admin Settings.

AIO Crm Integration Flow

Operational AIO pillar

Splunk Query

Basic Dev Query
Basic QA Query
Basic Prod Query

What you need before accessing operational items

  • Access to splunk
  • Access to AWS console in production for account awsdrst

Please read this section to get familiar how we operate this service, if you have any questions please reach us out at #dr-team-rocket slack channel.

Always perform operations as code

Changes to AIO workloads (applications or infrastructure) are defined as code and updated it with code. We use AWS Cloudformation templates to define our infrastructure layers: networking, databases, aws resources and the interoperability between them.

Create documentation

We encourage changes in business logic or in infrastructure as code to have annotations that can be use as references for developers. In AIO we use automated tools to create documentation based on annotations, see docs-md and docs-html npm tasks in root the package.json.

Make frequent, small, reversible changes

Small changes can be reversed, please discuss with your team how to deliver in small incremental pieces changes for your working stories so impact can be either reversed or it can be identified and fixed as soon as it happens.

Anticipate failures with your code

Adding proper logging to your critical code operations (success and failures) is key to know the status of your changes, test your changes in local environments if possible or promote to a dev environment if you need to, create alarms based on failure for critical path your code need to follow and add alarms in lower environments, think about testing failure scenarios with your team, if you have any questions please reach us at #dr-team-rocket.

How to run locally:

  1. Get an env.json from one of Team Rocket's members
  2. Install AWS SAM: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-mac.html
  3. Setup Environment Variables
  4. Run npm start or npm start-debug

Setting Environment Variables

Some environment variables are required for running this application locally which are typically provided by the template.yaml which will attempt to read from Parameter Store, but locally we won't have this so we can just set some Environment Variables

  • export AIO_CRM_S3_BUCKET=aio-integration-test
    • Setting it to a bucket that we own so that it can actually write to the bucket would be best, but as far as I know we currently don't own a bucket for local testing purposes.
  • You'll need the follow environment variables for AWS Auth created by alks sessions open
    • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN

Deploying the Application

  1. When a PR is merged into the Master branch, CodeBuild should kick off the aio-crm-integration-processor build which will kick off the associated CodePipeline aio-crm-integration-processor which can be deployed to prod.

To deploy manually

Go to CodeBuild to pipeline aio-crm-integration-processor and click the Start Build button.

  • Pipeline aio-crm-integration-processor will be kicked off
  • Manual approval will be needed to deploy the application further to QA and Production

Dependents (0)

Package Sidebar

Install

npm i aio-crm-integration-processor

Weekly Downloads

1

Version

2.10.2-alpha.1

License

ISC

Unpacked Size

158 kB

Total Files

52

Last publish

Collaborators

  • mmd-devops