# ClusterGrants

Collection of grant methods for a IClusterRef.

- Source: [`aws-ecs/lib/cluster-grants.ts`](https://github.com/aws/aws-cdk/blob/v2.273.0/packages/aws-cdk-lib/aws-ecs/lib/cluster-grants.ts#L20)
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_ecs as interfaces_ecs } from 'aws-cdk-lib/interfaces';

declare const clusterRef: interfaces_ecs.IClusterRef;
const clusterGrants = ecs.ClusterGrants.fromCluster(clusterRef);
```

## Methods

- `fromCluster(resource: IClusterRef): ClusterGrants // chainable` (static) — Creates grants for ClusterGrants.

- `taskProtection(grantee: IGrantable): Grant` — Grants an ECS Task Protection API permission to the specified grantee.

  This method provides a streamlined way to assign the 'ecs:UpdateTaskProtection'
  permission, enabling the grantee to manage task protection in the ECS cluster.
