When launching an EC2 instance with a IAM Role, a ID and Secret Key are not needed to interact with the AWS API. For this scenario a error should not be raised if a ID and Key are not present.
Would it be acceptable to not raise an error if credentials are not provided? This is how I have run other applications.
Another solution could be to specify in some way that credentials will be taken care of by the role.