LazyStack

Publish PetStoreCLIDev stack to AWS

4.1 Publish

In this step we will publish our stack to AWS.

  1. Create an s3 bucket - you only need to do this the first time you publish.
    aws s3api create-bucket --bucket petstorecli --region us-east-1 --acl private
  2. CD into the solution folder (LazyStackTutorial\PetStoreCLI), and use AWS SAM CLI to deploy your stack to AWS.
    Windows:
    sam deploy -t .\Stacks\Dev\serverless.template --stack-name PetStoreCLIDev --s3-bucket petstorecli --capabilities  CAPABILITY_NAMED_IAM
    MacOS/Linux:
    sam deploy -t ./Stacks/Dev/serverless.template --stack-name PetStoreCLIDev --s3-bucket petstorecli --capabilities  CAPABILITY_NAMED_IAM
    The PetStoreCLIDev stack is deployed to AWS.

4.2 Generate AwsSettings.json file

  1. CD into the solution folder (LazyStackTutorial\PetStoreCLI), and execute "lazystack settings".
    Windows:
    lazystack settings PetStoreCLIDev .\Stacks\Dev\AwsSettings.json
    MacOS/Linux:
    lazystack settings PetStoreCLIDev ./Stacks/Dev/AwsSettings.json
    An AwsSettings.json file is placed in the Stacks\Dev folder. This file contains the configuration settings necessary for client apps to use the PetStoreCLIDev AWS Stack.

Step Summary

We published our stack to AWS, generated an AwsSettings.json file and can now use those resources.