Skip to main content
IAM Policy Map

AWSWAFConsoleReadOnlyAccess

AnalystAWS managedActivePermissions reviewedShow on mapCompare

Summary

Provides read-only access to AWS WAF via the AWS Management Console. Note that this policy also grants permissions to list Amazon CloudFront distributions, permissions to view load balancers on AWS Elastic Load Balancing, permissions to view Amazon API Gateway REST APIs and stages, permissions to list and view Amazon CloudWatch metrics, and permissions to view regions enabled within the account.

Permissions imported from the AWS Managed Policy Reference Guide; other sections pending editorial review.

Identity

ARN
arn:aws:iam::aws:policy/AWSWAFConsoleReadOnlyAccess
Default version
v21
Created
Last edited
Services
amplify, apigateway, apprunner, appsync, aws-marketplace, bedrock-agentcore, cloudfront, cloudwatch, cognito-idp, ec2, elasticloadbalancing, firehose, logs, pricing, pricingplanmanager, route53, s3, waf, waf-regional, wafv2

Control-plane actions (150)

By access level: 72 List, 78 Read.

Control-plane actions by service
ServiceGrantedAccess levels and limitsGranted by
Amplify3 of 412 List, 1 Read; 1 restricted, 0 conditionalamplify:GetWebACLForResource, amplify:ListApps, amplify:ListResourcesForWebACL
API Gateway1 of 441 Read; 1 restricted, 0 conditionalapigateway:GET
App Runner3 of 422 List, 1 Read; 1 restricted, 0 conditionalapprunner:DescribeWebAclForService, apprunner:ListAssociatedServicesForWebAcl, apprunner:ListServices
AppSync4 of 873 List, 1 Read; 1 restricted, 0 conditionalappsync:GetWebACLForResource, appsync:ListApis, appsync:ListGraphqlApis, appsync:ListResourcesForWebACL
Marketplace1 of 971 List; 0 restricted, 0 conditionalaws-marketplace:ViewSubscriptions
Bedrock-Agentcore4 of 1972 List, 2 Read; 2 restricted, 0 conditionalbedrock-agentcore:GatewayGetWebACLForResource, bedrock-agentcore:GatewayListResourcesForWebACL, bedrock-agentcore:GetGateway, bedrock-agentcore:ListGateways
CloudFront7 of 1734 List, 3 Read; 3 restricted, 0 conditionalcloudfront:GetDistribution, cloudfront:GetDistributionConfig, cloudfront:GetDistributionTenant, cloudfront:ListDistributionTenants, cloudfront:ListDistributionTenantsByCustomization, cloudfront:ListDistributions, cloudfront:ListDistributionsByWebACLId
Cognito User Pools3 of 1392 List, 1 Read; 1 restricted, 0 conditionalcognito-idp:GetWebACLForResource, cognito-idp:ListResourcesForWebACL, cognito-idp:ListUserPools
EC24 of 8344 List; 1 restricted, 0 conditionalec2:DescribeRegions, ec2:DescribeVerifiedAccessInstanceWebAclAssociations, ec2:DescribeVerifiedAccessInstances, ec2:GetVerifiedAccessInstanceWebAcl
ELB3 of 772 List, 1 Read; 1 restricted, 0 conditionalelasticloadbalancing:DescribeLoadBalancers, elasticloadbalancing:DescribeWebACLAssociation, elasticloadbalancing:GetLoadBalancerWebACL
Firehose1 of 101 List; 0 restricted, 0 conditionalfirehose:ListDeliveryStreams
CloudWatch Logs5 of 1333 List, 2 Read; 3 restricted, 0 conditionallogs:DescribeLogGroups, logs:DescribeQueryDefinitions, logs:DescribeResourcePolicies, logs:GetQueryResults, logs:StartQuery
Price List2 of 52 Read; 0 restricted, 0 conditionalpricing:GetPriceListFileUrl, pricing:ListPriceLists
PricingPlanManager2 of 92 Read; 1 restricted, 0 conditionalpricingplanmanager:GetSubscription, pricingplanmanager:ListSubscriptions
Route 532 of 712 List; 0 restricted, 0 conditionalroute53:GetHostedZone, route53:ListHostedZones
S31 of 1551 List; 0 restricted, 0 conditionals3:ListAllMyBuckets
WAF34 of 7715 List, 19 Read; 34 restricted, 0 conditionalwaf:Get*, waf:List*
WAF Regional36 of 8116 List, 20 Read; 36 restricted, 0 conditionalwaf-regional:Get*, waf-regional:GetWebACLForResource, waf-regional:List*
WAF V234 of 6412 List, 22 Read; 34 restricted, 0 conditionalwafv2:CheckCapacity, wafv2:Describe*, wafv2:Get*, wafv2:List*
Amplify: 3 actions
  • amplify:GetWebACLForResource (Read)
  • amplify:ListApps (List)
  • amplify:ListResourcesForWebACL (List)
