For this, you would need to create a trust relationship policy.
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Principal": {"Service": "ec2.amazonaws.com"},
"Action": "sts:AssumeRole"
}
Use this trust relationship policy document. This is not a normal policy document, you have to provide this in the trust relationship tab available in roles.
If you wish to know more about this online storage solution by amazon, you can read Amazon S3. Do you want to master AWS, then do checkout the aws certification training by Intellipaat.