@@ -11,7 +11,7 @@ Deployment and application code adaptors are being added for the following:
11
11
12
12
| Platform | Deployment | Status |
13
13
| --------------------------| -----------------------| :----------------------:|
14
- | AWS Lambda | AWS SAM | |
14
+ | AWS Lambda | AWS SAM | : heavy_check_mark : |
15
15
| AWS Lambda | Terraform | :heavy_check_mark : |
16
16
| Azure Functions | Terraform | |
17
17
| Google Cloud Functions | Terraform | |
@@ -108,6 +108,35 @@ $ http-prompt $(cd terraform && terraform output api_url)
108
108
GET artists
109
109
```
110
110
111
+ ### [ AWS Serverless Application Model (SAM)] ( https://aws.amazon.com/about-aws/whats-new/2016/11/introducing-the-aws-serverless-application-model/ ) Deployment
112
+
113
+ Unlike Terraform SAM doesn't upload the zip bundle so do this using the ` aws-cli ` tool.
114
+ ``` Shell
115
+ $ aws s3 mb s3://< mybucket>
116
+ $ aws s3 cp terraform/dist/python-serverless-api.zip s3://< mybucket> /python-serverless-api.zip
117
+ ```
118
+
119
+ Update the S3 bucket value in the SAM config.
120
+ ``` YAML
121
+ # template.yaml
122
+ AWSTemplateFormatVersion : ' 2010-09-09'
123
+ Transform : ' AWS::Serverless-2016-10-31'
124
+ Description : ' Boilerplate Python 3.6 Flask App.'
125
+ Resources :
126
+ FlaskAPI :
127
+ Type : ' AWS::Serverless::Function'
128
+ Properties :
129
+ CodeUri : s3://<mybucket>/flask-app.zip
130
+ ` ` `
131
+
132
+ Deploy the SAM template with Cloudformation.
133
+ ` ` ` Shell
134
+ $ aws cloudformation deploy \
135
+ --template-file template.yaml \
136
+ --stack-name python-serverless-stack-sam
137
+ --capabilities CAPABILITY_IAM
138
+ ```
139
+
111
140
112
141
-----------------------------------------------------------
113
142
## Test
0 commit comments