An operations team writes a CloudFormation template containing an AWS::Serverless::Function resource. When they attempt to deploy this template using the AWS CLI, CloudFormation returns an error stating that the resource type is invalid or unsupported. What is the root cause of this deployment failure?
- AThe template specifies a Lambda custom integration instead of a Lambda proxy integration.
- BThe Lambda function configuration defines an execution timeout parameter that exceeds the 15-minute maximum limit.
- The template does not include the required Transform declaration to invoke the AWS Serverless Application Model parser.Cevap
- DThe IAM execution role's trust policy does not list the Lambda service principal as a trusted entity.
Cevap
The template does not include the required Transform declaration to invoke the AWS Serverless Application Model parser.
The correct answer is correct because AWS CloudFormation requires the Transform declaration (specifically Transform: AWS::Serverless-2016-10-31) at the root of the template. Without this declaration, CloudFormation does not recognize or parse custom resource types like AWS::Serverless::Function, resulting in an invalid resource type error.
Adım Adım Çözüm
Anahtar Kavram
AWS SAM templates require a Transform declaration (Transform: AWS::Serverless-2016-10-31) at the root level so that CloudFormation can translate serverless resources into standard CloudFormation resources.