# Deny deleting VPC flow logs

Facts read 10 Nov 2026. Page reviewed 16 Nov 2026.

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.

```json
{
  "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](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html))
- **Test before applying:** As for every Service control policies guardrail: [how to test before enforcing](/mechanisms/scp/)
- **Mechanism:** [Service control policies (SCPs)](/mechanisms/scp/): 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](https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/Protect-cloud-platform-resource/Deny-users-from-deleting-Amazon-VPC-flow-logs.json), 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](/mechanisms/scp/).

## Related guardrails

- [Deploy diagnostic settings for Key Vault to Event Hub](/guardrails/azure-policy-keyvault-diagnostic-logs/): Azure, Azure Policy (built-in definitions), logging and monitoring
- [Application Insights components should block non-Entra ingestion](/guardrails/azure-policy-appinsights-entra-ingestion/): Azure, Azure Policy (built-in definitions), logging and monitoring
- [Require predefined policies for VPC flow logs](/guardrails/gcp-orgpolicy-require-vpc-flow-logs/): Google Cloud, Organization Policy Service (managed and legacy constraints), logging and monitoring
- [Deny enabling and disabling AWS Config](/guardrails/aws-scp-deny-config-changes/): AWS, Service control policies (SCPs), logging and monitoring
- [Deny modifications to specific CloudTrail trails](/guardrails/aws-scp-deny-cloudtrail-trail-changes/): AWS, Service control policies (SCPs), logging and monitoring
- [Deny disabling or modifying Amazon GuardDuty](/guardrails/aws-scp-deny-guardduty-changes/): AWS, Service control policies (SCPs), logging and monitoring

## Related pages

- [Deny KMS key deletion (AWS Service control policies)](/guardrails/aws-scp-deny-kms-key-deletion/)
- [Enforce a 30-day KMS key deletion window (AWS Service control policies)](/guardrails/aws-scp-kms-30-day-deletion-window/)
- [Deny disabling default EBS encryption (AWS Service control policies)](/guardrails/aws-scp-deny-disable-ebs-default-encryption/)

## Sources

- Deny deleting VPC flow logs: https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/Protect-cloud-platform-resource/Deny-users-from-deleting-Amazon-VPC-flow-logs.json (read 10 Nov 2026)
- What it breaks: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html (read 10 Nov 2026)
- How to test it first: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_testing-policies.html (read 10 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://cloudgovernancetools.com/guardrails/aws-scp-deny-vpc-flow-log-deletion/
