{
"StartAt": "Check Name",
"States": {
"Check Name": {
"Type": "Task",
"Parameters": {
"command": "CHECK_NAME",
"data": {
"name.$": "$.application.name"
}
},
"Resource": "REPLACE_WITH_DATA_CHECKING_LAMBDA_ARN",
"Next": "Check Address"
},
"Check Address": {
"Type": "Task",
"Parameters": {
"command": "CHECK_ADDRESS",
"data": {
"address.$": "$.application.address"
}
},
"Resource": "REPLACE_WITH_DATA_CHECKING_LAMBDA_ARN",
"Next": "Approve Application"
},
"Approve Application": {
"Type": "Pass",
"End": true
}
}
}
REGION=$(grep region samconfig.toml | awk -F\= '{gsub(/"/, "", $2); gsub(/ /, "", $2); print $2}')
STACK_NAME=$(grep stack_name samconfig.toml | awk -F\= '{gsub(/"/, "", $2); gsub(/ /, "", $2); print $2}')
aws cloudformation describe-stacks --region $REGION --stack-name $STACK_NAME --query 'Stacks[0].Outputs[?OutputKey==`DataCheckingFunctionArn`].OutputValue' --output text
The above seemingly complicated set of commands is just to help you get the ARN faster by automatically pulling the configuration values out of the samconfig.toml file (this file remembers things like Region and the name of the cloudformation stack we’re using. SAM for deployment), then use those profiles to configure the value for the AWS CLI command to display the ARN of the Lambda functions DataCheckingFunction we deployed.