5

I get the following error upon attempting to sam deploy --guided my lambda application.

Error: Failed to create changeset for the stack: {stack-name}, An error occurred (ValidationError) when calling the CreateChangeSet operation: Stack:arn:aws:cloudformation:ap-southeast-2:014009325916:stack/{stack-name}/f2212bf0-bb41-11ea-8ef3-0aa7af0536b6 is in ROLLBACK_COMPLETE state and can not be updated.

Some further context into this issue is that all of my lambda functions do not have authorization defined. Not sure if that is related but I'm stating it in the case that it is.

I frankly have no idea how to go about this issue. Any help is appreciated.

===

Context: Building an automated trading system

Request for Cloudformation Template:

yaml

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: A tradingview alert wrapper that interprets alerts and makes trades according to them.

Globals:
    Function:
        # CodeUri: function/.
        # Runtime: python3.8
        # Policies:
        #     - AWSLambdaFullAccess
        # Tracing: Active
        # Timeout: 30
        Environment:
            Variables:
                APIKEY: ""
                SECRETKEY: ""


Resources:
    tradeFunction:
        Type: AWS::Serverless::Function
        Properties:
            Handler: app.trade
            Description: The primary execution function
            CodeUri: function/.
            Runtime: python3.8
            Policies:
                - AWSLambdaFullAccess
            Tracing: Active
            Timeout: 60
            Events:
                inputResponse:
                    Type: Api
                    Auth:
                        ApiKeyRequired: false
                        Authorizer: NONE
                    Properties:
                        Path: /trade
                        Method: post
                        

    printAccountBalanceFunction:
        Type: AWS::Serverless::Function
        Properties:
            CodeUri: function/.
            Runtime: python3.8
            Policies:
                - AWSLambdaFullAccess
            Tracing: Active
            Timeout: 30
            Handler: app.print_account_balance
            Description: Returns account balance over time or trade
            Events:
                inputResponse:
                    Type: Api
                    Properties:
                        Path: /print_account_balance
                        Method: get
    startTradesFunction:
        Type: AWS::Serverless::Function
        Properties:
            CodeUri: function/.
            Runtime: python3.8
            Policies:
                - AWSLambdaFullAccess
            Tracing: Active
            Timeout: 30
            Handler: app.start_trades
            Description: Resets trade log for a fresh start
            Events:
                inputResponse:
                    Type: Api
                    Properties:
                        Path: /start_trades
                        Method: get                   
    retrieveTradeLogFunction:
        Type: AWS::Serverless::Function
        Properties:
            CodeUri: function/.
            Runtime: python3.8
            Policies:
                - AWSLambdaFullAccess
            Tracing: Active
            Timeout: 30
            Handler: app.retrieve_trade_log
            Description: Return all the trade logs in the dyanamoDB database
            Events:
                inputResponse:
                    Type: Api
                    Properties:
                        Path: /retrieve_trade_log
                        Method: get



4
  • Can you paste your cloudformation template here? Commented Jul 1, 2020 at 9:33
  • added the template Commented Jul 1, 2020 at 10:12
  • 1
    stackoverflow.com/questions/57932734/… This seems to be similar issue? Commented Jul 1, 2020 at 12:22
  • yes it is very similar. I used the information on that issue and got the solution. thanks @dinakaran Commented Jul 1, 2020 at 12:45

2 Answers 2

9

The error is encountered to my understanding when one does an initial deployment and that initial deployment fails. As a result of this, something breaks and the deployment service can not execute successfully. To fix this issue, simple delete the aws cloudformation stack and redeploy.

One can use the following command to delete:

aws cloudformation delete-stack --stack-name <insert stack-name>

Reference

Sign up to request clarification or add additional context in comments.

1 Comment

bro you're a legit life saver
0

Might need to run sam build first so your resources can get the latest changes

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.