AWS CloudFormation implementing in UPDATE_IN_PROGRESS State for Custom Resource
I've spent hours debugging this and Quick question that's been bugging me - I'm trying to update an AWS CloudFormation stack that includes a custom resource backed by an AWS Lambda function... The stack goes into `UPDATE_IN_PROGRESS`, but it never moves beyond that state. After a few hours, I checked the CloudFormation console, and it still shows the custom resource as being in progress without any logs or errors. I have implemented the custom resource using the AWS SDK for JavaScript (v3) in Node.js. Here's a simplified version of the Lambda function: ```javascript const AWS = require('aws-sdk'); const cloudformation = new AWS.CloudFormation(); exports.handler = async (event) => { const {RequestType, PhysicalResourceId} = event; console.log(`RequestType: ${RequestType}, PhysicalResourceId: ${PhysicalResourceId}`); if (RequestType === 'Create') { // Logic for creating resource return { PhysicalResourceId: 'MyCustomResourceId', Data: {Message: 'Resource Created'} }; } else if (RequestType === 'Update') { // Logic for updating resource return { Data: {Message: 'Resource Updated'} }; } else if (RequestType === 'Delete') { // Logic for deleting resource return { Data: {Message: 'Resource Deleted'} }; } }; ``` I have also set up the Lambda function with an IAM role that has permissions for CloudFormation actions. My CloudFormation template looks something like this: ```yaml Resources: MyCustomResource: Type: Custom::MyResource Properties: ServiceToken: !GetAtt MyCustomResourceLambda.Arn ``` When I check the Lambda logs in CloudWatch, there are no entries that indicate the function was invoked during the update process. I've verified that the stack's changesets appear fine and are valid. I also tried to manually delete the stack, but it gets exploring in `ROLLBACK_IN_PROGRESS` due to the same custom resource. Has anyone experienced this scenario or know how to debug why the custom resource isn't being executed? What potential misconfigurations could lead to this situation? My development environment is Linux. Am I missing something obvious? This is happening in both development and production on Ubuntu 22.04. I'm open to any suggestions.