Skip to content

Commit ce7b9c2

Browse files
committed
Add comments to output
1 parent 0609159 commit ce7b9c2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

stack/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import datetime
12
import os
23

34
from . import sftp # noqa: F401
@@ -30,4 +31,13 @@
3031
# Must be last to tag all resources
3132
from . import tags # noqa: F401
3233

34+
# Since we're outputting YAML, we can include comments
35+
print("# This Cloudformation stack template was generated by")
36+
print("# https://github.com/caktus/aws-web-stacks")
37+
print("# at %s" % datetime.datetime.now())
38+
print("# with parameters:")
39+
use_parms = sorted(parm for parm in os.environ.keys() if parm.startswith("USE_"))
40+
for parm in use_parms:
41+
print("#\t%s = %s" % (parm, os.environ[parm]))
42+
print()
3343
print(template.template.to_yaml())

0 commit comments

Comments
 (0)