Template error: instance of Fn::GetAtt references undefined resource LambdaExecutionRole

0

Hi everyone,

I'm trying to deploy in amplify and I got this error.

CloudFormation::Stack Template error: instance of Fn::GetAtt references undefined resource LambdaExecutionRole

I tried to redeploy the last working version, but still, I encounter the same error. Here is the code for the outputs of my CloudFormation template.

"Outputs": {
        "Name": {
            "Value": {
                "Ref": "LambdaFunction"
            }
        },
        "Arn": {
            "Value": {"Fn::GetAtt": ["LambdaFunction", "Arn"]}
        },
        "Region": {
            "Value": {
                "Ref": "AWS::Region"
            }
        },
        "LambdaExecutionRole": {
            "Value": "arn:aws:iam::xxxxxxxx:role/xxx"
        }
        
    }

I appreciate in advance if anyone could help me with this matter.

  • The template is fragmented, and I’m unsure what caused the error. Therefore, could you please include the entire template in the question text.

1 Answer
0

Without seeing the whole template I can't be sure. But it looks like you are using Fn::GetAtt to reference LambdaExecutionRole which is an "Output" and not a "Resource" and that's not supported. If you search for {"Fn::GetAtt": ["LambdaExecutionRole" within your template, you should find the section in the Resource block that is causing your error.

Output is intended to be used by "things outside" the stack, not from within the template itself.

I hope this helped!

profile picture
answered a year 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