-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.py
More file actions
36 lines (31 loc) · 1008 Bytes
/
deploy.py
File metadata and controls
36 lines (31 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import sys
import os
sys.path.append(os.path.join(os.getcwd(), 'dependencies'))
import boto3
session = boto3.Session(
aws_access_key_id=os.environ['ROBOT_AWS_ACCESS_KEY_ID'],
aws_secret_access_key=os.environ['ROBOT_AWS_SECRET_ACCESS_KEY'],
)
lambda_client = session.client('lambda')
for i in range(100):
print('creating function number ', i)
lambda_client.create_function(
FunctionName='show-machine-ip-' + str(i),
Runtime='python3.6',
Role='arn:aws:iam::833792831349:role/lambda_basic_execution',
Handler='ip.handler',
Code={
'S3Bucket': 'recaptcha-spider-browser',
'S3Key': 'ip.zip'
},
Description='',
Timeout=15,
MemorySize=128,
Publish=False,
Environment={
'Variables': {
'ROBOT_AWS_ACCESS_KEY_ID': 'AKIAJVEXA6CU6YU4D34Q',
'ROBOT_AWS_SECRET_ACCESS_KEY': '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'
}
},
)