IAM-How to give access only north Virginia

How to give access only north Virginia
  1. Go to IAM service
  2. Go to access management --> Policies --> Create policy


  3. Select Json


  4. Copy and paste the below Json Code in Policy editor and click next
  5. {

        "Version": "2012-10-17",

        "Statement": [

            {

                "Action": "ec2:*",

                "Effect": "Allow",

                "Resource": "*",

                "Condition": {

                    "StringEquals": {

                        "aws:RequestedRegion": "us-east-1"

                    }

                }

            },

            {

                "Effect": "Allow",

                "Action": "elasticloadbalancing:*",

                "Resource": "*",

                "Condition": {

                    "StringEquals": {

                        "aws:RequestedRegion": "us-east-1"

                    }

                }

            },

            {

                "Effect": "Allow",

                "Action": "cloudwatch:*",

                "Resource": "*",

                "Condition": {

                    "StringEquals": {

                        "aws:RequestedRegion": "us-east-1"

                    }

                }

            },

            {

                "Effect": "Allow",

                "Action": "autoscaling:*",

                "Resource": "*",

                "Condition": {

                    "StringEquals": {

                        "aws:RequestedRegion": "us-east-1"

                    }

                }

            },

            {

                "Effect": "Allow",

                "Action": "iam:CreateServiceLinkedRole",

                "Resource": "*",

                "Condition": {

                    "StringEquals": {

                        "iam:AWSServiceName": [

                            "autoscaling.amazonaws.com",

                            "ec2scheduled.amazonaws.com",

                            "elasticloadbalancing.amazonaws.com",

                            "spot.amazonaws.com",

                            "spotfleet.amazonaws.com",

                            "transitgateway.amazonaws.com"

                        ]

                    }

                }

            },

            {

                "Effect": "Allow",

                "Action": "s3:*",

                "Resource": "*",

                "Condition": {

                    "StringEquals": {

                        "aws:RequestedRegion": "ap-south-1"

                    }

                }

            }

        ]

    }
     
  6. Enter Policy name and click create policy


  7. Go to IAM service --> Users --> Select user --> Add Permissions --> Add permissions


  8. Click on Add permissions


Comments

Popular posts from this blog

IAM-Create a policy to place the user in a group only.

IAM-Create a policy to deny the access of Specific bucket.