An operations team is migrating a legacy provisioning stack to a serverless model. A team member creates a new template file containing an `AWS::Serverless::Function` resource:
yaml
AWSTemplateFormatVersion: '2010-09-09'
Resources:
RetrieveInventoryFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs20.x
CodeUri: ./src
Environment:
Variables:
DB_PASSWORD: '{{resolve:ssm-secure:InventoryDBPassword}}'
The database password requires automated rotation every 30 days. When attempting to create the stack, AWS CloudFormation fails with a validation error stating that the `AWS::Serverless::Function` resource type is unrecognized.
Which TWO actions should the team take to successfully deploy the template and retrieve the database credentials securely?
- Add `Transform: AWS::Serverless-2016-10-31` at the root of the template file.Answer
- Store the database password in AWS Secrets Manager and reference it using `{{resolve:secretsmanager:InventoryDBPassword}}` in the environment variables.Answer
- CAdd `Transform: AWS::Serverless-2010-09-09` at the root of the template file.
- DKeep the password in Systems Manager Parameter Store and write a custom script using AWS EventBridge to rotate the parameter.
- ESet the `Timeout` property of the `AWS::Serverless::Function` resource to `0` to ensure retrieval requests never time out.