Sanction Russia: Block traffic using CloudFront Geo Restriction

Andreas Wittig – 25 Feb 2022

Russia attacked a sovereign state this week. Most states condemn the attack and impose sanctions. Among other things, sanctions are intended to mobilize the Russian population to rise up against their aristocrat Putin. As of today, cloudonaut is no longer accessible from Russia. We want to show solidarity with the Ukrainian people and make clear to the AWS community in Russia that we stand up for peace.

Stop Russia!

We encourage you to follow us. If you use CloudFront as your CDN, the following CloudFormation and Terraform snippets enable CloudFront Geo Restriction to block traffic from Russia.

Block traffic from Russia with CloudFormation:

CloudFrontDistribution:
Type: 'AWS::CloudFront::Distribution'
Properties:
DistributionConfig:
# [...]
Restrictions:
GeoRestriction:
Locations:
- RU
RestrictionType: blacklist

Block traffic from Russia with Terraform:

resource "aws_cloudfront_distribution" "distribution" {
# [...]

restrictions {
geo_restriction {
restriction_type = "blacklist"
locations = ["RU"]
}
}
}

With the geo restriction in place, visitors from Russia will receive a 403 (Forbidden) response from CloudFront.

“When the power of love overcomes the love of power the world will know peace.” Jimi Hendrix

Become a cloudonaut supporter

Andreas Wittig

Andreas Wittig ( Email, Twitter, or LinkedIn )

We launched the cloudonaut blog in 2015. Since then, we have published 356 articles, 48 podcast episodes, and 45 videos. It's all free and means a lot of work in our spare time. We enjoy sharing our AWS knowledge with you.

Please support us

Have you learned something new by reading, listening, or watching our content? With your help, we can spend enough time to keep publishing great content in the future. Learn more

$
Amount must be a multriply of 5. E.g, 5, 10, 15.

Thanks to Alan Leech, Alex DeBrie, ANTHONY RAITI, Christopher Hipwell, Jaap-Jan Frans, Jason Yorty, Jeff Finley, Jens Gehring, jhoadley, Johannes Grumböck, John Culkin, Jonas Mellquist, Juraj Martinka, Kamil Oboril, Ken Snyder, Markus Ellers, Ross Mohan, Ross Mohan, sam onaga, Satyendra Sharma, Shawn Tolidano, Thorsten Hoeger, Todd Valentine, Victor Grenu, and all anonymous supporters for your help! We also want to thank all supporters who purchased a cloudonaut t-shirt.