How to validate EC2::InstanceType? #2444
Unanswered
jkmartin19
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Is there anyone who knows how to validate that a string is a valid instance type? I'm hoping I don't have to write something myself. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I need to validate that a string is a valid EC2 instance type. I was hoping code like this would work:
The issue is that the above code will return a seemingly valid InstanceType because GetInstanceTypeForName() uses the EnumParseOverflowContainer, so it will return an InstanceType that is something other than NOT_SET.
I'm wondering what the correct way to validate that a string input is a valid InstanceType. Any pointers would be very appreciated.
Beta Was this translation helpful? Give feedback.
All reactions