# DomainGrants

Collection of grant methods for a IDomainRef.

- Source: Generated code
- Type last changed: v2.244.0 · 19 Mar 2026

## Example

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

declare const domainRef: interfaces_elasticsearch.IDomainRef;
const domainGrants = elasticsearch.DomainGrants.fromDomain(domainRef);
```

## Methods

- `actions(grantee: IGrantable, actions: string[], options?: PermissionsOptions): Grant` — Grant the given identity custom permissions.

- `fromDomain(resource: IDomainRef): DomainGrants // chainable` (static) — Creates grants for DomainGrants.

- `read(grantee: IGrantable): Grant` — Grant read permissions for this domain and its contents to an IAM principal (Role/Group/User).

- `readWrite(grantee: IGrantable): Grant` — Grant read/write permissions for this domain and its contents to an IAM principal (Role/Group/User).

- `write(grantee: IGrantable): Grant` — Grant write permissions for this domain and its contents to an IAM principal (Role/Group/User).
