Amazon.Runtime.InstanceProfileAWSCredentials.GetFirstRole C# (CSharp) Method

GetFirstRole() private static method

private static GetFirstRole ( ) : string
return string
        private static string GetFirstRole()
        {
            IEnumerable<string> roles = GetAvailableRoles();
            foreach (string role in roles)
            {
                return role;
            }

            // no roles found
            throw new InvalidOperationException("No roles found");
        }