Having trouble obtaining the ARN of my AWS CDK stack's Step Functions state machine for my lambda function. The ARN is constantly changing and I'm unsure how to access it.
I attempted to create a .env file alongside the lambda function's index.ts file.
const stateMachine = new stepfunctions.StateMachine(this, 'my-state-machine', {
definition: waitState,
});
I then tried writing stateMachine.stateMachineArn
to the .env file using fs
from the CDK stack. However, the result in the .env file and console was ${Token[TOKEN.1056]}
. It seems that the ARN is not available at this stage of the CDK stack deployment process. Any suggestions on how to resolve this issue?