serverless-application-model: Template error: IAM role stack-Lambda-XXXXX doesn't exist

I have a very strange error when deploying basic Lambda function using SAM.

The strange thing is that it worked this morning and the exact same code fails this afternoon 🤔

Template error: IAM role stack-LambdaFunction-XXXXX doesn’t exist

My Lambda is quite basic, I’m in region eu-east-1

AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31

Resources:
  LambdaFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler     : main.handle
      Runtime     : nodejs8.10
      MemorySize  : 2048
      CodeUri     : ./dist

This is strange because we can see that the role has been successfully created just before:

image

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 53 (4 by maintainers)

Most upvoted comments

Seeing the same issue currently as well

Good that I’m not just going insane then. I have tried a super minimal example and it’s happening with that too.

Same error here using cloudformation CDK. I’m opening a support ticket with AWS.

Edit: 16:55 BST: Just started a chat with AWS support. Case ID 8785614541 17:00 BST: AWS REPRESENTATIVE Taking a look at a couple things on my end, I can see that there are multiple people reporting this issue. The Service team is currently looking into the issue but I don’t have an ETA on resolution at this time. 17:05 BST: Acknowledgement that there is an issue with their service. No ETA, they will get back to me when the problem is solved.

Time to grab a coffee and walk the dog. Thank you AWS. 👍

Same thing again right now (15:00 UTC+0) (eu-west-2). Nothing yet on the AWS health page or Personal Health Dashboard (https://phd.aws.amazon.com/phd/home).

Would be amazing if all our code was broken in the same way… 😃

I can confirm that it’s occurring today (in my case on eu-west-1) 2022-12-06_16-42

This issue is occurring again today.

See also #2132

Also experiencing this issue since around 14:00 UTC+0 (region eu-central-1)

We’re looking into it. Thank you for posting!

Started working for us right now. us-east-1

Fyi a separate issue has been opened for the current iteration of this problem: https://github.com/aws/serverless-application-model/issues/2132

Well no, nothing works anymore… sorry for the confusion

I deployed the app again and it is working now (eu-west-1)

It does seem to be resolved! Thanks everyone for reporting & @andresionek91 for creating support ticket!

I had the same issue but it’s fixed now for me. Try it again

I have successfully just deployed a minimal example. @andresionek91 you’re the real hero for opening the support case! Thank you!

same here. It does work if you deploy with admin rights, though

How do you mean? Can you please expand on that? I have just tested with an account with both SystemAdministrator and AdministratorAccess and it failed. Additionally, I am already using CAPABILITY_IAM and CAPABILITY_NAMED_IAM on my SAM deployment.

Looking at this further, it seems the IAM role does get created, and then deleted when the failed deployment rolls back (as depicted in the image at the start of this thread). This makes me wonder if it’s ultimately a cache-like issue (i.e. the Get-like request after the Create request does not return the newly created resource).

(Note - I haven’t actually tried running CLI requests immediately after Role creation and checking the responses though to see if it’s missing)

This just appears in AWS Personal Health Dashboard

IAM operational issue

Increased API Latencies

9:59 AM PDT We are investigating an increased latency on administrative APIs. Create, Delete, List, Get, and Update API actions may be impacted in multiple regions. Other AWS services whose features require IAM roles will also be impacted. User authentications and authorizations are not impacted.

10:40 AM PDT We continue to investigate increased latency on administrative APIs. Create, Delete, List, Get, and Update API actions may be impacted in multiple regions. Other AWS services like AWS CloudFormation and AWS Lambda that use IAM roles may also be impacted. User authentications and authorizations are not impacted.

11:31 AM PDT We have identified the root cause and are working towards a resolution for increased latency on administrative APIs. Create, Delete, List, Get, and Update API actions may be impacted in multiple regions. Other AWS services like AWS CloudFormation and AWS Lambda that use IAM roles may also be impacted. User authentications and authorizations are not impacted.

eu-west-2 working again now

Same issue and now IAM page is down eu-west-1: image

+1

FWIW - I tried refreshing the IAM console during deploy and the new role popped up for a second and then disappeared again

Same issue for me. This is weird that this issue is the one to report to.

Same here. And I can also see that the role gets created and then deleted when rolling back. Maybe the role doesn’t get created fast enough and it reaches the timeout before the role is finished…

Is this something on AWS side?

Yes. Where are you supposed to report this? I cannot file a Technical Support case because I am on the Basic Support plan.

image (I guess I would class this as a “Service-related technical issue” though!)

same here. It does work if you deploy with admin rights, though

Are we facing a similar issue in the past hour ? (GMT 9.00 am to 10.am )