AWS CloudFormation error

0

I have a Lambda NET6 and try to deploy it using GitHub workflow. It gives e an error on the command:

aws cloudformation deploy --template-file ./aws/cfn/lambda-bucket.yml --stack-name pm2dictsstack --parameter-overrides LambdaBucketName=pm2dicts-lambda-apigw-bucket shell: /usr/bin/bash -e {0} env: APPLICATION_PACKAGE: pm2dictslambda APPLICATION_NAME: pm2dicts-lambda-apigw LAMBDA_BUCKET_NAME: pm2dicts-lambda-apigw-bucket LAMBDA_STACK_NAME: pm2dictsstack SLN_WORKING_DIR: . AWS_DEFAULT_REGION: eu-west-2 AWS_REGION: eu-west-2 AWS_ACCESS_KEY_ID: *** AWS_SECRET_ACCESS_KEY: ***

Waiting for changeset to be created.. Waiting for stack create/update to complete

Failed to create/update the stack. Run the following command to fetch the list of events leading up to the failure aws cloudformation describe-stack-events --stack-name pm2dictsstack

How to fix it?

  • Hi, you have to run the command suggested by the error message and then update your question with those events if you want to obtain efficient support from re:Post community. So, run 'aws cloudformation describe-stack-events --stack-name pm2dictsstack' and let us know.

Oleg
asked 9 months ago233 views
4 Answers
0

What about this command?

aws cloudformation describe-stack-events --stack-name pm2dictsstack
profile picture
answered 9 months ago
  • I see in AWS Console stacks and one of them: pm2dictsstack UPDATE_ROLLBACK_COMPLETE . May be delete it manually?

  • I have added results below as an answer

0

Hi Oleg, the JSON command output you've pasted isn't valid as all the "\" characters have been stripped in "ResourceProperties" field content. Output should contain sections like this:

"ResourceProperties": "{\"NetworkAclId\":

Without the backslashes the JSON pretty-printer can't parse it and make the output readable. Can you please try again, pasting the content in a "Code" format block here instead of normal text so those characters don't get stripped.

EXPERT
answered 8 months ago
  • Though actually I did just notice the reason for the failure in that output:

    "ResourceStatus": "CREATE_FAILED", "ResourceStatusReason": "pm2dicts-lambda-apigw-bucket already exists"

0

You asked "I see in AWS Console stacks and one of them: pm2dictsstack UPDATE_ROLLBACK_COMPLETE . May be delete it manually?" - yes you can, but you're throwing away useful diagnostic info! Have a look at the events there. It will be the same set accessible via "aws cloudformation describe-stack-events --stack-name pm2dictsstack" which people have been suggesting you run.

EXPERT
answered 9 months ago
0

