in lib/custom-resource-handlers/src/certificate-signing-request.ts [28:52]
async function handleEvent(event: cfn.Event, _context: lambda.Context): Promise<cfn.ResourceAttributes> {
if (event.RequestType !== cfn.RequestType.DELETE) {
cfn.validateProperties(event.ResourceProperties, {
DnCommonName: true,
DnCountry: true,
DnEmailAddress: true,
DnLocality: true,
DnOrganizationName: true,
DnOrganizationalUnitName: true,
DnStateOrProvince: true,
ExtendedKeyUsage: false,
KeyUsage: true,
PrivateKeySecretId: true,
});
}
switch (event.RequestType) {
case cfn.RequestType.CREATE:
case cfn.RequestType.UPDATE:
return _createSelfSignedCertificate(event);
case cfn.RequestType.DELETE:
// Nothing to do - this is not a "Physical" resource
return { Ref: event.LogicalResourceId };
}
}