I have an ec2 instance (say ec2-1) which has an IAM role attached. This IAM role is having policies for launching new ec2 instances, new security groups, listing various security groups, copying file from S3 etc.
Now I want to launch another ec2 instance from this ec2-1 instance using aws cli or cloudformation templates (not from console) but with an additional access of copying objects from s3. I want paas only this policy/role from ec2-1 to this newly launched instance so that using user data in the CFT, I can copy objects into new ec2 instances from s3.
I do not want to pass the complete role with complete policies which are there in ec2-1 like launching ec2, SG etc.
How can I achieve this ?