This is a result of command above { "StackEvents": [ { "StackId": "arn:aws:cloudformation:eu-west-2:074745971345:stack/pm2dictsstack/3c16ac30-4280-11ee-854f-06cf05efd900", "EventId": "4387bb80-4280-11ee-aff9-02daa29ae6e0", "StackName": "pm2dictsstack", "LogicalResourceId": "pm2dictsstack", "PhysicalResourceId": "arn:aws:cloudformation:eu-west-2:074745971345:stack/pm2dictsstack/3c16ac30-4280-11ee-854f-06cf05efd900", "ResourceType": "AWS::CloudFormation::Stack", "Timestamp": "2023-08-24T13:15:15.119000+00:00", "ResourceStatus": "ROLLBACK_COMPLETE" }, { "StackId": "arn:aws:cloudformation:eu-west-2:074745971345:stack/pm2dictsstack/3c16ac30-4280-11ee-854f-06cf05efd900", "EventId": "LambdaBucket-DELETE_COMPLETE-2023-08-24T13:15:14.737Z", "StackName": "pm2dictsstack", "LogicalResourceId": "LambdaBucket", "PhysicalResourceId": "", "ResourceType": "AWS::S3::Bucket", "Timestamp": "2023-08-24T13:15:14.737000+00:00", "ResourceStatus": "DELETE_COMPLETE", "ResourceProperties": "{"BucketName":"pm2dicts-lambda-apigw-bucket","AccessControl":"Private"}" }, { "StackId": "arn:aws:cloudformation:eu-west-2:074745971345:stack/pm2dictsstack/3c16ac30-4280-11ee-854f-06cf05efd900", "EventId": "420b0690-4280-11ee-8f36-06fce6ffb782", "StackName": "pm2dictsstack", "LogicalResourceId": "pm2dictsstack", "PhysicalResourceId": "arn:aws:cloudformation:eu-west-2:074745971345:stack/pm2dictsstack/3c16ac30-4280-11ee-854f-06cf05efd900", "ResourceType": "AWS::CloudFormation::Stack", "Timestamp": "2023-08-24T13:15:12.624000+00:00", "ResourceStatus": "ROLLBACK_IN_PROGRESS", "ResourceStatusReason": "The following resource(s) failed to create: [LambdaBucket]. Rollback requested by user." }, { "StackId": "arn:aws:cloudformation:eu-west-2:074745971345:stack/pm2dictsstack/3c16ac30-4280-11ee-854f-06cf05efd900", "EventId": "LambdaBucket-CREATE_FAILED-2023-08-24T13:15:12.225Z", "StackName": "pm2dictsstack", "LogicalResourceId": "LambdaBucket", "PhysicalResourceId": "", "ResourceType": "AWS::S3::Bucket", "Timestamp": "2023-08-24T13:15:12.225000+00:00", "ResourceStatus": "CREATE_FAILED", "ResourceStatusReason": "pm2dicts-lambda-apigw-bucket already exists", "ResourceProperties": "{"BucketName":"pm2dicts-lambda-apigw-bucket","AccessControl":"Private"}" }, { "StackId": "arn:aws:cloudformation:eu-west-2:074745971345:stack/pm2dictsstack/3c16ac30-4280-11ee-854f-06cf05efd900", "EventId": "LambdaBucket-CREATE_IN_PROGRESS-2023-08-24T13:15:11.824Z", "StackName": "pm2dictsstack", "LogicalResourceId": "LambdaBucket", "PhysicalResourceId": "", "ResourceType": "AWS::S3::Bucket", "Timestamp": "2023-08-24T13:15:11.824000+00:00", "ResourceStatus": "CREATE_IN_PROGRESS", "ResourceProperties": "{"BucketName":"pm2dicts-lambda-apigw-bucket","AccessControl":"Private"}" }, { "StackId": "arn:aws:cloudformation:eu-west-2:074745971345:stack/pm2dictsstack/3c16ac30-4280-11ee-854f-06cf05efd900", "EventId": "3fc5f890-4280-11ee-a1d8-069187556e26", "StackName": "pm2dictsstack", "LogicalResourceId": "pm2dictsstack", "PhysicalResourceId": "arn:aws:cloudformation:eu-west-2:074745971345:stack/pm2dictsstack/3c16ac30-4280-11ee-854f-06cf05efd900", "ResourceType": "AWS::CloudFormation::Stack", "Timestamp": "2023-08-24T13:15:08.797000+00:00", "ResourceStatus": "CREATE_IN_PROGRESS", "ResourceStatusReason": "User Initiated" }, { "StackId": "arn:aws:cloudformation:eu-west-2:074745971345:stack/pm2dictsstack/3c16ac30-4280-11ee-854f-06cf05efd900", "EventId": "3c163700-4280-11ee-854f-06cf05efd900", "StackName": "pm2dictsstack", "LogicalResourceId": "pm2dictsstack", "PhysicalResourceId": "arn:aws:cloudformation:eu-west-2:074745971345:stack/pm2dictsstack/3c16ac30-4280-11ee-854f-06cf05efd900", "ResourceType": "AWS::CloudFormation::Stack", "Timestamp": "2023-08-24T13:15:02.902000+00:00", "ResourceStatus": "REVIEW_IN_PROGRESS", "ResourceStatusReason": "User Initiated" } ] }

Oleg
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions