# EncryptionConfiguration

Base class for creating an EncryptionConfiguration for either state machines or activities.

Extends: EncryptionConfiguration
Superclass of: AwsOwnedEncryptionConfiguration, CustomerManagedEncryptionConfiguration

- Source: [`aws-stepfunctions/lib/encryption-configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-stepfunctions/lib/encryption-configuration.ts#L4)
- Type last changed: v2.160.0 · 24 Sep 2024

## Example

```ts
import * as kms from 'aws-cdk-lib/aws-kms';
import * as cdk from 'aws-cdk-lib';

const kmsKey = new kms.Key(this, 'Key');
const stateMachine = new sfn.StateMachine(this, 'StateMachineWithCMKEncryptionConfiguration', {
  stateMachineName: 'StateMachineWithCMKEncryptionConfiguration',
  definitionBody: sfn.DefinitionBody.fromChainable(sfn.Chain.start(new sfn.Pass(this, 'Pass'))),
  stateMachineType: sfn.StateMachineType.STANDARD,
  encryptionConfiguration: new sfn.CustomerManagedEncryptionConfiguration(kmsKey, cdk.Duration.seconds(60)),
});
```

## Initializer

```ts
new EncryptionConfiguration(type: string)
```

## Properties

- `type`: string (required) — Encryption option for the state machine or activity.

  Can be either CUSTOMER_MANAGED_KMS_KEY or AWS_OWNED_KEY.