API Gateway: 1 actions
  • apigateway:GET (Read)
App Runner: 3 actions
  • apprunner:DescribeWebAclForService (Read)
  • apprunner:ListAssociatedServicesForWebAcl (List)
  • apprunner:ListServices (List)
AppSync: 4 actions
  • appsync:GetWebACLForResource (Read)
  • appsync:ListApis (List)
  • appsync:ListGraphqlApis (List)
  • appsync:ListResourcesForWebACL (List)
Marketplace: 1 actions
  • aws-marketplace:ViewSubscriptions (List)
Bedrock-Agentcore: 4 actions
  • bedrock-agentcore:GatewayGetWebACLForResource (Read)
  • bedrock-agentcore:GatewayListResourcesForWebACL (List)
  • bedrock-agentcore:GetGateway (Read)
  • bedrock-agentcore:ListGateways (List)
CloudFront: 7 actions
  • cloudfront:GetDistribution (Read)
  • cloudfront:GetDistributionConfig (Read)
  • cloudfront:GetDistributionTenant (Read)
  • cloudfront:ListDistributionTenants (List)
  • cloudfront:ListDistributionTenantsByCustomization (List)
  • cloudfront:ListDistributions (List)
  • cloudfront:ListDistributionsByWebACLId (List)
Cognito User Pools: 3 actions
  • cognito-idp:GetWebACLForResource (Read)
  • cognito-idp:ListResourcesForWebACL (List)
  • cognito-idp:ListUserPools (List)
EC2: 4 actions
  • ec2:DescribeRegions (List)
  • ec2:DescribeVerifiedAccessInstanceWebAclAssociations (List)
  • ec2:DescribeVerifiedAccessInstances (List)
  • ec2:GetVerifiedAccessInstanceWebAcl (List)
ELB: 3 actions
  • elasticloadbalancing:DescribeLoadBalancers (List)
  • elasticloadbalancing:DescribeWebACLAssociation (List)
  • elasticloadbalancing:GetLoadBalancerWebACL (Read)
Firehose: 1 actions
  • firehose:ListDeliveryStreams (List)
CloudWatch Logs: 5 actions
  • logs:DescribeLogGroups (List)
  • logs:DescribeQueryDefinitions (List)
  • logs:DescribeResourcePolicies (List)
  • logs:GetQueryResults (Read)
  • logs:StartQuery (Read)
Price List: 2 actions
  • pricing:GetPriceListFileUrl (Read)
  • pricing:ListPriceLists (Read)
PricingPlanManager: 2 actions
  • pricingplanmanager:GetSubscription (Read)
  • pricingplanmanager:ListSubscriptions (Read)
Route 53: 2 actions
  • route53:GetHostedZone (List)
  • route53:ListHostedZones (List)
S3: 1 actions
  • s3:ListAllMyBuckets (List)
WAF: 34 actions
  • waf:GetByteMatchSet (Read)
  • waf:GetChangeToken (Read)
  • waf:GetChangeTokenStatus (Read)
  • waf:GetGeoMatchSet (Read)
  • waf:GetIPSet (Read)
  • waf:GetLoggingConfiguration (Read)
  • waf:GetPermissionPolicy (Read)
  • waf:GetRateBasedRule (Read)
  • waf:GetRateBasedRuleManagedKeys (Read)
  • waf:GetRegexMatchSet (Read)
  • waf:GetRegexPatternSet (Read)
  • waf:GetRule (Read)
  • waf:GetRuleGroup (Read)
  • waf:GetSampledRequests (Read)
  • waf:GetSizeConstraintSet (Read)
  • waf:GetSqlInjectionMatchSet (Read)
  • waf:GetWebACL (Read)
  • waf:GetXssMatchSet (Read)
  • waf:ListActivatedRulesInRuleGroup (List)
  • waf:ListByteMatchSets (List)
  • waf:ListGeoMatchSets (List)
  • waf:ListIPSets (List)
  • waf:ListLoggingConfigurations (List)
  • waf:ListRateBasedRules (List)
  • waf:ListRegexMatchSets (List)
  • waf:ListRegexPatternSets (List)
  • waf:ListRuleGroups (List)
  • waf:ListRules (List)
  • waf:ListSizeConstraintSets (List)
  • waf:ListSqlInjectionMatchSets (List)
  • waf:ListSubscribedRuleGroups (List)
  • waf:ListTagsForResource (Read)
  • waf:ListWebACLs (List)
  • waf:ListXssMatchSets (List)
WAF Regional: 36 actions
  • waf-regional:GetByteMatchSet (Read)
  • waf-regional:GetChangeToken (Read)
  • waf-regional:GetChangeTokenStatus (Read)
  • waf-regional:GetGeoMatchSet (Read)
  • waf-regional:GetIPSet (Read)
  • waf-regional:GetLoggingConfiguration (Read)
  • waf-regional:GetPermissionPolicy (Read)
  • waf-regional:GetRateBasedRule (Read)
  • waf-regional:GetRateBasedRuleManagedKeys (Read)
  • waf-regional:GetRegexMatchSet (Read)
  • waf-regional:GetRegexPatternSet (Read)
  • waf-regional:GetRule (Read)
  • waf-regional:GetRuleGroup (Read)
  • waf-regional:GetSampledRequests (Read)
  • waf-regional:GetSizeConstraintSet (Read)
  • waf-regional:GetSqlInjectionMatchSet (Read)
  • waf-regional:GetWebACL (Read)
  • waf-regional:GetWebACLForResource (Read)
  • waf-regional:GetXssMatchSet (Read)
  • waf-regional:ListActivatedRulesInRuleGroup (List)
  • waf-regional:ListByteMatchSets (List)
  • waf-regional:ListGeoMatchSets (List)
  • waf-regional:ListIPSets (List)
  • waf-regional:ListLoggingConfigurations (List)
  • waf-regional:ListRateBasedRules (List)
  • waf-regional:ListRegexMatchSets (List)
  • waf-regional:ListRegexPatternSets (List)
  • waf-regional:ListResourcesForWebACL (List)
  • waf-regional:ListRuleGroups (List)
  • waf-regional:ListRules (List)
  • waf-regional:ListSizeConstraintSets (List)
  • waf-regional:ListSqlInjectionMatchSets (List)
  • waf-regional:ListSubscribedRuleGroups (List)
  • waf-regional:ListTagsForResource (Read)
  • waf-regional:ListWebACLs (List)
  • waf-regional:ListXssMatchSets (List)
WAF V2: 34 actions
  • wafv2:CheckCapacity (Read)
  • wafv2:DescribeAllManagedProducts (Read)
  • wafv2:DescribeManagedProductsByVendor (Read)
  • wafv2:DescribeManagedRuleGroup (Read)
  • wafv2:DescribeTopContributorsByEvent (Read)
  • wafv2:GetDecryptedAPIKey (Read)
  • wafv2:GetIPSet (Read)
  • wafv2:GetLoggingConfiguration (Read)
  • wafv2:GetManagedRuleSet (Read)
  • wafv2:GetMobileSdkRelease (Read)
  • wafv2:GetPermissionPolicy (Read)
  • wafv2:GetRateBasedStatementManagedKeys (Read)
  • wafv2:GetRegexPatternSet (Read)
  • wafv2:GetRevenueStatistics (Read)
  • wafv2:GetRevenueStatisticsSummary (Read)
  • wafv2:GetRevenueStatisticsTimeSeries (Read)
  • wafv2:GetRuleGroup (Read)
  • wafv2:GetSampledRequests (Read)
  • wafv2:GetTopPathStatisticsByTraffic (Read)
  • wafv2:GetWebACL (Read)
  • wafv2:GetWebACLForResource (Read)
  • wafv2:ListAPIKeys (List)
  • wafv2:ListAvailableManagedRuleGroupVersions (List)
  • wafv2:ListAvailableManagedRuleGroups (List)
  • wafv2:ListIPSets (List)
  • wafv2:ListLoggingConfigurations (List)
  • wafv2:ListManagedRuleSets (List)
  • wafv2:ListMobileSdkReleases (List)
  • wafv2:ListRegexPatternSets (List)
  • wafv2:ListResourcesForWebACL (List)
  • wafv2:ListRuleGroups (List)
  • wafv2:ListSettlementRecords (List)
  • wafv2:ListTagsForResource (Read)
  • wafv2:ListWebACLs (List)

Data-plane actions (3)

By access level: 1 List, 2 Read.

Data-plane actions by service
ServiceGrantedAccess levels and limitsGranted by
CloudWatch3 of 51 List, 2 Read; 0 restricted, 0 conditionalcloudwatch:GetMetricData, cloudwatch:GetMetricStatistics, cloudwatch:ListMetrics
CloudWatch: 3 actions
  • cloudwatch:GetMetricData (Read)
  • cloudwatch:GetMetricStatistics (Read)
  • cloudwatch:ListMetrics (List)

Excluded and conditional actions

No patterns are excluded by NotAction or Deny statements.

Resource scope and attachment

Resource scope across granted actions: mixed.

Can be attached: Yes, to users, groups and roles.

Why this tier

  • Grants read access plus query or analysis actions that expose data.

Guidance

Pending editorial review. The permission data on this page comes straight from AWS; this section will be filled in once a reviewed guide exists.

Same service

Same domain

Frequently asked questions

Pending editorial review. The permission data on this page comes straight from AWS; this section will be filled in once a reviewed guide exists.

Policy JSON

Download policy.json

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowReadOnlyOfAWSWAFClassic",
      "Effect": "Allow",
      "Action": [
        "waf:Get*",
        "waf:List*",
        "waf-regional:Get*",
        "waf-regional:List*"
      ],
      "Resource": [
        "arn:aws:waf::*:bytematchset/*",
        "arn:aws:waf::*:ipset/*",
        "arn:aws:waf::*:ratebasedrule/*",
        "arn:aws:waf::*:rule/*",
        "arn:aws:waf::*:sizeconstraintset/*",
        "arn:aws:waf::*:sqlinjectionset/*",
        "arn:aws:waf::*:webacl/*",
        "arn:aws:waf::*:xssmatchset/*",
        "arn:aws:waf::*:regexmatch/*",
        "arn:aws:waf::*:regexpatternset/*",
        "arn:aws:waf::*:geomatchset/*",
        "arn:aws:waf::*:rulegroup/*",
        "arn:aws:waf:*:*:changetoken/*",
        "arn:aws:waf-regional:*:*:bytematchset/*",
        "arn:aws:waf-regional:*:*:ipset/*",
        "arn:aws:waf-regional:*:*:ratebasedrule/*",
        "arn:aws:waf-regional:*:*:rule/*",
        "arn:aws:waf-regional:*:*:sizeconstraintset/*",
        "arn:aws:waf-regional:*:*:sqlinjectionset/*",
        "arn:aws:waf-regional:*:*:webacl/*",
        "arn:aws:waf-regional:*:*:xssmatchset/*",
        "arn:aws:waf-regional:*:*:regexmatch/*",
        "arn:aws:waf-regional:*:*:regexpatternset/*",
        "arn:aws:waf-regional:*:*:geomatchset/*",
        "arn:aws:waf-regional:*:*:rulegroup/*",
        "arn:aws:waf-regional:*:*:changetoken/*"
      ]
    },
    {
      "Sid": "AllowWAFClassicGetWebACLForResource",
      "Effect": "Allow",
      "Action": [
        "waf-regional:GetWebACLForResource"
      ],
      "Resource": "arn:aws:waf-regional:*:*:*/*"
    },
    {
      "Sid": "AllowReadOnlyOfAWSWAF",
      "Effect": "Allow",
      "Action": [
        "wafv2:Get*",
        "wafv2:List*",
        "wafv2:Describe*",
        "wafv2:CheckCapacity"
      ],
      "Resource": [
        "arn:aws:wafv2:*:*:*/webacl/*/*",
        "arn:aws:wafv2:*:*:*/ipset/*/*",
        "arn:aws:wafv2:*:*:*/managedruleset/*/*",
        "arn:aws:wafv2:*:*:*/rulegroup/*/*",
        "arn:aws:wafv2:*:*:*/regexpatternset/*/*"
      ]
    },
    {
      "Sid": "AllowEC2DescribeRegions",
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeRegions"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowListActionsForCloudWatch",
      "Effect": "Allow",
      "Action": [
        "cloudwatch:GetMetricData",
        "cloudwatch:GetMetricStatistics",
        "cloudwatch:ListMetrics"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowGetActionForCloudFront",
      "Effect": "Allow",
      "Action": [
        "cloudfront:GetDistributionConfig",
        "cloudfront:GetDistribution"
      ],
      "Resource": "arn:aws:cloudfront::*:distribution/*"
    },
    {
      "Sid": "AllowListActionsForCloudFront",
      "Effect": "Allow",
      "Action": [
        "cloudfront:ListDistributions",
        "cloudfront:ListDistributionsByWebACLId"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowGetActionForCloudFrontTenant",
      "Effect": "Allow",
      "Action": [
        "cloudfront:GetDistributionTenant"
      ],
      "Resource": "arn:aws:cloudfront::*:distribution-tenant/*"
    },
    {
      "Sid": "AllowListActionsForCloudFrontTenant",
      "Effect": "Allow",
      "Action": [
        "cloudfront:ListDistributionTenants",
        "cloudfront:ListDistributionTenantsByCustomization"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowGetActionsForALB",
      "Effect": "Allow",
      "Action": [
        "elasticloadbalancing:GetLoadBalancerWebACL"
      ],
      "Resource": "arn:aws:elasticloadbalancing:*:*:loadbalancer/app/*/*"
    },
    {
      "Sid": "AllowListActionsForALB",
      "Effect": "Allow",
      "Action": [
        "elasticloadbalancing:DescribeLoadBalancers",
        "elasticloadbalancing:DescribeWebACLAssociation"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowListActionsForAPIGateway",
      "Effect": "Allow",
      "Action": [
        "apigateway:GET"
      ],
      "Resource": "arn:aws:apigateway:*::/*"
    },
    {
      "Sid": "AllowGetActionsForAppSync",
      "Effect": "Allow",
      "Action": [
        "appsync:GetWebACLForResource"
      ],
      "Resource": "arn:aws:appsync:*:*:apis/*"
    },
    {
      "Sid": "AllowListActionsForAppSync",
      "Effect": "Allow",
      "Action": [
        "appsync:ListGraphqlApis",
        "appsync:ListApis",
        "appsync:ListResourcesForWebACL"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowGetActionForCognito",
      "Effect": "Allow",
      "Action": [
        "cognito-idp:GetWebACLForResource"
      ],
      "Resource": "arn:aws:cognito-idp:*:*:userpool/*"
    },
    {
      "Sid": "AllowListActionsForCognito",
      "Effect": "Allow",
      "Action": [
        "cognito-idp:ListUserPools",
        "cognito-idp:ListResourcesForWebACL"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowGetActionForAppRunner",
      "Effect": "Allow",
      "Action": [
        "apprunner:DescribeWebAclForService"
      ],
      "Resource": "arn:aws:apprunner:*:*:service/*/*"
    },
    {
      "Sid": "AllowListActionsForAppRunner",
      "Effect": "Allow",
      "Action": [
        "apprunner:ListServices",
        "apprunner:ListAssociatedServicesForWebAcl"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowGetActionForAVA",
      "Effect": "Allow",
      "Action": [
        "ec2:GetVerifiedAccessInstanceWebAcl"
      ],
      "Resource": "arn:aws:ec2:*:*:verified-access-instance/*"
    },
    {
      "Sid": "AllowListActionsForAVA",
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeVerifiedAccessInstances",
        "ec2:DescribeVerifiedAccessInstanceWebAclAssociations"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowGetActionForAmplify",
      "Effect": "Allow",
      "Action": [
        "amplify:GetWebACLForResource"
      ],
      "Resource": "arn:aws:amplify:*:*:apps/*"
    },
    {
      "Sid": "AllowListActionsForAmplify",
      "Effect": "Allow",
      "Action": [
        "amplify:ListApps",
        "amplify:ListResourcesForWebACL"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowS3ListAllMyBuckets",
      "Effect": "Allow",
      "Action": [
        "s3:ListAllMyBuckets"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowLogGroupDescribeActions",
      "Effect": "Allow",
      "Action": [
        "logs:DescribeResourcePolicies",
        "logs:DescribeLogGroups"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowListActionForFirehoseStream",
      "Effect": "Allow",
      "Action": [
        "firehose:ListDeliveryStreams"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowActionsForPricing",
      "Effect": "Allow",
      "Action": [
        "pricing:ListPriceLists",
        "pricing:GetPriceListFileUrl"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowMarketplaceViewSubscriptions",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:ViewSubscriptions"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowLogQueryActions",
      "Effect": "Allow",
      "Action": [
        "logs:StartQuery",
        "logs:DescribeQueryDefinitions",
        "logs:GetQueryResults"
      ],
      "Resource": "arn:aws:logs:*:*:log-group:aws-waf-logs-*"
    },
    {
      "Sid": "AllowListActionsForPricingPlanManager",
      "Effect": "Allow",
      "Action": [
        "pricingplanmanager:GetSubscription"
      ],
      "Resource": "arn:aws:pricingplanmanager::*:subscription:*"
    },
    {
      "Sid": "AllowListActionsForRoute53",
      "Effect": "Allow",
      "Action": [
        "route53:ListHostedZones",
        "route53:GetHostedZone"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowListSubscriptionsForPricingPlanManager",
      "Effect": "Allow",
      "Action": [
        "pricingplanmanager:ListSubscriptions"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowGetActionForAgentCoreGateway",
      "Effect": "Allow",
      "Action": [
        "bedrock-agentcore:GatewayGetWebACLForResource",
        "bedrock-agentcore:GetGateway"
      ],
      "Resource": "arn:aws:bedrock-agentcore:*:*:gateway/*"
    },
    {
      "Sid": "AllowListActionsForAgentCoreGateway",
      "Effect": "Allow",
      "Action": [
        "bedrock-agentcore:GatewayListResourcesForWebACL",
        "bedrock-agentcore:ListGateways"
      ],
      "Resource": "*"
    }
  ]
}

Version history

Current version v21, edited by AWS on 2026-07-01. Version history is recorded from 2026-11-11. Earlier versions are in the IAM console under Policy versions.

Attach snippets

AWS CLI

aws iam attach-role-policy --role-name ROLE_NAME --policy-arn arn:aws:iam::aws:policy/AWSWAFConsoleReadOnlyAccess
aws iam attach-user-policy --user-name USER_NAME --policy-arn arn:aws:iam::aws:policy/AWSWAFConsoleReadOnlyAccess
aws iam attach-group-policy --group-name GROUP_NAME --policy-arn arn:aws:iam::aws:policy/AWSWAFConsoleReadOnlyAccess

CloudFormation

Resources:
  ExampleRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument: {}  # replace with your trust policy
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/AWSWAFConsoleReadOnlyAccess

Terraform

resource "aws_iam_role_policy_attachment" "awswafconsolereadonlyaccess" {
  role       = aws_iam_role.example.name
  policy_arn = "arn:aws:iam::aws:policy/AWSWAFConsoleReadOnlyAccess"
}

CDK (TypeScript)

role.addManagedPolicy(
  iam.ManagedPolicy.fromAwsManagedPolicyName("AWSWAFConsoleReadOnlyAccess"),
);

Sources

Pending editorial review. No editorial sources are listed yet.