I have a very simple Jenkins job that builds and then deploys a step function to AWS. I have been able to build and deploy from my desktop using the SAM cli no problem. However, when I set up jenkins to do it I get the following error:
ERROR: Build step failed with exception com.amazonaws.waiters.WaiterUnrecoverableException: Resource never entered the desired state as it failed.
The stack gets created in AWS and stays in REVIEW_IN_PROGRESS. I'm assuming that the 'Waiter' is waiting for the stack to enter another state. I found this but it doesn't help very much.
Through the SAM CLI I can package and deploy just fine with
sam package --output-template-file packaged.yaml --s3-bucket thebucketofjesse
sam deploy --template-file packaged.yaml --stack-name jesse-stack-6 --capabilities CAPABILITY_IAM --region us-west-1
EDIT
I think I may have discovered the cause of this issue. I stopped using the SAM plugin and instead created a batch script to run the SAM commands manually. Everything worked except for some reason 'sam package' isn't adding the S3 uri to the yaml template output. So when it runs 'sam deploy' it looks at the output template and expects an S3 uri. It then fails and leaves the stack in REVIEW_IN_PROGRESS state.
When I run the above commands in the cli manually it will upload my state-machine.yaml file to S3 and the resulting packaged.yaml cloudformation template will have the S3 uri.
template.yaml
When I run the sam commands in jenkins the S3 uri is not in packaged.yaml