@renovosolutions/cdk-aspects-library-encryption-enforcement
Version:
A library of CDK aspects that enforce encryption on AWS resources.
90 lines (89 loc) • 2.94 kB
TypeScript
import { IAspect } from 'aws-cdk-lib';
import { IConstruct } from 'constructs';
/**
* Common properties for all aspects in this module.
*/
export interface EncryptionEnforcementAspectProps {
/**
* The resources to exclude from enforcement.
*
* Use a resource's ID to exclude a specific resource.
* Supports both CfnResource and L2 construct IDs.
*
* @default []
*/
readonly excludeResources?: string[];
}
/**
* Common base class for all aspects in this module.
*
* This exists to define the common properties and methods for all encryption enforcement aspects.
* Right now, that's just exposing the `excludeResources` property.
*
* @abstract
* @class EncryptionEnforcementAspect
* @implements {IAspect}
*/
declare abstract class EncryptionEnforcementAspect implements IAspect {
/**
* The resources to exclude from enforcement.
*
* Use a resource's ID to exclude a specific resource.
* Supports both CfnResource and L2 construct IDs.
*
* @default []
*/
readonly excludeResources: string[];
/**
* Constructs a new EncryptionEnforcementAspect.
*
* @param props - Optional properties to configure the aspect.
*/
constructor(props?: EncryptionEnforcementAspectProps);
/**
* Dummy visit method that must be overridden by subclasses.
* @param _node - The construct to visit.
*/
visit(_node: IConstruct): void;
}
/**
* An aspect that enforces encryption on all EFS FileSystems in the stack.
*/
export declare class EFSEncryptionEnforcementAspect extends EncryptionEnforcementAspect {
/**
* Visits each construct in the stack and enforces encryption on EFS FileSystems.
*
* @param node - The construct to visit.
*/
visit(node: IConstruct): void;
}
/**
* An aspect that enforces encryption on all RDS databases in the stack.
* Covers both single instances and clusters.
*/
export declare class RDSEncryptionEnforcementAspect extends EncryptionEnforcementAspect {
/**
* Visits each construct in the stack and enforces encryption on RDS databases.
*
* @param node - The construct to visit.
*/
visit(node: IConstruct): void;
}
/**
* An convenience class with a static function that adds all of the aspects in this module.
* It's only a class because jsii skips standalone functions.
*/
export declare class EncryptionEnforcement {
/**
* Adds all encryption enforcement aspects to the given scope.
*
* This is a convenience method to add all aspects in this module at once.
* It can be used in the `main` function of your CDK app or in a stack constructor.
*
* @param scope - The scope to add the aspects to.
* @param props - Optional properties to configure the aspects.
* @returns void
*/
static addAllAspects(scope: IConstruct, props?: EncryptionEnforcementAspectProps): void;
}
export {};