The AWS SAM CLI includes a guided interactive mode, which walks you through the parameters required for deployment, provides default options, and saves these options in a configuration file in your project folder.
Once configured, you can redeploy your application by simply executing sam deploy
and the required parameters will be retrieved from the AWS SAM CLI configuration file.
Any time you make changes to the code in your AWS Lambda functions, you must ensure that you have built a new version before deploying to AWS. As you did previously, simply run the following command from the root of your SAM application, e.g., sam-app
:
make build
In a terminal window, in the root of your SAM application, copy and paste the following text:
sam deploy --guided
Follow the on-screen prompts to choose:
Once the guided deployment completes your SAM app will be live in the AWS region you selected! SAM CLI also displays the Output parameters for your app, including HelloWorldAPI
. You can test your function by sending an HTTP POST request to this endpoint, using a tool like httpie or Postman.
For additional information see the sam deploy documentation.