diff --git a/lib/workload/stateless/stacks/stacky-mcstackface/glue-constructs/nails/part_2/cttso-v2-output-to-pieriandx-ready-event/index.ts b/lib/workload/stateless/stacks/stacky-mcstackface/glue-constructs/nails/part_2/cttso-v2-output-to-pieriandx-ready-event/index.ts index d59dd4170..a50c61596 100644 --- a/lib/workload/stateless/stacks/stacky-mcstackface/glue-constructs/nails/part_2/cttso-v2-output-to-pieriandx-ready-event/index.ts +++ b/lib/workload/stateless/stacks/stacky-mcstackface/glue-constructs/nails/part_2/cttso-v2-output-to-pieriandx-ready-event/index.ts @@ -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, @@ -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);