Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Last active July 9, 2025 02:46
Show Gist options
  • Select an option

  • Save KyMidd/688afd52cf10b0f83f208d93a9a44de6 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/688afd52cf10b0f83f208d93a9a44de6 to your computer and use it in GitHub Desktop.
def handle_teams_event(body, event):
# ...
if event_type == 'message':
# ...
# Fetch secret package
secrets = get_secret_ssm_layer(bot_secret_name)
# Disambiguate secrets
secrets_json = json.loads(secrets)
TENANT_ID = secrets_json["TENANT_ID"]
CLIENT_ID = secrets_json["CLIENT_ID"]
CLIENT_SECRET = secrets_json["CLIENT_SECRET"]
# Now we can use the bot token and signing secret
print("🟢 Successfully retrieved secrets from AWS Secrets Manager")
# Get bearer token for the bot to use to post messages
bot_bearer_token = get_teams_bearer_token(TENANT_ID, CLIENT_ID, CLIENT_SECRET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment