Skip to content

Set up IAM to use all global services and all services in a specific region

0

Even looking at the documentation, it doesn't allow you to select all of AWS's global services and specific regional services. If you look at the links below, you can use some global services and all services in specific regions, but the following AWS Global Accelerator, AWS Network Manager, AWS Shield Advanced, and AWS WAF Classic are not allowed. I need an IAM that can allow specific local services even if global services change.

https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_aws_deny-requested-region.html https://docs.aws.amazon.com/general/latest/gr/rande.html#global-endpoints

asked 2 years ago174 views

1 Answer
0

To set up IAM to use all global services and all services in a specific region, you can try the following steps.

  1. Create an IAM Policy for Global Services:
    • Go to the IAM console in the AWS Management Console.
    • Click on "Policies" in the left-hand menu, and then click "Create policy".
    • In the "JSON" tab, add the following policy document:
json
     {
       "Version": "2012-10-17",
       "Statement": [
         {
           "Effect": "Allow",
           "Action": "*",
           "Resource": "*",
           "Condition": {
             "StringEquals": {
               "aws:RequestedRegion": "global"
             }
           }
         }
       ]
     }
  • This policy grants the user/role access to all global services in AWS.
  • Review the policy, give it a name (e.g., "AllGlobalServicesAccess"), and create it.
  1. Create an IAM Policy for a Specific Region:
    • Repeat the steps above, but this time, replace the "aws:RequestedRegion" condition with the specific region you want to grant access to:
json
     {
       "Version": "2012-10-17",
       "Statement": [
         {
           "Effect": "Allow",
           "Action": "*",
           "Resource": "*",
           "Condition": {
             "StringEquals": {
               "aws:RequestedRegion": "us-east-1"
             }
           }
         }
       ]
     }
  • Replace "us-east-1" with the region you want to grant access to.
  • Review the policy, give it a name (e.g., "AllServicesAccessInUsEast1"), and create it.
  1. Attach the Policies to an IAM User or Role:
    • Go to the IAM console and navigate to the user or role you want to grant the access to.
    • Click on the "Add permissions" button, and then select "Attach policies directly".
    • Search for the policies you created in the previous steps and select them.
    • Review and confirm the changes. Now, the IAM user or role will have access to all global services and all services in the specific region you've configured. Note that you can also combine these two policies into a single policy if you want to grant access to both global services and a specific region. In that case, you would need to add an additional "Condition" block to the policy document. Also, keep in mind that granting such broad access should be done with caution and only for users or roles that require it. It's generally recommended to follow the principle of least privilege and grant only the necessary permissions. (edited)
AWS

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.