Skip to content

Conversation

mashiike
Copy link
Contributor

@mashiike mashiike commented Mar 23, 2022

thank you great tool.

When executing from a lambda function, the SNS subject is too long when using ARNs

for example:

Tracer: arn:aws:ecs:ap-northeast-1:012345678901:task/dev-main/0123456789abcdef0123456789abcdef on arn:aws:ecs:ap-northeast-1:012345678901:cluster/main
2022-03-23T03:34:40.757Z	TASK	Created
2022-03-23T03:34:44.431Z	TASK	Connected
2022-03-23T03:34:58.254Z	TASK	Pull started
2022-03-23T03:35:18.965Z	TASK	Pull stopped
2022-03-23T03:35:37.090Z	TASK	Started
2022-03-23T03:41:15.397Z	TASK	Execution stopped
2022-03-23T03:41:25.441Z	TASK	Stopping
2022-03-23T03:41:25.441Z	TASK	StoppedReason:Essential container in task exited
2022-03-23T03:41:25.441Z	TASK	StoppedCode:EssentialContainerExited
2022-03-23T03:41:38.629Z	TASK	Stopped
2022-03-23T03:44:32.977Z	CONTAINER:hoge	LastStatus:STOPPED HealthStatus:UNKNOWN (exit code: 0)
2022-03-23T03:44:32.977Z	TASK	LastStatus:STOPPED
InvalidParameter: Invalid parameter: Subject

from aws cli help message:


       --subject (string)
          Optional parameter to be used as the "Subject" line when the message
          is  delivered  to email endpoints. This field will also be included,
          if present, in the standard JSON messages delivered  to  other  end-
          points.

          Constraints:  Subjects must be ASCII text that begins with a letter,
          number, or punctuation mark; must not include line breaks or control
          characters; and must be less than 100 characters long.

Sending SNS fails because the subject is too long.
Therefore, we have made two changes.

  1. cluster name and task ID are extracted from ARN in the Lambda handler.
  2. if the Subject is longer than 100 characters, omit the end

@fujiwara fujiwara merged commit 0c796b4 into fujiwara:main Mar 23, 2022
@mashiike mashiike deleted the feature/on-lambda-arn-make-so-long-subject branch March 23, 2022 06:01
@mashiike
Copy link
Contributor Author

thank you!

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