In this Lab we will:
hello-world
functionYou completed this lab if you:
hello-world
functioncurl
)In order to setup the development environment in your AWS Account you have to log into the AWS Console via your web browser. Use the user and credentials you created earlier.
Now we have to do the following steps to setup our development environment:
By default, Cloud9 provisions 10 GiB of disk space for the IDE. In order to work with GO and install all dependencies, we need to allocate more disk space.
sudo reboot
into the terminal.git clone --single-branch --branch lab0 https://github.com/superluminar-io/serverless-workshop-go.git
cd serverless-workshop-go
./bootstrap.sh
sam --version
aws sts get-caller-identity
In this step, we are going to setup SAM and deploy the infrastructure for the first time. SAM will create a samconfig.toml
file to persist your choices.
# Compile GO files
$ make build
# Configure SAM and deploy the infrastructure
$ sam deploy --guided
Configuring SAM deploy
======================
Looking for samconfig.toml : Not found
Setting default arguments for 'sam deploy'
=========================================
Stack Name [sam-app]: UrlShortener
AWS Region [us-east-1]: eu-central-1
Confirm changes before deploy [y/N]: Y
Allow SAM CLI IAM role creation [Y/n]: Y
HelloWorldFunction may not have authorization defined, Is this okay? [y/N]: Y
Save arguments to samconfig.toml [Y/n]: Y
If you check out the CloudFormation console you will notice a new stack with the name you just defined in the guided deployment. CloudFormation is essentially a tool to provision, maintain and remove infrastructure in AWS. SAM uses CloudFormation under the hood to deploy the infrastrucutre we describe in this workshop.
Try to figure out: