Skip to content

chore: implement twilio-external-task Lambda [CHI-3955] - #4655

Merged
gpaoloni merged 11 commits into
masterfrom
gian_CHI-3955
Sep 3, 2026
Merged

chore: implement twilio-external-task Lambda [CHI-3955]#4655
gpaoloni merged 11 commits into
masterfrom
gian_CHI-3955

Conversation

@gpaoloni

@gpaoloni gpaoloni commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

This PR implements the Lambda introduced by https://github.com/techmatters/infrastructure-config/pull/588.

Description

This PR implements twilio-external-task:

  • The implementation follows the same idea as account-scoped Lambda, but instead of account sid it relies on account short code.
  • Auth is done via static API key.
  • If valid, creates a new external_task channel type task in the target Twilio account.

Example request:

❯ curl -X POST 'https://hrm-development.tl.techmatters.org/lambda/twilio/external-task/as' -H "Authorization: Basic < external_task_api_key >" -H "Content-Type:
application/json" -H "Accept: application/json" -d '{"key": "test-external-id" }'

where external_task_api_key is the SSM parameter that corresponds to the AS development account sid.

Configuration

To test the integration, other than applying the linked PR in infra and deploying this code

  • Add SSM /<environment>/twilio/<account_sid>/external_task_api_key parameter. Make sure is only number (lower and upper case) and numbers. E.g. /development/twilio/ACd8a2e89748318adf6ddff7df6948deaf/external_task_api_key
  • In Twilio
    • Create external channel type.
    • Edit workflow expressions to match external tasks.
    • [OPTIONAL] Add custom task queue.

Checklist

Other Related Issues

None

Verification steps

AFTER YOU MERGE

  1. Cut a release tag using the Github workflow. Wait for it to complete and notify in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P

@gpaoloni gpaoloni changed the title chore: add external-task lambda with POST support chore: implement twilio-external-task Lambda [CHI-3955] Sep 2, 2026
@gpaoloni
gpaoloni requested a review from stephenhand September 2, 2026 16:12
@gpaoloni
gpaoloni marked this pull request as ready for review September 2, 2026 16:12
try {
console.debug(`Authenticating against key ${externalTaskApiKeyParam} `);
const requestSecret = authorization.replace('Basic ', '');
const externalTaskApiKey = await getSsmParameter(externalTaskApiKeyParam);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to move this call out of the try / catch block so we don't get misleading 403s for a configuration issue?

@gpaoloni
gpaoloni merged commit d5170f8 into master Sep 3, 2026
56 of 57 checks passed
@gpaoloni
gpaoloni deleted the gian_CHI-3955 branch September 3, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants