-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.py
35 lines (30 loc) · 1.2 KB
/
template.py
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
#!/usr/bin/env python
import sys
sys.path.append('source') # add source to the Python path
from troposphere import Template, Output, Parameter
from functions import document_tasks, document_fsm
def main():
"""main function"""
t = Template()
t.set_transform('AWS::Serverless-2016-10-31')
# add resources to the template
resources = [] \
+ document_fsm.DocumentReviewMachine.cf_resources() \
+ document_fsm.launch.cf_resources() \
+ document_fsm.transition.cf_resources() \
+ document_fsm.info.cf_resources()
resources += document_tasks.archive_document.cf_resources() \
+ document_tasks.delete_document.cf_resources() \
+ document_tasks.notify_reviewer.cf_resources() \
+ document_tasks.notify_uploader.cf_resources() \
+ document_tasks.summarize_document.cf_resources()
for r in resources:
t.add_resource(r)
# output yaml template
print(t.to_yaml())
# could write to file, but rather print to stdout then pipe to somewhere
# f = open('template.yaml', 'w')
# f.write(t.to_yaml())
# f.close()
if __name__ == '__main__':
main()