-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
26 lines (20 loc) · 731 Bytes
/
main.py
File metadata and controls
26 lines (20 loc) · 731 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
from packer_abstract import AbstractPacker as Runner
def lambda_handler(event, context):
Runner.log(event)
try:
template_file = event['packer_template_file']
packer_bin = event['packer_binary']
package = event['package']
except KeyError as e:
raise e
build = Runner(event, packer_template_file=template_file, exec_path=packer_bin, package=package)
build_response = build.run_build(event)
build.log(build_response)
event = {
"packer_template_file" : "templates/packer_template.json",
"packer_binary": "bin/packer",
"shared_accounts": [ "12345678923"],
"package": "package/packer.zip"
}
if __name__ == "__main__":
lambda_handler(event, context=None)