The problem is that INSTANCE_PROFILE_NAME no longer contains INSTANCE_PROFILE_PREFIX, so we cannot directly get the INSTANCE_PROFILE_NAME from it anymore.
Therefore, we need to first find the INSTANCE_ID of any EC2 instance in the auto-scaling group by INSTANCE_PROFILE_PREFIX, and get the INSTANCE_PROFILE ARN associate with it.
Then, extract the INSTANCE_PROFILE_NAME from the ARN (IAM must use the name for CLI searching), and we can continue to get the ROLE_NAME through the INSTANCE_PROFILE_NAME.
The problem is that INSTANCE_PROFILE_NAME no longer contains INSTANCE_PROFILE_PREFIX, so we cannot directly get the INSTANCE_PROFILE_NAME from it anymore. Therefore, we need to first find the INSTANCE_ID of any EC2 instance in the auto-scaling group by INSTANCE_PROFILE_PREFIX, and get the INSTANCE_PROFILE ARN associate with it. Then, extract the INSTANCE_PROFILE_NAME from the ARN (IAM must use the name for CLI searching), and we can continue to get the ROLE_NAME through the INSTANCE_PROFILE_NAME.