Identity and access management for Amazon CloudWatch
Amazon Identity and Access Management (IAM) is an Amazon Web Service that helps an administrator securely control access to Amazon resources. IAM administrators control who can be authenticated (signed in) and authorized (have permissions) to use CloudWatch resources. IAM is an Amazon Web Service that you can use with no additional charge.
Topics
- Audience
- Authenticating with identities
- Managing access using policies
- How Amazon CloudWatch works with IAM
- Identity-based policy examples for Amazon CloudWatch
- Troubleshooting Amazon CloudWatch identity and access
- CloudWatch dashboard permissions update
- Amazon managed (predefined) policies for CloudWatch
- Customer managed policy examples
- CloudWatch updates to Amazon managed policies
- Using condition keys to limit access to CloudWatch namespaces
- Using condition keys to limit Contributor Insights users' access to log groups
- Using condition keys to limit alarm actions
- Using service-linked roles for CloudWatch
- Using service-linked roles for CloudWatch RUM
- Using service-linked roles for CloudWatch Application Insights
- Amazon managed policies for Amazon CloudWatch Application Insights
- Amazon CloudWatch permissions reference
Audience
How you use Amazon Identity and Access Management (IAM) differs, depending on the work that you do in CloudWatch.
Service user – If you use the CloudWatch service to do your job, then your administrator provides you with the credentials and permissions that you need. As you use more CloudWatch features to do your work, you might need additional permissions. Understanding how access is managed can help you request the right permissions from your administrator. If you cannot access a feature in CloudWatch, see Troubleshooting Amazon CloudWatch identity and access.
Service administrator – If you're in charge of CloudWatch resources at your company, you probably have full access to CloudWatch. It's your job to determine which CloudWatch features and resources your service users should access. You must then submit requests to your IAM administrator to change the permissions of your service users. Review the information on this page to understand the basic concepts of IAM. To learn more about how your company can use IAM with CloudWatch, see How Amazon CloudWatch works with IAM.
IAM administrator – If you're an IAM administrator, you might want to learn details about how you can write policies to manage access to CloudWatch. To view example CloudWatch identity-based policies that you can use in IAM, see Identity-based policy examples for Amazon CloudWatch.
Authenticating with identities
Authentication is how you sign in to Amazon using your identity credentials. You must be authenticated (signed in to Amazon) as the Amazon Web Services account root user, as an IAM user, or by assuming an IAM role.
If you access Amazon programmatically, Amazon provides a software development kit (SDK) and a command line interface (CLI) to cryptographically sign your requests by using your credentials. If you don't use Amazon tools, you must sign requests yourself. For more information about using the recommended method to sign requests yourself, see Signing Amazon API requests in the IAM User Guide.
Regardless of the authentication method that you use, you might be required to provide additional security information. For example, Amazon recommends that you use multi-factor authentication (MFA) to increase the security of your account. To learn more, see Using multi-factor authentication (MFA) in Amazon in the IAM User Guide.
Amazon Web Services account root user
When you create an Amazon Web Services account, you begin with one sign-in identity that has complete access to all Amazon Web Services and resources in the account. This identity is called the Amazon Web Services account root user and is accessed by signing in with the email address and password that you used to create the account. We strongly recommend that you don't use the root user for your everyday tasks. Safeguard your root user credentials and use them to perform the tasks that only the root user can perform. For the complete list of tasks that require you to sign in as the root user, see Tasks that require root user credentials in the IAM User Guide.
Federated identity
As a best practice, require human users, including users that require administrator access, to use federation with an identity provider to access Amazon Web Services by using temporary credentials.
A federated identity is a user from your enterprise user directory, a web identity provider, the Amazon Directory Service, or any user that accesses Amazon Web Services by using credentials provided through an identity source. When federated identities access Amazon Web Services accounts, they assume roles, and the roles provide temporary credentials.
IAM users and groups
An IAM user is an identity within your Amazon Web Services account that has specific permissions for a single person or application. Where possible, we recommend relying on temporary credentials instead of creating IAM users who have long-term credentials such as passwords and access keys. However, if you have specific use cases that require long-term credentials with IAM users, we recommend that you rotate access keys. For more information, see Rotate access keys regularly for use cases that require long-term credentials in the IAM User Guide.
An IAM group is an identity that specifies a collection of IAM users. You can't sign in as a group. You can use groups to specify permissions for multiple users at a time. Groups make permissions easier to manage for large sets of users. For example, you could have a group named IAMAdmins and give that group permissions to administer IAM resources.
Users are different from roles. A user is uniquely associated with one person or application, but a role is intended to be assumable by anyone who needs it. Users have permanent long-term credentials, but roles provide temporary credentials. To learn more, see When to create an IAM user (instead of a role) in the IAM User Guide.
IAM roles
An IAM role is an identity within your Amazon Web Services account that has specific permissions. It is similar to an IAM user, but is not associated with a specific person. You can temporarily assume an IAM role in the Amazon Web Services Management Console by switching roles. You can assume a role by calling an Amazon CLI or Amazon API operation or by using a custom URL. For more information about methods for using roles, see Using IAM roles in the IAM User Guide.
IAM roles with temporary credentials are useful in the following situations:
-
Federated user access – To assign permissions to a federated identity, you create a role and define permissions for the role. When a federated identity authenticates, the identity is associated with the role and is granted the permissions that are defined by the role. For information about roles for federation, see Creating a role for a third-party Identity Provider in the IAM User Guide.
-
Temporary IAM user permissions – An IAM user or role can assume an IAM role to temporarily take on different permissions for a specific task.
-
Cross-account access – You can use an IAM role to allow someone (a trusted principal) in a different account to access resources in your account. Roles are the primary way to grant cross-account access. However, with some Amazon Web Services, you can attach a policy directly to a resource (instead of using a role as a proxy). To learn the difference between roles and resource-based policies for cross-account access, see How IAM roles differ from resource-based policies in the IAM User Guide.
-
Cross-service access – Some Amazon Web Services use features in other Amazon Web Services. For example, when you make a call in a service, it's common for that service to run applications in Amazon EC2 or store objects in Amazon S3. A service might do this using the calling principal's permissions, using a service role, or using a service-linked role.
-
Principal permissions – When you use an IAM user or role to perform actions in Amazon, you are considered a principal. Policies grant permissions to a principal. When you use some services, you might perform an action that then triggers another action in a different service. In this case, you must have permissions to perform both actions. To see whether an action requires additional dependent actions in a policy, see Actions, resources, and condition keys for Amazon CloudWatch in the Service Authorization Reference.
-
Service role – A service role is an IAM role that a service assumes to perform actions on your behalf. An IAM administrator can create, modify, and delete a service role from within IAM. For more information, see Creating a role to delegate permissions to an Amazon Web Service in the IAM User Guide.
-
Service-linked role – A service-linked role is a type of service role that is linked to an Amazon Web Service. The service can assume the role to perform an action on your behalf. Service-linked roles appear in your Amazon Web Services account and are owned by the service. An IAM administrator can view, but not edit the permissions for service-linked roles.
-
-
Applications running on Amazon EC2 – You can use an IAM role to manage temporary credentials for applications that are running on an EC2 instance and making Amazon CLI or Amazon API requests. This is preferable to storing access keys within the EC2 instance. To assign an Amazon role to an EC2 instance and make it available to all of its applications, you create an instance profile that is attached to the instance. An instance profile contains the role and enables programs that are running on the EC2 instance to get temporary credentials. For more information, see Using an IAM role to grant permissions to applications running on Amazon EC2 instances in the IAM User Guide.
To learn whether to use IAM roles or IAM users, see When to create an IAM role (instead of a user) in the IAM User Guide.
Managing access using policies
You control access in Amazon by creating policies and attaching them to Amazon identities or resources. A policy is an object in Amazon that, when associated with an identity or resource, defines their permissions. Amazon evaluates these policies when a principal (user, root user, or role session) makes a request. Permissions in the policies determine whether the request is allowed or denied. Most policies are stored in Amazon as JSON documents. For more information about the structure and contents of JSON policy documents, see Overview of JSON policies in the IAM User Guide.
Administrators can use Amazon JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions.
By default, users and roles have no permissions. To grant users permission to perform actions on the resources that they need, an IAM administrator can create IAM policies. The administrator can then add the IAM policies to roles, and users can assume the roles.
IAM policies define permissions for an action regardless of the method that you use to perform the operation. For example, suppose that you have a
policy that allows the iam:GetRole
action. A user with that policy can get role information from the Amazon Web Services Management Console, the Amazon CLI, or the Amazon
API.
Identity-based policies
Identity-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, group of users, or role. These policies control what actions users and roles can perform, on which resources, and under what conditions. To learn how to create an identity-based policy, see Creating IAM policies in the IAM User Guide.
Identity-based policies can be further categorized as inline policies or managed policies. Inline policies are embedded directly into a single user, group, or role. Managed policies are standalone policies that you can attach to multiple users, groups, and roles in your Amazon Web Services account. Managed policies include Amazon managed policies and customer managed policies. To learn how to choose between a managed policy or an inline policy, see Choosing between managed policies and inline policies in the IAM User Guide.
Resource-based policies
Resource-based policies are JSON policy documents that you attach to a resource. Examples of resource-based policies are IAM role trust policies and Amazon S3 bucket policies. In services that support resource-based policies, service administrators can use them to control access to a specific resource. For the resource where the policy is attached, the policy defines what actions a specified principal can perform on that resource and under what conditions. You must specify a principal in a resource-based policy. Principals can include accounts, users, roles, federated users, or Amazon Web Services.
Resource-based policies are inline policies that are located in that service. You can't use Amazon managed policies from IAM in a resource-based policy.
Access control lists (ACLs)
Access control lists (ACLs) control which principals (account members, users, or roles) have permissions to access a resource. ACLs are similar to resource-based policies, although they do not use the JSON policy document format.
Amazon S3, Amazon WAF, and Amazon VPC are examples of services that support ACLs. To learn more about ACLs, see Access control list (ACL) overview in the Amazon Simple Storage Service Developer Guide.
Other policy types
Amazon supports additional, less-common policy types. These policy types can set the maximum permissions granted to you by the more common policy types.
-
Permissions boundaries – A permissions boundary is an advanced feature in which you set the maximum permissions that an identity-based policy can grant to an IAM entity (IAM user or role). You can set a permissions boundary for an entity. The resulting permissions are the intersection of an entity's identity-based policies and its permissions boundaries. Resource-based policies that specify the user or role in the
Principal
field are not limited by the permissions boundary. An explicit deny in any of these policies overrides the allow. For more information about permissions boundaries, see Permissions boundaries for IAM entities in the IAM User Guide. -
Service control policies (SCPs) – SCPs are JSON policies that specify the maximum permissions for an organization or organizational unit (OU) in Amazon Organizations. Amazon Organizations is a service for grouping and centrally managing multiple Amazon Web Services accounts that your business owns. If you enable all features in an organization, then you can apply service control policies (SCPs) to any or all of your accounts. The SCP limits permissions for entities in member accounts, including each Amazon Web Services account root user. For more information about Organizations and SCPs, see How SCPs work in the Amazon Organizations User Guide.
-
Session policies – Session policies are advanced policies that you pass as a parameter when you programmatically create a temporary session for a role or federated user. The resulting session's permissions are the intersection of the user or role's identity-based policies and the session policies. Permissions can also come from a resource-based policy. An explicit deny in any of these policies overrides the allow. For more information, see Session policies in the IAM User Guide.
Multiple policy types
When multiple types of policies apply to a request, the resulting permissions are more complicated to understand. To learn how Amazon determines whether to allow a request when multiple policy types are involved, see Policy evaluation logic in the IAM User Guide.
Amazon managed (predefined) policies for CloudWatch
Amazon addresses many common use cases by providing standalone IAM policies that are created and administered by Amazon. These Amazon managed policies grant necessary permissions for common use cases so that you can avoid having to investigate what permissions are needed. For more information, see Amazon managed policies in the IAM User Guide.
The following Amazon managed policies, which you can attach to users in your account, are specific to CloudWatch.
Topics
- CloudWatchFullAccessV2
- CloudWatchFullAccess
- CloudWatchReadOnlyAccess
- CloudWatchActionsEC2Access
- CloudWatchAutomaticDashboardsAccess
- CloudWatchAgentServerPolicy
- CloudWatchAgentAdminPolicy
- Amazon managed (predefined) policies for CloudWatch cross-account observability
- Amazon managed (predefined) policies for CloudWatch Synthetics
- Amazon managed (predefined) policies for Amazon CloudWatch RUM
- Amazon managed (predefined) policies for CloudWatch Evidently
- Amazon managed policy for Amazon Systems Manager Incident Manager
CloudWatchFullAccessV2
Amazon recently added the CloudWatchFullAccessV2 manged IAM policy. This policy grants full access to CloudWatch actions and resources and also more properly scopes the permissions granted for other services such as Amazon SNS and Amazon EC2 Auto Scaling. We recommend that you begin using this policy instead of using CloudWatchFullAccess. Amazon plans to deprecate CloudWatchFullAccess in the near future.
It includes some autoscaling:Describe
permissions
so that users with this policy can see the Auto Scaling actions that are associated with CloudWatch alarms.
It includes some sns
permissions so that users with this policy can retrieve create
Amazon SNS topics and associate them with CloudWatch alarms. It includes IAM permissions so that
users with this policy can view information about service-linked roles associated with CloudWatch.
It includes the oam:ListSinks
and
oam:ListAttachedLinks
permissions
so that users with this policy can use the console to view data shared from source
accounts in CloudWatch cross-account observability.
Its contents are as follows:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "CloudWatchFullAccessPermissions", "Effect": "Allow", "Action": [ "application-autoscaling:DescribeScalingPolicies", "autoscaling:DescribeAutoScalingGroups", "autoscaling:DescribePolicies", "cloudwatch:*", "logs:*", "sns:CreateTopic", "sns:ListSubscriptions", "sns:ListSubscriptionsByTopic", "sns:ListTopics", "sns:Subscribe", "iam:GetPolicy", "iam:GetPolicyVersion", "iam:GetRole", "oam:ListSinks" ], "Resource": "*" }, { "Sid": "EventsServicePermissions", "Effect": "Allow", "Action": "iam:CreateServiceLinkedRole", "Resource": "arn:aws:iam::*:role/aws-service-role/events.amazonaws.com/AWSServiceRoleForCloudWatchEvents*", "Condition": { "StringLike": { "iam:AWSServiceName": "events.amazonaws.com" } } }, { "Sid": "OAMReadPermissions", "Effect": "Allow", "Action": [ "oam:ListAttachedLinks" ], "Resource": "arn:aws:oam:*:*:sink/*" } ] }
CloudWatchFullAccess
The CloudWatchFullAccess policy is on the path to deprecation. We recommend that you stop using it, and use CloudWatchFullAccessV2 instead.
Its contents are as follows:
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ "autoscaling:Describe*", "cloudwatch:*", "logs:*", "sns:*", "iam:GetPolicy", "iam:GetPolicyVersion", "iam:GetRole", "oam:ListSinks" ], "Resource": "*" }, { "Effect": "Allow", "Action": "iam:CreateServiceLinkedRole", "Resource": "arn:aws:iam::*:role/aws-service-role/events.amazonaws.com/AWSServiceRoleForCloudWatchEvents*", "Condition": { "StringLike": { "iam:AWSServiceName": "events.amazonaws.com" } } }, { "Effect": "Allow", "Action": [ "oam:ListAttachedLinks" ], "Resource": "arn:aws:oam:*:*:sink/*" } ] }
CloudWatchReadOnlyAccess
The CloudWatchReadOnlyAccess policy grants read-only access to CloudWatch.
It
includes some logs:
permissions so that users with this policy can use the console
to view CloudWatch Logs information and to use CloudWatch Logs Insights queries. It includes autoscaling:Describe*
so that users with this policy can see the Auto Scaling actions that are associated with CloudWatch alarms.
It includes application-autoscaling:DescribeScalingPolicies
so that users with this policy can access information about Application Auto Scaling policies.
It includes sns:Get*
and
sns:List*
so that users with this policy can retrieve information about the Amazon SNS topics
that receive notifications about CloudWatch alarms. It includes the oam:ListSinks
and
oam:ListAttachedLinks
permissions
so that users with this policy can use the console to view data shared from source
accounts in CloudWatch cross-account observability.
The following is the content of the CloudWatchReadOnlyAccess policy.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "application-autoscaling:DescribeScalingPolicies", "autoscaling:Describe*", "cloudwatch:Describe*", "cloudwatch:Get*", "cloudwatch:List*", "logs:Get*", "logs:List*", "logs:StartQuery", "logs:StopQuery", "logs:Describe*", "logs:TestMetricFilter", "logs:FilterLogEvents", "logs:StartLiveTail", "logs:StopLiveTail", "oam:ListSinks", "sns:Get*", "sns:List*" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "oam:ListAttachedLinks" ], "Resource": "arn:aws:oam:*:*:sink/*" } ] }
CloudWatchActionsEC2Access
The CloudWatchActionsEC2Access policy grants read-only access to CloudWatch alarms and metrics in addition to Amazon EC2 metadata. It also grants access to the Stop, Terminate, and Reboot API actions for EC2 instances.
The following is the content of the CloudWatchActionsEC2Access policy.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "cloudwatch:Describe*", "ec2:Describe*", "ec2:RebootInstances", "ec2:StopInstances", "ec2:TerminateInstances" ], "Resource": "*" } ] }
CloudWatchAutomaticDashboardsAccess
The CloudWatch-CrossAccountAccess managed policy is used by the CloudWatch-CrossAccountSharingRole IAM role. This role and policy enable users of cross-account dashboards to view automatic dashboards in each account that is sharing dashboards.
The following is the content of CloudWatchAutomaticDashboardsAccess:
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "autoscaling:DescribeAutoScalingGroups", "cloudfront:GetDistribution", "cloudfront:ListDistributions", "dynamodb:DescribeTable", "dynamodb:ListTables", "ec2:DescribeInstances", "ec2:DescribeVolumes", "ecs:DescribeClusters", "ecs:DescribeContainerInstances", "ecs:ListClusters", "ecs:ListContainerInstances", "ecs:ListServices", "elasticache:DescribeCacheClusters", "elasticbeanstalk:DescribeEnvironments", "elasticfilesystem:DescribeFileSystems", "elasticloadbalancing:DescribeLoadBalancers", "kinesis:DescribeStream", "kinesis:ListStreams", "lambda:GetFunction", "lambda:ListFunctions", "rds:DescribeDBClusters", "rds:DescribeDBInstances", "resource-groups:ListGroupResources", "resource-groups:ListGroups", "route53:GetHealthCheck", "route53:ListHealthChecks", "s3:ListAllMyBuckets", "s3:ListBucket", "sns:ListTopics", "sqs:GetQueueAttributes", "sqs:GetQueueUrl", "sqs:ListQueues", "synthetics:DescribeCanariesLastRun", "tag:GetResources" ], "Effect": "Allow", "Resource": "*" }, { "Action": [ "apigateway:GET" ], "Effect": "Allow", "Resource": [ "arn:aws:apigateway:*::/restapis*" ] } ]
CloudWatchAgentServerPolicy
The CloudWatchAgentServerPolicy policy can be used in IAM roles that are attached to Amazon EC2 instances to allow the CloudWatch agent to read information from the instance and write it to CloudWatch.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "cloudwatch:PutMetricData", "ec2:DescribeVolumes", "ec2:DescribeTags", "logs:PutLogEvents", "logs:DescribeLogStreams", "logs:DescribeLogGroups", "logs:CreateLogStream", "logs:CreateLogGroup" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "ssm:GetParameter" ], "Resource": "arn:aws:ssm:*:*:parameter/AmazonCloudWatch-*" } ] }
CloudWatchAgentAdminPolicy
The CloudWatchAgentAdminPolicy policy can be used in IAM roles that are attached to Amazon EC2 instances. This policy allows the CloudWatch agent to read information from the instance and write it to CloudWatch, and also to write information to Parameter Store.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "cloudwatch:PutMetricData", "ec2:DescribeTags", "logs:PutLogEvents", "logs:DescribeLogStreams", "logs:DescribeLogGroups", "logs:CreateLogStream", "logs:CreateLogGroup" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "ssm:GetParameter", "ssm:PutParameter" ], "Resource": "arn:aws:ssm:*:*:parameter/AmazonCloudWatch-*" } ] }
Note
You can review these permissions policies by signing in to the IAM console and searching for specific policies there.
You can also create your own custom IAM policies to allow permissions for CloudWatch actions and resources. You can attach these custom policies to the IAM users or groups that require those permissions.
Amazon managed (predefined) policies for CloudWatch cross-account observability
The policies in this section grant permissions related to CloudWatch cross-account observability. For more information, see CloudWatch cross-account observability.
CloudWatchCrossAccountSharingConfiguration
The CloudWatchCrossAccountSharingConfiguration policy grants access to create, manage, and view Observability Access Manager links for sharing CloudWatch resources between accounts. For more information, see CloudWatch cross-account observability. The contents are as follows:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "cloudwatch:Link", "oam:ListLinks" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "oam:DeleteLink", "oam:GetLink", "oam:TagResource" ], "Resource": "arn:aws:oam:*:*:link/*" }, { "Effect": "Allow", "Action": [ "oam:CreateLink", "oam:UpdateLink" ], "Resource": [ "arn:aws:oam:*:*:link/*", "arn:aws:oam:*:*:sink/*" ] } ] }
OAMFullAccess
The OAMFullAccess policy grants access to create, manage, and view Observability Access Manager sinks and links, which are used for CloudWatch cross-account observability.
The OAMFullAccess policy by itself does not permit you to share observability data across links. To create a link to share CloudWatch metrics, you also need either CloudWatchFullAccess or CloudWatchCrossAccountSharingConfiguration. To create a link to share CloudWatch Logs log groups, you also need either CloudWatchLogsFullAccess or CloudWatchLogsCrossAccountSharingConfiguration. To create a link to share X-Ray traces, you also need either AWSXRayFullAccess or AWSXRayCrossAccountSharingConfiguration.
For more information, see CloudWatch cross-account observability. The contents are as follows:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "oam:*" ], "Resource": "*" } ] }
OAMReadOnlyAccess
The OAMReadOnlyAccess policy grants read-only access to Observability Access Manager resources, which are used for CloudWatch cross-account observability. For more information, see CloudWatch cross-account observability. The contents are as follows:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "oam:Get*", "oam:List*" ], "Resource": "*" } ] }
Amazon managed (predefined) policies for CloudWatch Synthetics
The CloudWatchSyntheticsFullAccess and CloudWatchSyntheticsReadOnlyAccess Amazon managed policies are available for you to assign to users who will manage or use CloudWatch Synthetics. The following additional policies are also relevant:
AmazonS3ReadOnlyAccess and CloudWatchReadOnlyAccess – These are necessary to be able to read all Synthetics data in the CloudWatch console.
AWSLambdaReadOnlyAccess – To be able to view the source code used by canaries.
-
CloudWatchSyntheticsFullAccess enables you to create canaries, Additionally, to create and delete canaries that have a new IAM role created for them, you also need the following inline policy statement:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "iam:CreateRole", "iam:DeleteRole", "iam:CreatePolicy", "iam:DeletePolicy", "iam:AttachRolePolicy", "iam:DetachRolePolicy", ], "Resource": [ "arn:aws:iam::*:role/service-role/CloudWatchSyntheticsRole*", "arn:aws:iam::*:policy/service-role/CloudWatchSyntheticsPolicy*" ] } ] }
Important
Granting a user the
iam:CreateRole
,iam:DeleteRole
,iam:CreatePolicy
,iam:DeletePolicy
,iam:AttachRolePolicy
, andiam:DetachRolePolicy
permissions gives that user full administrative access to create, attach, and delete roles and policies that have ARNs that matcharn:aws:iam::*:role/service-role/CloudWatchSyntheticsRole*
andarn:aws:iam::*:policy/service-role/CloudWatchSyntheticsPolicy*
. For example, a user with these permissions can create a policy that has full permissions for all resources, and attach that policy to any role that matches that ARN pattern. Be very careful about who you grant these permissions to.For information about attaching policies and granting permissions to users, see Changing Permissions for an IAM User and To embed an inline policy for a user or role.
CloudWatchSyntheticsFullAccess
The following is the content of the CloudWatchSyntheticsFullAccess policy.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "synthetics:*" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "s3:CreateBucket", "s3:PutEncryptionConfiguration" ], "Resource": [ "arn:aws:s3:::cw-syn-results-*" ] }, { "Effect": "Allow", "Action": [ "iam:ListRoles", "s3:ListAllMyBuckets", "xray:GetTraceSummaries", "xray:BatchGetTraces", "apigateway:GET" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "s3:GetBucketLocation" ], "Resource": "arn:aws:s3:::*" }, { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": "arn:aws:s3:::cw-syn-*" }, { "Effect": "Allow", "Action": [ "s3:GetObjectVersion" ], "Resource": "arn:aws:s3:::aws-synthetics-library-*" }, { "Effect": "Allow", "Action": [ "iam:PassRole" ], "Resource": [ "arn:aws:iam::*:role/service-role/CloudWatchSyntheticsRole*" ], "Condition": { "StringEquals": { "iam:PassedToService": [ "lambda.amazonaws.com", "synthetics.amazonaws.com" ] } } }, { "Effect": "Allow", "Action": [ "iam:GetRole", "iam:ListAttachedRolePolicies" ], "Resource": [ "arn:aws:iam::*:role/service-role/CloudWatchSyntheticsRole*" ] }, { "Effect": "Allow", "Action": [ "cloudwatch:GetMetricData", "cloudwatch:GetMetricStatistics" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "cloudwatch:PutMetricAlarm", "cloudwatch:DeleteAlarms" ], "Resource": [ "arn:aws:cloudwatch:*:*:alarm:Synthetics-*" ] }, { "Effect": "Allow", "Action": [ "cloudwatch:DescribeAlarms" ], "Resource": [ "arn:aws:cloudwatch:*:*:alarm:*" ] }, { "Effect": "Allow", "Action": [ "lambda:CreateFunction", "lambda:AddPermission", "lambda:PublishVersion", "lambda:UpdateFunctionCode", "lambda:UpdateFunctionConfiguration", "lambda:GetFunctionConfiguration", "lambda:DeleteFunction" ], "Resource": [ "arn:aws:lambda:*:*:function:cwsyn-*" ] }, { "Effect": "Allow", "Action": [ "lambda:GetLayerVersion", "lambda:PublishLayerVersion", "lambda:DeleteLayerVersion" ], "Resource": [ "arn:aws:lambda:*:*:layer:cwsyn-*", "arn:aws:lambda:*:*:layer:Synthetics:*" ] }, { "Effect": "Allow", "Action": [ "ec2:DescribeVpcs", "ec2:DescribeSubnets", "ec2:DescribeSecurityGroups" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "sns:ListTopics" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "sns:CreateTopic", "sns:Subscribe", "sns:ListSubscriptionsByTopic" ], "Resource": [ "arn:*:sns:*:*:Synthetics-*" ] }, { "Effect": "Allow", "Action": [ "kms:ListAliases" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "kms:DescribeKey" ], "Resource": "arn:aws:kms:*:*:key/*" }, { "Effect": "Allow", "Action": [ "kms:Decrypt" ], "Resource": "arn:aws:kms:*:*:key/*", "Condition": { "StringLike": { "kms:ViaService": [ "s3.*.amazonaws.com" ] } } } ] }
CloudWatchSyntheticsReadOnlyAccess
The following is the content of the CloudWatchSyntheticsReadOnlyAccess policy.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "synthetics:Describe*", "synthetics:Get*", "synthetics:List*", "lambda:GetFunctionConfiguration" ], "Resource": "*" } ] }
Amazon managed (predefined) policies for Amazon CloudWatch RUM
The AmazonCloudWatchRUMFullAccess and AmazonCloudWatchRUMReadOnlyAccess Amazon managed policies are available for you to assign to users who will manage or use CloudWatch RUM.
AmazonCloudWatchRUMFullAccess
The following are the contents of the AmazonCloudWatchRUMFullAccess policy.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "rum:*" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "iam:GetRole", "iam:CreateServiceLinkedRole" ], "Resource": [ "arn:aws:iam::*:role/aws-service-role/rum.amazonaws.com/AWSServiceRoleForRealUserMonitoring" ] }, { "Effect": "Allow", "Action": [ "iam:PassRole" ], "Resource": [ "arn:aws:iam::*:role/RUM-Monitor*" ], "Condition": { "StringEquals": { "iam:PassedToService": [ "cognito-identity.amazonaws.com" ] } } }, { "Effect": "Allow", "Action": [ "cloudwatch:GetMetricData", "cloudwatch:GetMetricStatistics", "cloudwatch:ListMetrics" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "cloudwatch:DescribeAlarms" ], "Resource": "arn:aws:cloudwatch:*:*:alarm:*" }, { "Effect": "Allow", "Action": [ "cognito-identity:CreateIdentityPool", "cognito-identity:ListIdentityPools", "cognito-identity:DescribeIdentityPool", "cognito-identity:GetIdentityPoolRoles", "cognito-identity:SetIdentityPoolRoles" ], "Resource": "arn:aws:cognito-identity:*:*:identitypool/*" }, { "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:DeleteLogGroup", "logs:PutRetentionPolicy", "logs:CreateLogStream" ], "Resource": "arn:aws:logs:*:*:log-group:*RUMService*" }, { "Effect": "Allow", "Action": [ "logs:CreateLogDelivery", "logs:GetLogDelivery", "logs:UpdateLogDelivery", "logs:DeleteLogDelivery", "logs:ListLogDeliveries", "logs:DescribeResourcePolicies" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "logs:DescribeLogGroups" ], "Resource": "arn:aws:logs:*:*:log-group::log-stream:*" }, { "Effect": "Allow", "Action": [ "synthetics:describeCanaries", "synthetics:describeCanariesLastRun" ], "Resource": "arn:aws:synthetics:*:*:canary:*" } ] }
AmazonCloudWatchRUMReadOnlyAccess
The following are the contents of the AmazonCloudWatchRUMReadOnlyAccess policy.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "rum:GetAppMonitor", "rum:GetAppMonitorData", "rum:ListAppMonitors", "rum:ListRumMetricsDestinations", "rum:BatchGetRumMetricDefinitions" ], "Resource": "*" } ] }
AmazonCloudWatchRUMServiceRolePolicy
You can't attach AmazonCloudWatchRUMServiceRolePolicy to your IAM entities. This policy is attached to a service-linked role that allows CloudWatch RUM to publish monitoring data to other relevant Amazon services. For more information about this service linked role, see Using service-linked roles for CloudWatch RUM.
The complete contents of AmazonCloudWatchRUMServiceRolePolicy are as follows.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "xray:PutTraceSegments" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": "cloudwatch:PutMetricData", "Resource": "*", "Condition": { "StringLike": { "cloudwatch:namespace": [ "RUM/CustomMetrics/*", "AWS/RUM" ] } } } ] }
Amazon managed (predefined) policies for CloudWatch Evidently
The CloudWatchEvidentlyFullAccess and CloudWatchEvidentlyReadOnlyAccess Amazon managed policies are available for you to assign to users who will manage or use CloudWatch Evidently.
CloudWatchEvidentlyFullAccess
The following are the contents of the CloudWatchEvidentlyFullAccess policy.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "evidently:*" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "iam:ListRoles" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "iam:GetRole" ], "Resource": [ "arn:aws:iam::*:role/service-role/CloudWatchRUMEvidentlyRole-*" ] }, { "Effect": "Allow", "Action": [ "s3:GetBucketLocation", "s3:ListAllMyBuckets" ], "Resource": "arn:aws:s3:::*" }, { "Effect": "Allow", "Action": [ "cloudwatch:GetMetricData", "cloudwatch:GetMetricStatistics", "cloudwatch:DescribeAlarmHistory", "cloudwatch:DescribeAlarmsForMetric", "cloudwatch:ListTagsForResource" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "cloudwatch:DescribeAlarms", "cloudwatch:TagResource", "cloudwatch:UnTagResource" ], "Resource": [ "arn:aws:cloudwatch:*:*:alarm:*" ] }, { "Effect": "Allow", "Action": [ "cloudtrail:LookupEvents" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "cloudwatch:PutMetricAlarm" ], "Resource": [ "arn:aws:cloudwatch:*:*:alarm:Evidently-Alarm-*" ] }, { "Effect": "Allow", "Action": [ "sns:ListTopics" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "sns:CreateTopic", "sns:Subscribe", "sns:ListSubscriptionsByTopic" ], "Resource": [ "arn:*:sns:*:*:Evidently-*" ] }, { "Effect": "Allow", "Action": [ "logs:DescribeLogGroups" ], "Resource": [ "*" ] } ] }
CloudWatchEvidentlyReadOnlyAccess
The following are the contents of the CloudWatchEvidentlyReadOnlyAccess policy.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "evidently:GetExperiment", "evidently:GetFeature", "evidently:GetLaunch", "evidently:GetProject", "evidently:GetSegment", "evidently:ListExperiments", "evidently:ListFeatures", "evidently:ListLaunches", "evidently:ListProjects", "evidently:ListSegments", "evidently:ListSegmentReferencs" ], "Resource": "*" } ] }
Amazon managed policy for Amazon Systems Manager Incident Manager
The AWSCloudWatchAlarms_ActionSSMIncidentsServiceRolePolicy policy is attached to a service-linked role that allows CloudWatch to start incidents in Amazon Systems Manager Incident Manager on your behalf. For more information, see Service-linked role permissions for CloudWatch alarms Systems Manager Incident Manager actions.
The policy has the following permission:
ssm-incidents:StartIncident
Customer managed policy examples
In this section, you can find example user policies that grant permissions for various CloudWatch actions. These policies work when you are using the CloudWatch API, Amazon SDKs, or the Amazon CLI.
Examples
Example 1: Allow user full access to CloudWatch
To grant a user full access to CloudWatch, you can use grant them the CloudWatchFullAccess managed policy instead of creating a customer-managed policy. The contents of the CloudWatchFullAccess are listed in CloudWatchFullAccess.
Example 2: Allow read-only access to CloudWatch
The following policy allows a user read-only access to CloudWatch and view Amazon EC2 Auto Scaling actions, CloudWatch metrics, CloudWatch Logs data, and alarm-related Amazon SNS data.
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "autoscaling:Describe*", "cloudwatch:Describe*", "cloudwatch:Get*", "cloudwatch:List*", "logs:Get*", "logs:Describe*", "logs:StartQuery", "logs:StopQuery", "logs:TestMetricFilter", "logs:FilterLogEvents", "logs:StartLiveTail", "logs:StopLiveTail", "sns:Get*", "sns:List*" ], "Effect": "Allow", "Resource": "*" } ] }
Example 3: Stop or terminate an Amazon EC2 instance
The following policy allows an CloudWatch alarm action to stop or terminate an EC2 instance. In the sample below, the GetMetricData, ListMetrics, and DescribeAlarms actions are optional. It is recommended that you include these actions to ensure that you have correctly stopped or terminated the instance.
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "cloudwatch:PutMetricAlarm", "cloudwatch:GetMetricData", "cloudwatch:ListMetrics", "cloudwatch:DescribeAlarms" ], "Resource": [ "*" ], "Effect": "Allow" }, { "Action": [ "ec2:DescribeInstanceStatus", "ec2:DescribeInstances", "ec2:StopInstances", "ec2:TerminateInstances" ], "Resource": [ "*" ], "Effect": "Allow" } ] }
CloudWatch updates to Amazon managed policies
View details about updates to Amazon managed policies for CloudWatch since this service began tracking these changes. For automatic alerts about changes to this page, subscribe to the RSS feed on the CloudWatch Document history page.
Change | Description | Date |
---|---|---|
AWSServiceRoleForCloudWatchMetrics_DbPerfInsightsServiceRolePolicy – New policy |
CloudWatch added a new policy AWSServiceRoleForCloudWatchMetrics_DbPerfInsightsServiceRolePolicy. The AWSServiceRoleForCloudWatchMetrics_DbPerfInsightsServiceRolePolicy grants permission to CloudWatch to fetch Performance Insights metrics from databases on your behalf. |
September 20, 2023 |
CloudWatchReadOnlyAccess – Update to an existing policy |
CloudWatch added a permission to CloudWatchReadOnlyAccess. The |
September 14, 2023 |
CloudWatchFullAccessV2 – New policy |
CloudWatch added a new policy CloudWatchFullAccessV2. The CloudWatchFullAccessV2 grants full access to CloudWatch actions and resources while better scoping the permissions granted to other services such as Amazon SNS and Amazon EC2 Auto Scaling. For more information, see CloudWatchFullAccessV2. |
August 1, 2023 |
AWSServiceRoleForInternetMonitor – Update to an existing policy |
Amazon CloudWatch Internet Monitor added new permissions to monitor Network Load Balancer resources. The For more information, see Using Amazon CloudWatch Internet Monitor. |
July 15, 2023 |
CloudWatchReadOnlyAccess – Update to an existing policy |
CloudWatch added permissions to CloudWatchReadOnlyAccess. The |
June 6, 2023 |
CloudWatchCrossAccountSharingConfiguration – New policy |
CloudWatch added a new policy to enable you to manage CloudWatch cross-account observability links that share CloudWatch metrics. For more information, see CloudWatch cross-account observability. |
November 27, 2022 |
OAMFullAccess – New policy |
CloudWatch added a new policy to enable you to fully manage CloudWatch cross-account observability links and sinks. For more information, see CloudWatch cross-account observability. |
November 27, 2022 |
OAMReadOnlyAccess – New policy |
CloudWatch added a new policy to enable you to view information about CloudWatch cross-account observability links and sinks. For more information, see CloudWatch cross-account observability. |
November 27, 2022 |
CloudWatchFullAccess – Update to an existing policy |
CloudWatch added permissions to CloudWatchFullAccess. The |
November 27, 2022 |
CloudWatchReadOnlyAccess – Update to an existing policy |
CloudWatch added permissions to CloudWatchReadOnlyAccess. The |
November 27, 2022 |
AmazonCloudWatchRUMServiceRolePolicy – Update to an existing policy |
CloudWatch RUM updated a condition key in AmazonCloudWatchRUMServiceRolePolicy. The
|
February 2, 2023 |
AmazonCloudWatchRUMReadOnlyAccess – Updated policy |
CloudWatch added permissions the AmazonCloudWatchRUMReadOnlyAccess policy. The |
October 27, 2022 |
AmazonCloudWatchRUMServiceRolePolicy – Update to an existing policy |
CloudWatch RUM added permissions to AmazonCloudWatchRUMServiceRolePolicy. The |
October 26, 2022 |
CloudWatchEvidentlyReadOnlyAccess – Update to an existing policy |
CloudWatch Evidently added permissions to CloudWatchEvidentlyReadOnlyAccess. The |
August 12, 2022 |
CloudWatchSyntheticsFullAccess – Update to an existing policy |
CloudWatch Synthetics added permissions to CloudWatchSyntheticsFullAccess. The |
May 6, 2022 |
AmazonCloudWatchRUMFullAccess – New policy |
CloudWatch added a new policy to enable full management of CloudWatch RUM. CloudWatch RUM allows you to perform real user monitoring of your web application. For more information, see Use CloudWatch RUM. |
November 29, 2021 |
AmazonCloudWatchRUMReadOnlyAccess – New policy |
CloudWatch added a new policy to enable read-only access to CloudWatch RUM. CloudWatch RUM allows you to perform real user monitoring of your web application. For more information, see Use CloudWatch RUM. |
November 29, 2021 |
CloudWatchEvidentlyFullAccess – New policy |
CloudWatch added a new policy to enable full management of CloudWatch Evidently. CloudWatch Evidently allows you to perform A/B experiments of your web applications, and to roll them out gradually. For more information, see Perform launches and A/B experiments with CloudWatch Evidently. |
November 29, 2021 |
CloudWatchEvidentlyReadOnlyAccess – New policy |
CloudWatch added a new policy to enable read-only access to CloudWatch Evidently. CloudWatch Evidently allows you to perform A/B experiments of your web applications, and to roll them out gradually. For more information, see Perform launches and A/B experiments with CloudWatch Evidently. |
November 29, 2021 |
AWSServiceRoleForCloudWatchRUM – New managed policy |
CloudWatch added a policy for a new service-linked role to allow CloudWatch RUM to pubish monitoring data to other relevant Amazon services. |
November 29, 2021 |
CloudWatchSyntheticsFullAccess – Update to an existing policy |
CloudWatch Synthetics added permissions to CloudWatchSyntheticsFullAccess, and also changed the scope of one permission. The The |
September 29, 2021 |
CloudWatchSyntheticsFullAccess – Update to an existing policy |
CloudWatch Synthetics added a permission to CloudWatchSyntheticsFullAccess. The |
July 20, 2021 |
AWSCloudWatchAlarms_ActionSSMIncidentsServiceRolePolicy – New managed policy |
CloudWatch added a new managed IAM policy to allow CloudWatch to create incidents in Amazon Systems Manager Incident Manager. |
May 10, 2021 |
CloudWatchAutomaticDashboardsAccess – Update to an existing policy |
CloudWatch added a permission to the CloudWatchAutomaticDashboardsAccess
managed policy. The |
April 20, 2021 |
CloudWatch started tracking changes |
CloudWatch started tracking changes for its Amazon managed policies. |
April 14, 2021 |