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 réponse
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
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions