I want to develop java application and deploy on EC2. As much as I understand you should use roles instead of access key and secret key.
Now suppose I launch an instance , with a S3 full access role attached to it , then how I will make a API call ?
Because for SDK it needs access key and secret key as follows :
AWSCredentials credentials = new BasicAWSCredentials("YourAccessKeyID", "YourSecretAccessKey");
AmazonS3 s3client = new AmazonS3Client(credentials);
I am not understanding how it will work ?