21.5.5 Creating an IAM Role and Policy for
CloudWatch Monitoring
Use the AWS Management Console to create an IAM role for using
CloudWatch to monitor your DB Systems and MySQL HeatWave Clusters.
This task requires the following:
- Access to AWS Management Console.
- An AWS account with rights to create and manage IAM roles. This is
the account for receiving the metrics emitted by the monitoring service.
Do the following to create an IAM role:
- Open the AWS Management Console and sign in with
your credentials.
- In the AWS Management Console home page, click Services, and click
Security, Identity, & Compliance, and then click
IAM.
- In the navigation pane of the Console, under Access management, click
Roles, and then click Create role button.
- In the Trusted entity type panel, select Custom Trust Policy, and
modify the trust policy to allow the monitoring service to assume this role (see
Manage AWS Access on the
<IDDetails>
you should
use.):{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "612981981079"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringLike": {
"sts:ExternalId":"<IDDetails>"
}
}
}
]
}
Click
Next.
- On the Add permissions page, skip to the next step by clicking
Next.
- On the Name, review, and create page, do the
following:
- Enter a Role name, for example
OracleHeatWaveMonitoringRole
, and an optional
Description if you like.
- Review the Trust policy, and click Create
role.
- On the IAM > Roles page, search
for the role you just created using its name, and then click on it.
- Modify the Permissions for your role:
- On the information page for the role, on the
Permissions tab, click on the Add
permissions button and select Create inline
policy,
- On the Specify permissions page, in the
Policy editor pane, select the
JSON tab, and replace the shown policy with
the following:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutRetentionPolicy"
],
"Resource": "arn:aws:logs:*:*:log-group:/OracleHeatWave/metrics:*"
}
]
}
This permission settings allows the DB System to publish custom metrics to the
OracleHeatWave namespace in CloudWatch, create log
groups /OracleHeatWave/metrics:*
and log
streams, and perform basic logging operations. Click
Next after you have finished the
editing.
- On the Review and create page, review the policy,
provide a Policy name for it (for example,
OracleHeatWaveMonitoringPermissions
), and click
Create policy.
- In the Summary section, copy the role's ARN. You will need it
later.
After you create the role, enter the role ARN in an existing
DB System, or create a new
DB System and enter the ARN to
the
Monitoring configuration. See
Editing a DB System and
Creating a DB System.