Develop

The CloudFormation template is invalid

작은이야기 2020. 1. 14. 18:20

환경:

  • serverless
  • aws
  • lambda
  • apigateway

발생: The CloudFormation template is invalid: [/Resources/XXXXXXXXLambdaFunction/Type/Description] Template contains invalid characters

 

원인: serverless가 생성한 CloudFormation Template에 문제가 있다.

 

원인 찾기: 로컬에서 template을 생성하고 validation을 해보자

  1. sls package --stage prod
  2. aws cloudformation validate-template --template-body ./cloudformation-template-update-stack.json

발생에 나오는 것 처럼 경로를 알려준다.

Type/Description 이라고 해서 Type 아래에 있는 Description은 아니다.

 

이번 경우에는 git에서 commit message에 \0xxx 같은 글자가 들어있어서 문제가 되었다.