@renovosolutions/cdk-library-aws-ses-smtp-credentials
Version:
AWS CDK Construct Library for generating SMTP credentials for SES and storing them in Secrets Manager
68 lines (67 loc) • 2.31 kB
TypeScript
import { aws_iam as iam, aws_kms as kms, aws_secretsmanager as secretsmanager } from 'aws-cdk-lib';
import { Construct } from 'constructs';
/**
* The properties of a new set of SMTP Credentials
*/
export interface SesSmtpCredentialsProps {
/**
* The name of the IAM user to create
*/
readonly iamUserName: string;
/**
* The resource policy to apply to the resulting secret
*/
readonly secretResourcePolicy?: iam.PolicyDocument;
/**
* If a secret is pending deletion should it be restored?
*
* This helps in cases where cloudformation roll backs puts a secret in pending delete state.
*
* @default true
*/
readonly restoreSecret?: boolean;
/**
* If a secret already exists should it be overwritten?
*
* This helps in cases where cloudformation creates a secret successfully but it gets orphaned for some reason.
*
* @default true
*/
readonly overwriteSecret?: boolean;
/**
* The KMS key to use for the secret
*
* @default - default key
*/
readonly kmsKey?: kms.IKey;
/**
* Increment this value to trigger rotation of the SMTP credentials.
* Each change creates a new IAM access key, derives a new SMTP password,
* updates the secret, and deletes the old key.
*
* When not set, no RotationVersion property is included in the Custom Resource,
* so upgrading the library without setting this prop will not trigger an
* unintended rotation on existing deployments.
*
* @default - not set; no rotation triggered on library upgrade
*/
readonly rotationVersion?: number;
}
export declare class SesSmtpCredentials extends Construct {
/**
* The IAM user to which the SMTP credentials are attached.
*/
readonly iamUser: iam.User;
/**
* The AWS secrets manager secret that contains the SMTP credentials.
*/
readonly secret: secretsmanager.ISecret;
/**
* Constructs a new instance of the SesSmtpCredentials class.
*
* @param scope the parent construct
* @param id the construct id
* @param props the properties of the SMTP credentials @see SesSmtpCredentialsProps
*/
constructor(scope: Construct, id: string, props: SesSmtpCredentialsProps);
}