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 Respuesta
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
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas