Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix guides links and add documentation on how to setup new client eve… #389

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ Note, this will only specifically enable the `RequestLogger`.

## Developer guides

- [Creating an environment](/docs/creating-an-environment.md)
- [Setting up a CircleCI context for deployment](/docs/setting-up-circleci-context-for-deployment.md)
- [Setting up a new consumer](/docs/setting-up-a-new-consumer.md)
- [Updating diagrams](/docs/updating-diagrams.md)
- [Useful commands](/docs/useful-commands.md)
- [Creating an environment](/docs/guides/creating-an-environment.md)
- [Setting up a CircleCI context for deployment](/docs/guides/setting-up-circleci-context-for-deployment.md)
- [Setting up a new consumer](/docs/guides/setting-up-a-new-consumer.md)
- [Updating diagrams](/docs/guides/updating-diagrams.md)
- [Useful commands](/docs/guides/useful-commands.md)

## Related repositories

Expand Down
28 changes: 27 additions & 1 deletion docs/guides/setting-up-a-new-consumer.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,33 @@ kubectl -n hmpps-integration-api-<environment> get secrets consumer-api-keys -o
# E.g. kubectl -n hmpps-integration-api-dev get secrets consumer-api-keys -o json | jq -r '.data.dev' | base64 -d
```

2. Using [One-Time Secret](https://onetimesecret.com/) and email, send the new consumer their:
2. Using [One-Time Secret](https://password.link/en) and email, send the new consumer their:
1. private key
2. client certificate
3. API key

## Create new consumer subscriber queue

### Create basic infrastructure
Within the [Cloud Platform Environments GitHub repository](https://github.com/ministryofjustice/cloud-platform-environments/tree/main) and the namespace of the environment:

1. Create a branch.
2. Add new client subscriber terraform file. Example: [event-subscriber-mapps.tf](https://github.com/ministryofjustice/cloud-platform-environments/pull/22091/files#diff-4046866c9398b1db59a427052406a08c2adab45aadbc278f16232157a636f451)
3. Rename client name "mapps" to new client name
4. Add new client filter list secret. exmaple [secret.tf](https://github.com/ministryofjustice/cloud-platform-environments/pull/22091/files#diff-bc13dba50c430d2a667e5b867d2798770e5e8c48697407d93e2febedb3ff46dc)
5. Follow steps 3-8 in [Create an API key](#create-an-api-key) to merge branch to main.

After the change is merged and applied, you can retrieve client queue name and ARN with the following command:

```bash
kubectl -n hmpps-integration-api-[environment] get secrets [your queue secret name] -o json
# E.g. kubectl -n hmpps-integration-api-dev get secrets event-mapps-queue -o json
```
### Using AWS secret for filter Policy
1. Login to the [AWS Console](https://user-guide.cloud-platform.service.justice.gov.uk/documentation/getting-started/accessing-the-cloud-console.html), navigate to Secrets Manager and navigate to the secret created in the previous step by search using the secret description. e.g. MAPPS event filter list Pre-prod
2. Click on the secret and then click on Retrieve secret value. If this is your first time accessing the new secret, you will see an error Failed to get the secret value.
3. Click on Set secret Value, and set the Plaintext value as: {"eventType":["default"]}. Setting filter to default will block subscriber receiving any messages. Event notifier will update the subscriber and AWS secret with actual filter list later.
4. Save the change
5. Create new [Cloud Platform Environments GitHub repository](https://github.com/ministryofjustice/cloud-platform-environments/tree/main) branch
6. Update terraform to load the secret value from AWS and update filter_policy value. Follow [Example](https://github.com/ministryofjustice/cloud-platform-environments/pull/22111/files). Note: The name of aws_secretsmanager_secret module has to be same as the secret name created from step 4/5 above.
7. Follow steps 3-8 in [Create an API key](#create-an-api-key) to merge branch to main.
Loading