Skip to content

AWS provided cid dashboard template throwing error related to Custom Resource Response size.

0

Hello team,

We are using the below template provided by AWS: https://github.com/aws-samples/aws-cudos-framework-deployment/blob/main/cfn-templates/cid-cfn.yml

Facing Error: CUDOSDashboard CREATE_FAILED : Response object is too long.

Lambda function in the template that is the base lambda for the custom resource ("CidExec") is responding with a large response object causing the issue. We have retried creating the stack but still facing the same issue.

Could you please help fix this error as we are trying to deploy it in multiple accounts and this is causing us issues.

asked 9 months ago202 views
2 Answers
0

The error you're encountering is related to the size limitation of custom resource responses in AWS CloudFormation. The total size of the response body for a custom resource cannot exceed 4096 bytes. In this case, it appears that the Lambda function "CidExec" in the provided template is generating a response that exceeds this limit.

To resolve this issue, you have a few options:

  1. Modify the Lambda function to reduce the size of its response. This could involve limiting the amount of data returned or restructuring the response to be more concise.

  2. If possible, add an 'outputPaths' parameter to the custom resource in the CloudFormation template. This allows you to specify which parts of the response should be included, potentially reducing the overall size. For example, you might add something like:

    outputPaths: ["keyData1", "keyData2", "keyData3"]

    This would instruct CloudFormation to only include these specific keys from the Lambda function's response.

  3. If the data being returned is essential and cannot be reduced, consider splitting the functionality across multiple custom resources. This way, you can distribute the data across several smaller responses rather than one large one.

  4. Another approach could be to store the large response data in an external location (like an S3 bucket) and have the custom resource return only a reference to that location.

If these solutions don't work for your specific use case, you may need to reach out to AWS support or the maintainers of the CUDOS framework for further assistance. They may be able to provide an updated version of the template that addresses this issue or offer more specific guidance based on the exact requirements of the dashboard you're trying to deploy.
Sources
Custom resource response objects - AWS CloudFormation
Deploying Stack throws error at CreateKeysAndCertificate | AWS re:Post
Troubleshoot the processed template - AWS CloudFormation

answered 9 months ago
0

'CidExcc' function is the that create the dashboards during the Cloud Formation creation. It used the Lambda-backed custom resource.

You should be able to check Cloudwatch log group of the lambda "/aws/lambda/CidCustomResourceDashboard" being ran and it will show you the Response object at the end of the log events area. That is what needs to be less than 4KB. From my research, the only thing that can affect the size of that is the title of the Cloud Formation template being built if any only if you are running the CFN with no changes and using this website Cloud Intelligence Dashboard Labs.

AWS
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.