Create IAM Role

  1. Go to AWS Management Console

    • Find IAM
    • Select IAM

    Create IAM Role

  2. In the IAM interface

    • Select Policies
    • Select Create policies

    Create IAM Role

  3. In the Create policies interface

    • Copy the policy below:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowReadingMetricsFromCloudWatch",
      "Effect": "Allow",
      "Action": [
        "cloudwatch:DescribeAlarmsForMetric",
        "cloudwatch:ListMetrics",
        "cloudwatch:GetMetricStatistics",
        "cloudwatch:GetMetricData"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowReadingTagsInstancesRegionsFromEC2",
      "Effect": "Allow",
      "Action": ["ec2:DescribeTags", "ec2:DescribeInstances", "ec2:DescribeRegions"],
      "Resource": "*"
    },
    {
      "Sid": "AllowReadingResourcesForTags",
      "Effect": "Allow",
      "Action": "tag:GetResources",
      "Resource": "*"
    }
  ]
}
  • Select JSON and paste the JSON policy into the text area

Create IAM Role

  • Select Next

Create IAM Role

  1. In the Create policy interface

    • Enter the policy name as GrafanaAccessPolicy

    Create IAM Role

  2. In the Tag section, enter key and value

    • Key, enter Name
    • Value, enter GrafanaAccessPolicy
    • Select Create policy

    Create IAM Role

  3. So we have created a policy for Role successfully

    Create IAM Role

  4. In the IAM interface

    • Select Roles
    • Select Create role

    Create IAM Role

  5. In the Select trusted entity interface

    • Select AWS service
    • Select EC2

    Create IAM Role

    • Scroll down and select Next

    Create IAM Role

  6. In the Add permissions interface

    • Find and select GrafanaAccessPolicy
    • Select Next

    Create IAM Role

  7. In Name, review and create step

    • Role name, enter GrafanaAccessRole
    • Description, enter Role for Grafana Access

    Create IAM Role

  8. Scroll down and select Create role

    Create IAM Role

    Create IAM Role

  9. Complete role creation for EC2 instance