SAM Local: Can you use a CloudFormation file directly instead of SAM Template?
Asked Answered
W

1

7

I am trying to use a compiled CloudFormation file directly with SAM Local. I cannot find a way to do this, has anyone achieved this successfully?

Warfore answered 17/1, 2018 at 0:5 Comment(0)
M
0

Well, assuming you want to test locally a lambda you're provisionin, you can use this command:

sam local invoke -t path-to-compiled-stack-sam-template.yaml

By default, sam local invoke tries to locate a template file built using the sam build command, located in the .aws-sam subfolder, and named template.yaml or template.yml. If it doens't succeed, it will look for a template.yaml in your current directory.

This should work.

Please let us know if you're case is any more specific than this.

Reference: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-local-invoke.html

Matchwood answered 11/2, 2022 at 4:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.