2

I am on the AWS educate account and closely following this tutorial
https://github.com/mongoose-os-apps/aws-iot-button

This is an Internet Button reference project: when a button on the device is pressed, a cloud backend gets a notification and performs an action. In this particular case, AWS Lambda function sends an email to the specific email address.

For that I require a stack. But stack status is changing to ROLLBACK_COMPLETE from CREATE_IN_PROGRESS while creating new stack using aws cli.

I tried deleting and redoing the stack from cli making the necessary changes

aws cloudformation create-stack --stack-name my-internet-button --parameters ParameterKey=TopicName,ParameterValue=$DEVICE_ID/button_pressed ParameterKey=SubscriptionEmail,ParameterValue=$MY_EMAIL --capabilities CAPABILITY_IAM --template-body file://aws_button_template.json

Still the status gets down to ROLLBACK_COMPLETE

Here is a picture of my stack event enter image description here

thank_u
  • 41
  • 3

3 Answers3

3

The reason of ROLLBACK_COMPLETE is the stack failed to create 1 or more resources. To troubleshoot, open your stack on web console --> Events --> check the first CREATE_FAILED resource (from the bottom) and the Status reason.

Franxi Hidro
  • 505
  • 4
  • 18
  • As the events show there was a 1. failed attempt to create: [myLambda] and 2. the runtime parameter of nodejs4.3 is no longer supported for creating or updating AWS Lambda functions. Recommended to use the new runtime (nodejs12.x) while creating or updating functions. – thank_u Dec 23 '20 at 14:37
2

You can find root-cause i.e. by checking status reason for status CREATE_FAILED under list of events.

  1. aws cloudformation describe-stack-events --stack-name my-internet-button --output json

OR

  1. Check more events under events tab of AWS web-console.
amitd
  • 21
  • 5
  • As the events show there was a 1. failed attempt to create: [myLambda] and 2. the runtime parameter of nodejs4.3 is no longer supported for creating or updating AWS Lambda functions. Recommended to use the new runtime (nodejs12.x) while creating or updating functions. – thank_u Dec 23 '20 at 14:38
1

AWS CloudFormation stack rolls back on failure, so need to know the reason on events tab, if you wish to disable rollback on failure, you can check the following link: https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-prevent-rollback-failure/

Asri Badlah
  • 1,949
  • 1
  • 9
  • 20
  • 1
    As the events show there was a 1. failed attempt to create: [myLambda] and 2. the runtime parameter of nodejs4.3 is no longer supported for creating or updating AWS Lambda functions. Recommended to use the new runtime (nodejs12.x) while creating or updating functions. – thank_u Dec 23 '20 at 14:35
  • On updating to nodejs12.20.0 still facing the same issue of stack rollback. – thank_u Jan 01 '21 at 18:05