# EncryptedResources

Utility class for discovering and registering encrypted resource traits.

This class provides methods to retrieve IEncryptedResource instances from constructs,
enabling automatic KMS key permission grants during IAM grant operations.

- Source: [`aws-iam/lib/grant.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-iam/lib/grant.ts#L478)
- Type last changed: v2.239.0 · 19 Feb 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iam as iam } from 'aws-cdk-lib';
const encryptedResources = new iam.EncryptedResources();
```

## Initializer

```ts
new EncryptedResources()
```

## Methods

- `of(resource: IEnvironmentAware): IEncryptedResource` (static) — Retrieve the IEncryptedResource associated with a construct, if available.

- `register(scope: IConstruct, cfnType: string, factory: IEncryptedResourceFactory): void` (static) — Register a factory for a specific CloudFormation resource type and scope.
