This document describes how to delete a Managed Kafka ACL resource. Deleting an
ACL removes all of the individual permission rules that are specified in the
list of ACL entries.

> [!CAUTION]
> **Caution:** If you delete the only Managed Kafka ACL that is associated with a particular resource pattern, you might unintentionally grant access for that pattern to all authenticated principals. For more information, see [Default access](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/access-control-kafka-acls.md.txt#default-access).

## Required roles and permissions


To get the permission that
you need to delete a Managed Kafka ACL,

ask your administrator to grant you the
[Managed Kafka ACL Editor](https://docs.cloud.google.com/iam/docs/roles-permissions/managedkafka.md.txt#managedkafka.aclEditor) (`roles/managedkafka.aclEditor`) IAM role on your project.


For more information about granting roles, see [Manage access to projects, folders, and organizations](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access.md.txt).


This predefined role contains the
`managedkafka.acls.delete`
permission,
which is required to
delete a Managed Kafka ACL.


You might also be able to get
this permission
with [custom roles](https://docs.cloud.google.com/iam/docs/creating-custom-roles.md.txt) or
other [predefined roles](https://docs.cloud.google.com/iam/docs/roles-overview.md.txt#predefined).

## Delete an ACL

### gcloud

Run the
[`gcloud managed-kafka acls delete`](https://docs.cloud.google.com/sdk/gcloud/reference/managed-kafka/acls/delete)
command:

```bash
gcloud managed-kafka acls delete ACL_ID \
  --cluster=CLUSTER_ID \
  --location=LOCATION
```

Replace the following:

- `ACL_ID`. The ID of the Managed Kafka ACL resource
  to delete. For more information, see
  [ACL ID](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/kafka-acls/create-kafka-acls.md.txt#acl-id).

- `CLUSTER_ID` The ID of your Kafka cluster.

- `LOCATION`: The region of your Kafka cluster.

This command permanently deletes the specified ACL resource and all the
underlying Apache Kafka ACL bindings associated with its resource pattern. You
are prompted to confirm the deletion.

## Sample command

Run the following command to delete an ACL called `topic/test-topic`:

```bash
gcloud managed-kafka acls delete topic/test-topic  \
  --project=test-project \
  --location=us-central1 \
  --cluster=test-cluster
```

The following is the sample output of the command:

```bash
You are about to delete acl [topic/test-topic].
Do you want to continue (Y/n)?  y
Deleted acl [topic/test-topic].
```

The output of the `delete` command includes a confirmation prompt before
proceeding with the deletion. Upon successful deletion, a message confirms that
the ACL resource is removed.

## What's next

- [List ACLs](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/kafka-acls/list-kafka-acls.md.txt)

- [Create an ACL](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/kafka-acls/create-kafka-acls.md.txt)

- [Add an ACL entry](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/kafka-acls/add-acl-entry.md.txt)

*Apache Kafka® is a registered
trademark of The Apache Software Foundation or its affiliates in the United
States and/or other countries.*