Skip to content

A service for managing identity data about the people we look after in HMPPS

License

Notifications You must be signed in to change notification settings

ministryofjustice/hmpps-person-record

Repository files navigation

hmpps-person-record

repo standards badge CircleCI

A service for managing identity data about the people we look after in HMPPS

Prerequisites

  • JDK 21

Running tests

$ make test

Some tests are a bit flaky so are automatically retried in CI. If you want this feature locally, run CI=true make test

Deployment

Builds and deployments are set up in Circle CI and configured in the config file.
Helm is used to deploy the service to a Kubernetes Cluster using templates in the helm_deploy folder.

Running Service Locally

Mostly runs against dev services, uses localstack for the queues

$ make run-local

process a Common Platform message when running locally

AWS_REGION=eu-west-2 AWS_ACCESS_KEY_ID=key AWS_SECRET_ACCESS_KEY=secret aws --endpoint-url=http://localhost:4566 sns publish \
    --topic-arn arn:aws:sns:eu-west-2:000000000000:courtcasestopic \
    --message-attributes file://$(pwd)/src/test/resources/examples/commonPlatformMessageAttributes.json \
    --message file://$(pwd)/src/test/resources/examples/commonPlatformMessage.json

Working with AWS resources

You can retrieve the queue URLs from the secrets like this (preprod court cases queue URL): cloud-platform decode-secret -n hmpps-person-record-preprod -s sqs-cpr-court-cases-secret | jq -r '.data.sqs_queue_url'

We can access queues, topics and all other AWS dependencies using the service pod provided by cloud-platform. There is currently an instance running in preprod and prod - see the link above for instructions on how to get a shell on it.

Then you can run AWS CLI commands on the pod like this:

aws sqs get-queue-attributes --queue-url <COURT_CASES_QUEUE_URL> --attribute-names ApproximateNumberOfMessages

Localstack command to create FIFO topic

AWS_REGION=eu-west-2 AWS_ACCESS_KEY_ID=key AWS_SECRET_ACCESS_KEY=secret aws --endpoint-url=http://localhost:4566 sns create-topic --name courteventstopic.fifo --attributes '{"FifoTopic": "true", "ContentBasedDeduplication": "true"}'

AWS_REGION=eu-west-2 AWS_ACCESS_KEY_ID=key AWS_SECRET_ACCESS_KEY=secret aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name cpr_court_events_queue.fifo --attributes '{"FifoQueue": "true", "ContentBasedDeduplication": "true"}'

AWS_REGION=eu-west-2 AWS_ACCESS_KEY_ID=key AWS_SECRET_ACCESS_KEY=secret aws --endpoint-url=http://localhost:4566 sns subscribe --topic-arn arn:aws:sns:eu-west-2:000000000000:courteventstopic.fifo --protocol sqs --notification-endpoint arn:aws:sqs:eu-west-2:000000000000:cpr_court_events_queue.fifo

About

A service for managing identity data about the people we look after in HMPPS

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages