How do I assign an existing IAM role to an EC2 instance?
I have an AWS Identity and Access Management (IAM) role that I want to assign to an Amazon Elastic Compute Cloud (Amazon EC2) instance.
"I have an AWS Identity and Access Management (IAM) role that I want to assign to an Amazon Elastic Compute Cloud (Amazon EC2) instance.ResolutionUse either the Amazon EC2 console of the AWS Command Line Interface (AWS CLI) to assign a role. For more information, see Attach an IAM role to an instance.If you use AWS Systems Manager, then wait for AWS Systems Manager Agent (SSM Agent) to detect the new IAM role, or restart SSM Agent. For more information, see Setting up AWS Systems Manager.If you receive errors when running AWS CLI commands, make sure that you’re using the most recent version of the AWS CLI.Related informationCreating IAM rolesTutorial: Get started with Amazon EC2 Linux instancesUsing an IAM role to grant permissions to applications running on Amazon EC2 instancesI created an IAM role, but the role doesn't appear in the dropdown list when I launch an instance. What do I do?Follow"