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:

Type: 'AWS::CloudFront::Distribution'
# [...]
- 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 LinkedIn Mastodon )

We launched the cloudonaut blog in 2015. Since then, we have published 366 articles, 60 podcast episodes, and 58 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, e9e4e5f0faef, Jason Yorty, Jeff Finley, jhoadley, Johannes Grumböck, Johannes Konings, John Culkin, Jonas Mellquist, Jonathan Deamer, Juraj Martinka, Ken Snyder, Markus Ellers, Oriol Rodriguez, Ross Mohan, Ross Mohan, sam onaga, Satyendra Sharma, Simon Devlin, Thorsten Hoeger, Todd Valentine, Victor Grenu, waldensystems, and all anonymous supporters for your help! We also want to thank all supporters who purchased a cloudonaut t-shirt.