Skip to content

aws-ecs: ManagedStorageConfiguration add option to provide KMS key to encrypt managed storage besides the fargate ephemeral storage #33380

@mMeijden

Description

@mMeijden

Describe the feature

The current ManagedStorageConfiguration interface only supports the option to encrypt the Fargate ephemeral storage while the L1 construct has the option to also add the regular kmsKeyId to encrypt the managed storage.
L2 Cluster construct:

managedStorageConfiguration: {
      fargateEphemeralStorageKmsKey: kmsKey
}

L1 CfnCluster:

// other properties omitted
managedStorageConfiguration: {
      fargateEphemeralStorageKmsKeyId: 'fargateEphemeralStorageKmsKeyId',
      kmsKeyId: 'kmsKeyId',
    },
// other properties omitted

Desired outcome:
The L2 construct should have the option to provide the kmsKeyId property as well to avoid using the CfnCluster construct

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.Cluster.html#managedstorageconfiguration
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnCluster.ClusterConfigurationProperty.html

Use Case

There are two types of storages in ECS clusters that can be encrypted. The L2 construct only supports the ephemeral storage at this point.

As we are building opinionated constructs for our company, where enforcing encryption with KMS by default is one of them, I am currently unable to use the L2 construct for this.

Proposed Solution

Add kmsKeyId to the ManagedStorageConfiguration interface and the L2 construct

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.178.0

Environment details (OS name and version, etc.)

applies to all environments

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-ecsRelated to Amazon Elastic Containereffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions