aws-samples/iam-identity-center-team

subject length to long

Closed this issue · 1 comments

It looks like there's an issue with the TEAM application that arises when the SUBJECT of an Amazon Simple Notification Service (SNS) message is too long. The specific problem is that the TEAM application doesn't validate or limit the maximum length of a string variable, causing message sending to fail. The error is captured in CloudWatch, and a screenshot of the error has been provided.

Screenshot 2023-12-07 at 13 06 21

Description of changes:
To address this issue, the proposed solution is to shorten the SUBJECT line by removing the {requester} variable, which can potentially be very long and contain a significant number of characters. {requester} variable is the email address which is raising an request. The original long subject line includes the {requester} variable, and the modified shorter subject line omits it. Here's an example to illustrate the change:

example:
Long Subject Line (Original):
subject = f"{requester} requests access to AWS account {account} - TEAM"

Short Subject Line (Modified):
subject = f"Requests access to AWS account for {account} - TEAM"

@tawoyinfa i have created an PR for this. #129

@tawoyinfa, an PR is created for this. #129
Thanks for your support :)