Skip to content

Commit d7422ab

Browse files
committed
add makefile to package SAM template
1 parent aa3d476 commit d7422ab

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

01_LexBotInformational/Readme.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ In this step, we will use a CloudFormation template to provision the AWS Lambda
2525

2626
Region| Region Code | Launch
2727
------|------|-------
28-
US East (N. Virginia) | <span style="font-family:'Courier';">us-east-1</span> | [![Launch Module 1 in us-east-1](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/images/cloudformation-launch-stack-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=lex-workshop&templateURL=https://s3.amazonaws.com/lex-customerservice-workshop/setup-node12.yaml)
29-
28+
US East (N. Virginia) | <span style="font-family:'Courier';">us-east-1</span> | [![Launch Module 1 in us-east-1](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/images/cloudformation-launch-stack-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=lex-workshop&templateURL=https://lex-customer-service-workshop.s3.amazonaws.com/setup.yaml)
3029

3130
<details>
3231
<summary><strong>CloudFormation Launch Instructions (expand for details)</strong></summary><p>
@@ -39,7 +38,7 @@ US East (N. Virginia) | <span style="font-family:'Courier';">us-east-1</span>
3938

4039
1. On the Options page, leave all the defaults and click **Next**.
4140

42-
1. On the Review page, check the boxes to acknowledge that CloudFormation will create IAM resources.
41+
1. On the Review page, check all the boxes to acknowledge that CloudFormation will create IAM resources.
4342

4443
<img src="images/cloudformation-changeset.png" alt="" width="120%">
4544

Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
AWS_REGION ?= us-east-1
2+
ARTIFACTS_BUCKET ?= lex-customer-service-workshop
3+
4+
target:
5+
$(info ${HELP_MESSAGE})
6+
@exit 0
7+
8+
package:
9+
cd lambda-functions/load-data/ && \
10+
npm install && \
11+
cd ../../cloudformation && \
12+
sam package \
13+
-t sam.yaml \
14+
--s3-bucket ${ARTIFACTS_BUCKET} \
15+
--s3-prefix workshop-lambdas \
16+
--region ${AWS_REGION} \
17+
--output-template-file sam-packaged.yaml && \
18+
aws s3 cp sam-packaged.yaml s3://${ARTIFACTS_BUCKET}/setup.yaml
19+
20+
define HELP_MESSAGE
21+
22+
Environment variables:
23+
24+
AWS_REGION: "us-east-1"
25+
Description: Feature branch name used as part of stacks name
26+
ARTIFACTS_BUCKET: "lex-customer-service-workshop"
27+
Description: S3 Bucket name used for deployment artifacts
28+
Common usage:
29+
30+
...::: Bootstraps environment with necessary tools like SAM CLI, cfn-lint, etc. :::...
31+
$ make init
32+
33+
...::: Package all resources :::...
34+
$ make package
35+
36+
endef

0 commit comments

Comments
 (0)