Skip to content

Commit f012367

Browse files
committed
fix lambda setup in setup_AWS
1 parent 5c3ec4f commit f012367

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

documentation/DCP-documentation/step_0_prep.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ If you'd rather, you can generate a new key pair to use for this during creation
1717
You should add an inbound SSH connection from your IP address to your security group.
1818

1919
### 1.2 Automatically created resources
20+
* BEFORE running setup_AWS, you need to open `lambda_function.py` and edit the `BUCKET_NAME` (keeping the quotes around the name) at the top of the file to be the name of your bucket.
21+
After editing, Line 12 of `lambda_function.py` should look like `bucket = "my-bucket-name"`.
2022
* Run setup_AWS by entering `python setup_AWS.py` from your command line.
2123
It will automatically create:
2224
* an [ecsInstanceRole](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html) with appropriate permissions.

setup_AWS.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import sys
22
import boto3
33
import json
4+
import shutil
5+
import os
46

57
iam = boto3.client("iam")
68
sns = boto3.client("sns")
@@ -119,6 +121,7 @@ def setup():
119121
# Create Monitor Lambda function
120122
LambdaFullAccess = iam.get_role(RoleName="LambdaFullAccess")
121123

124+
shutil.make_archive("lambda_function", 'zip', os.getcwd())
122125
fxn = open("lambda_function.zip", "rb").read()
123126
try:
124127
MonitorFunction = lmbda.create_function(

0 commit comments

Comments
 (0)