I looked at attributes of the EC2 instance, but did not get a clear attribute value that identifies the same.
I also, saw the following discussion, but Im wondering whether identifying the os/platform has been simplified by aws since this disscusion. How to find OS of an EC2 instance using AWS CLI
From Terminal inside EC2 instance: $ cat /etc/os-release
You can check through console by following procedure.
Select instance => Action => Instance setting => Get instance screenshot .
this will show the OS of your instance.

If you have a System Manager agent installed on your instances you can use DescribeInstanceInformation API to find that information:
$ aws ssm describe-instance-information --query 'InstanceInformationList[*].[InstanceId,PlatformType,PlatformName]' --output text --filters Key=InstanceIds,Values=i-016073859e4b31111
i-016073859e4b31111 Linux Amazon Linux AMI