Does the REST API support setting an s3 source with auth from ec2 environment? from the docs it appears that it only supports setting aws credentials explicitly.
The UI uses the same configuration entities as the REST APIs, so you could inspect the browser call to create the source to see what the configuration looks like.
In this case, which specific authentication model are you looking for?