{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "Template with GetAtt and Ref intrinsic calls",
  "Resources": {
    "LambdaRole": {
      "Type": "AWS::IAM::Role",
      "Properties": {
        "RoleName": "lambda-role",
        "AssumeRolePolicyDocument": {
          "Version": "2012-10-17",
          "Statement": [
            {
              "Effect": "Allow",
              "Principal": { "Service": "lambda.amazonaws.com" },
              "Action": "sts:AssumeRole"
            }
          ]
        }
      }
    },
    "MyFunction": {
      "Type": "AWS::Lambda::Function",
      "Properties": {
        "FunctionName": "my-function",
        "Runtime": "nodejs18.x",
        "Handler": "index.handler",
        "Role": { "Fn::GetAtt": ["LambdaRole", "Arn"] }
      }
    }
  }
}
