How do I resolve the "Resource specification is invalid" error when I run the cfn generate command using the CloudFormation CLI in AWS CloudFormation?

Last updated: 2020-08-17

I receive the "Resource specification is invalid" error in AWS CloudFormation when I run the cfn generate command using the CloudFormation Command Line Interface (CloudFormation CLI). How can I resolve this error?

Short description

The cfn generate command generates code based on the project and resource provider schema. You receive the "Resource specification is invalid" error message when the resource provider schema for your resource is invalid. You can also receive a syntax or invalid namespace error message.

If you're having issues with other errors related to using a resource provider, see the following articles for additional troubleshooting steps:

Resolution

  1. In the root directory of the project where the cfn init command was executed, find the resource provider schema.
    Note: The resource provider schema file is a JSON file in the organization-service-resource.json format.
  2. Confirm that your organization-service-resource.json file follows proper JSON formatting.
  3. Compare the namespaces of your resource with the namespaces in the resource provider schema, and then resolve any discrepancies that you find.

If the preceding steps don't resolve the issue, then use cfn init to create a new project and update the resource provider schema file organization-service-resource.json incrementally until you have narrowed down the change that causes the "Resource specification is invalid" error.


Did this article help?


Do you need billing or technical support?