Stack is hung using CloudFormation with SNS-backed CustomResources

Viewed 785

I'm trying to learn working of CustomResources in CloudFormation Template. Created simple template to create s3 bucket. But on creating stack, it remains in Create in progress state for long time and no bucket is created. Is there anything, I'm missing in below validated template:

  {
   "AWSTemplateFormatVersion" : "2010-09-09",
   "Description" : "Building A bucket With customeResources in CloudFormation",
   "Parameters" : {
        "NewBucket": {
            "Default": "",
            "Description": "S3 bucket containing customer assets",
            "Type": "String"
    }
   },

    "Conditions": {
        "NewBucket": {
            "Fn::Not": [
                {
                    "Fn::Equals": [
                        {
                            "Ref": "NewBucket"
                        },
                        ""
                    ]
                }
            ]
        }
    },

  "Resources" : {

    "CustomResource": {

        "Properties": {
            "S3Bucket": {
                    "Ref": "NewBucket"
                },
            "ServiceToken": "SNS topic ARN"    
            },
        "Type": "AWS::CloudFormation::CustomResource"
        }
  },
  "Outputs": {
    "BucketName": {
        "Value": {
            "Fn::GetAtt": [ "CustomResource", {"Ref": "NewBucket"} ]
        }
    }
}
}
1 Answers
Related