Skip to content
Cloud Governance Tools

Deny deleting VPC flow logs

Deny deleting VPC flow logs is an AWS guardrail written in service control policies. Denies ec2:DeleteFlowLogs in affected accounts so VPC flow logs cannot be removed. What it breaks: the policy has no exception condition, so it applies to every IAM user, role and the root user in the affected member accounts, including cleanup automation that deletes flow logs.

More logging and monitoring guardrails ยท About Service control policies

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Deny",
      "Action": "ec2:DeleteFlowLogs",
      "Resource": "*"
    }
  ]
}
Blocks
Denies ec2:DeleteFlowLogs in affected accounts so VPC flow logs cannot be removed.
Breaks
The policy has no exception condition, so it applies to every IAM user, role and the root user in the affected member accounts, including cleanup automation that deletes flow logs. (source)
Test before applying
As for every Service control policies guardrail: how to test before enforcing
Mechanism
Service control policies (SCPs): IAM users, IAM roles and the root user in member accounts; not the management account and not service-linked roles.
Taken from
open source set, MIT-0 (README states MIT-0; LICENSE file fetched, MIT-0 text, Copyright Amazon.com, Inc.): https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/LICENSE

What the policy text names

It names 1 action or pattern: ec2:DeleteFlowLogs.

What the source says

"Action: ec2:DeleteFlowLogs" (read 10 Nov 2026).

What it breaks is documented for every guardrail of this mechanism: see Service control policies.

Sources

  1. Deny deleting VPC flow logs, read 10 Nov 2026
  2. What it breaks, read 10 Nov 2026
  3. How to test it first, read 10 Nov 2026

Last reviewed 16 Nov 2026.