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개 답변
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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