Not able to assign policy to resource iam:PutRolePolicy

I need to add iam_role_policy to ec2 for getting access to s3 bucket.
Created access key (third party access ) from a aws playground account.
Can please anyone help me here?