title: AWS CloudFormation custom lambda function stuck in create state
body: <p>I am trying use a value returned from lambda function via. CloudFormation custom resources; however when I try, the CloudFormation Custom resource is stuck in wait state infinitely.</p>
  
  <p>The following the Lambda Node code, which I am trying and</p>
  
  <pre><code>exports.handler = function(event, context) {
    var date = new Date();
    var current_hour = date.getHours();
    console.log("START :: " + current_hour);
  
      console.log("END :: " + current_hour);
      data = {
          "val1" : "val1",
          "val2" : "val2"
      };
  
      result = {
        "Status" : "SUCCESS",
        "Reason" : "Success Reason",
        "PhysicalResourceId" : "LambdaCustomDelayFunction",
        "StackId" : event.StackId,
        "RequestId" : event.RequestId,
        "LogicalResourceId" : event.LogicalResourceId,
        "Data" : data
      };
      console.log('---Event---');
      console.log(event);
      console.log('---Context---');
      console.log(context);
      console.log('---Result---');
      console.log(result);
  
      context.done(null, result);
  };
  </code></pre>
  
  <p>The following the CloudFormation script, I am trying to work with lambda</p>
  
  <pre><code>"DelayFunction" : {
        "Type" : "Custom::Delayer",
        "Properties" : {
          "ServiceToken" : "arn:aws:lambda:us-east-1-123456778:function:delayfunction"
        }
        },
  "MySG": {
        "Type": "AWS::EC2::SecurityGroup",
        "Properties": {
          "GroupDescription": " Server SG 1",
          "VpcId": {
            "Ref": "VPC"
          },
          "SecurityGroupIngress": [
            {
              "IpProtocol": "-1",
              "CidrIp": "10.0.0.0/16"
            }
          ],
          "SecurityGroupEgress": [
            {
              "IpProtocol": "-1",
              "CidrIp": "0.0.0.0/0"
            }
          ],
          "Tags": [
            {
              "Key": "Name",
              "Value": "SG 1"
            },
            {"Key":"Lambda", "Value":{ "Fn::GetAtt" : ["DelayFunction", "val1"]}} &lt;------ Trying to retrieve the value
          ]
        }
      }
  </code></pre>