Creating an IAM role for CloudWatch agent
To run the CloudWatch agent on an Amazon EC2 instance, first create an IAM role. This role provides permissions for reading information from the instance and writing it to CloudWatch.
To create the IAM role:
-
Sign in to the AWS Console and open the IAM console at https://console.aws.amazon.com/iam/.
-
In the left navigation pane, click Roles.
-
Click Create role.
-
Under Trusted entity type, select AWS service.
-
Under Use case, select EC2 then click Next.
-
From the list of policies, select CloudWatchAgentServerPolicy then click Next.
-
Enter a Role name (such as
CloudWatchAgentServerRole
), a Description if needed, and then click Create role. The role is created. -
Attach the new IAM role to the FortiPortal EC2 instance. The CloudWatch agent can now be run on this EC2 instance.
See the Amazon EC2 documentation for more information about attaching IAM roles to EC2 instances,