notification-api icon indicating copy to clipboard operation
notification-api copied to clipboard

Use Pinpoint by default

Open sastels opened this issue 9 months ago • 0 comments

Summary | Résumé

Use Pinpoint by default to send the non-shortcode SMS using the default pool.

Exceptions are notifications sent from a dedicated long code and notifications sent to American phone numbers. These will still be sent by SNS.

Related Issues | Cartes liées

  • https://app.zenhub.com/workspaces/notify-planning-core-6411dfb7c95fb80014e0cab0/issues/gh/cds-snc/notification-planning-core/286

Test instructions | Instructions pour tester la modification

  • To run locally, set your AWS_PINPOINT_SC_POOL_ID, AWS_PINPOINT_DEFAULT_POOL_ID, and AWS_US_TOLL_FREE_NUMBER environment variables to the values in staging
AWS_PINPOINT_SC_POOL_ID = "pool-b20333ce1e4e49309ba1db3bf94a3f57"
AWS_PINPOINT_DEFAULT_POOL_ID = "pool-8885654b47d6466f9aaee14c62494ff2"
AWS_US_TOLL_FREE_NUMBER=+18449521252
  • set the env var AWS_PINPOINT_SC_TEMPLATE_IDS to a list of some sms template ids (from your local install). Just one is ok
AWS_PINPOINT_SC_TEMPLATE_IDS = 000000-1111-2222-3333-444444444

SMS can be sent with:

  • Pinpoint: logs will contain AWS Pinpoint request finished in ... and SMS will be sent from the SC pool number or the default pool number as appropriate.
  • SNS: logs will contain AWS SNS request finished in ...

Tests:

  • [ ] Send an sms using a template in the SC list. It should be sent from the Pinpoint SC pool.
  • [ ] Send an sms using a template not in the list. It should be sent from the Pinpoint default pool.
  • [ ] Send an sms using a service with a dedicated number. If should be sent through SNS (and from your dedicated number)
  • [ ] Send an sms to a US number (ex: 7065550123, a fake number in Georgia). If should be sent through SNS
  • [ ] Set AWS_PINPOINT_SC_POOL_ID or AWS_PINPOINT_DEFAULT_POOL_ID to None, restart both your terminal window and celery, and send to yourself. It should send using SNS.
  • [ ] Send an email to verify that we didn't affect that! 😬

Release Instructions | Instructions pour le déploiement

None.

Note in particular that if the pool_id variables are not sent then we default to just using SNS.

Reviewer checklist | Liste de vérification du réviseur

  • [ ] This PR does not break existing functionality.
  • [ ] This PR does not violate GCNotify's privacy policies.
  • [ ] This PR does not raise new security concerns. Refer to our GC Notify Risk Register document on our Google drive.
  • [ ] This PR does not significantly alter performance.
  • [ ] Additional required documentation resulting of these changes is covered (such as the README, setup instructions, a related ADR or the technical documentation).

⚠ If boxes cannot be checked off before merging the PR, they should be moved to the "Release Instructions" section with appropriate steps required to verify before release. For example, changes to celery code may require tests on staging to verify that performance has not been affected.

sastels avatar May 08 '24 12:05 sastels