1.7.2-dev.0 • Published 4 years ago
platform-service-user-filters v1.7.2-dev.0
platform-service-filters
This module defines the platform-service-user-filters Service REST API.
Code Coverage Status
Security
For more information about some of the security tools that are baked into this repository, see the Security Definition of Done (internal) and implementation guide for security best practices (internal) for more context.
Prerequisites
npm install
docker pull amazon/dynamodb-local
aws configure
Note: If you are using Windows 7 you will need to enable port forwarding for amazon/dynamodb-local: 1. Right click on the VM running Docker 2. Navigate to Settings > Network > Advanced > Port Forwarding 3. Add a rule: name = dynamodb, host IP = 127.0.0.1, Host Port = 8000, Guest Port = 8000 4. Restart your VM
Run Integration & System Tests
(See bitbucket-pipelines.yml for the script of how this is done in the pipeline.)
docker run -p 8000:8000 amazon/dynamodb-local
# Set required environment variables (some may be optional depending on your choice of database or the lack thereof)
export DISCOVERY_SERVICE_DEFAULT_STAGE=dev
export AWS_REGION=us-east-1
export DISCOVERY_SERVICE=https://xpfekwpck7.execute-api.us-east-1.amazonaws.com/dev/
export DYNAMODB_ENDPOINT=http://localhost:8000
export DYNAMODB_TABLE_PREFIX=devsample
export STAGE_NAME=devsample
# Provision the table in dynamodb-local
npm run provision-local-table -- --config serverless-tables.yml --stage $STAGE_NAME_TABLES
# Unit and Integration tests
npm run test
# System tests
# Configure project to use AWS DynamoDB (not dynamodb-local)
export DYNAMODB_ENDPOINT=
. ./pipeline/setup-config.sh
# Deploy DynamoDB to AWS
npm run deploy -- --config serverless-tables.yml --stage $STAGE_NAME_TABLES --region $AWS_REGION --force
# Deploy the service to AWS
npm run deploy -- --config serverless-service.yml --stage $STAGE_NAME --region $AWS_REGION --force
# Run the system tests locally
npm run system-test
# Clean up after yourself when you're done. Because it was manually deployed, these stacks won't get cleaned up automatically.
npm run remove -- --config serverless-service.yml --stage $STAGE_NAME --region $AWS_REGION --force
npm run remove -- --config serverless-tables.yml --stage $STAGE_NAME_TABLES --region $AWS_REGION --force
Dependencies
- amazon/dynamodb-local - A Local version of DynamoDB used for integration tests / development purposes
- typescript
- chai
- aws-sdk
1.7.2-dev.0
4 years ago