Skip to content

Instantly share code, notes, and snippets.

@spasam
Last active March 27, 2023 03:59
Show Gist options
  • Save spasam/8bc38eb591ad3b72603f57293ed5f138 to your computer and use it in GitHub Desktop.
Save spasam/8bc38eb591ad3b72603f57293ed5f138 to your computer and use it in GitHub Desktop.
Disallow internet access for an Amazon Virtual Private Cloud (VPC) instance managed by a customer, rather than by an AWS service
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "GRDISALLOWVPCINTERNETACCESS",
"Effect": "Deny",
"Action": [
"ec2:CreateInternetGateway",
"ec2:AttachInternetGateway",
"ec2:CreateEgressOnlyInternetGateway",
"ec2:AttachEgressOnlyInternetGateway",
"ec2:CreateDefaultVpc",
"ec2:CreateDefaultSubnet",
"ec2:CreateCarrierGateway"
],
"Resource": [
"*"
],
"Condition": {
"ArnNotLike": {
"aws:PrincipalArn": [
"arn:aws:iam::*:role/AWSControlTowerExecution"
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment