Prevents deletion of S3 buckets except by specific infrastructure automation roles, providing protection against accidental data loss.
What this SCP does
This Service Control Policy (SCP) prevents deletion of S3 buckets except by specific infrastructure automation roles, providing protection against accidental data loss. This is particularly useful for preserving important storage resources.
By restricting bucket deletion to only roles with the "infra-*" team tag, this policy ensures that your critical data storage cannot be removed by unauthorized users or by mistake, while still allowing infrastructure teams to manage storage resources when necessary.
How to test this SCP works
To validate this SCP, test bucket deletion with roles that have different team tags.
For thorough testing, create test buckets and attempt to delete them using different IAM roles to verify that only appropriately tagged roles can perform deletion operations.