DEV Community

Rafaf Tahsin
Rafaf Tahsin

Posted on

How to restrict AWS access from office Ips only

Use Source IP condition in IAM policy.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Statement1",
            "Effect": "Allow",
            "Action": [
                "*"
            ],
            "Resource": [
                "*"
            ],
            "Condition": {
                "IpAddress": {
                    "aws:SourceIp": [
                        "202.74.246.XXX/32"
                    ]
                }
            }
        }
    ]
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)