Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io provider aws ec2 resource, getStatus() checking SSM visibility #20

Merged
merged 1 commit into from
May 28, 2022

Conversation

schowsf
Copy link
Contributor

@schowsf schowsf commented May 27, 2022

Change to io provider aws ec2 resource, getStatus() checking SSM visibility

In the time gap when an Ec2 instance is created, and SSM service is not aware of the new instance yet, if an activity attempt is executed on the ec2 instance, the following error would occur without this change.

[error] 2022-05-27 14:49:15,686 c.s.m.o.s.a.ActivityAttempt$ - ActivityAttempt Actor[akka://application/user/orchard-system/wf-2ddb477a-52bc-419b-8b8b-86749e7df124/act-activityId_2/attempt-1#-1267839591] exception in creating task

software.amazon.awssdk.services.ssm.model.InvalidInstanceIdException: Instances [[i-04a8d2699077682b1]] not in a valid state for account 802707170857 (Service: Ssm, Status Code: 400, Request ID: 695a92b3-e94f-490b-9b19-b7b14b6bb7a5)

logger.debug(s"getStatus: result = $res")
res
} catch {
case e: Throwable => Left(e)
Copy link
Contributor

Choose a reason for hiding this comment

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

what potential exceptions are we expecting here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when testing locally just on the Ec2Resource, I created from command line an ec2 instance, and passed in a wrong instanceId (due to typo), and got an Ec2Exception from ec2client.describeInstances() call

software.amazon.awssdk.services.ec2.model.Ec2Exception: Invalid id: "i-04efef9282d2ee064kkk" (Service: Ec2, Status Code: 400, Request ID: 69df7559-351e-43e5-9abc-b8eea71fb742)

Normally though, the Ec2Resource class would not be called with getStatus having a wrong instanceId value. I think even the terminated instances would be around for a while with status = terminated.

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.

None yet

2 participants