Skip to content

Commit

Permalink
Place cdk nag suppression AFTER grantInvoke statement
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiswl committed Nov 2, 2024
1 parent e66a7c1 commit 7121cb4
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ export class Cttsov2CompleteToPieriandxConstruct extends Construct {
/*
Handle lambda permissions
*/
props.redcapLambdaObj.grantInvoke(getDataFromRedCapPyLambdaObj.currentVersion);
getDataFromRedCapPyLambdaObj.addEnvironment(
'REDCAP_LAMBDA_FUNCTION_NAME',
props.redcapLambdaObj.functionName
);
// FIXME - cannot get the 'current' version of an IFunction object
NagSuppressions.addResourceSuppressions(
getDataFromRedCapPyLambdaObj,
Expand All @@ -174,11 +179,6 @@ export class Cttsov2CompleteToPieriandxConstruct extends Construct {
],
true
);
props.redcapLambdaObj.grantInvoke(getDataFromRedCapPyLambdaObj.currentVersion);
getDataFromRedCapPyLambdaObj.addEnvironment(
'REDCAP_LAMBDA_FUNCTION_NAME',
props.redcapLambdaObj.functionName
);

// Allow the getPieriandxDataFilesPyLambdaObj to read the secret
props.icav2AccessTokenSecretObj.grantRead(getPieriandxDataFilesPyLambdaObj.currentVersion);
Expand Down

0 comments on commit 7121cb4

Please sign in to comment.