Add user-data compression info, add warning when templates exceed max. size
This commit is contained in:
parent
b3eb7e3719
commit
2579636d08
@ -62,6 +62,8 @@ def include_raw_gz(context, files=None, gz=True):
|
|||||||
f.write(output.encode())
|
f.write(output.encode())
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
# MaxSize is 21847
|
||||||
|
logger.info("Compressed user-data from {} to {}".format(len(output), len(buf.getvalue())))
|
||||||
return base64.b64encode(buf.getvalue()).decode('utf-8')
|
return base64.b64encode(buf.getvalue()).decode('utf-8')
|
||||||
|
|
||||||
|
|
||||||
|
@ -227,6 +227,8 @@ class Stack(object):
|
|||||||
with open(yaml_file, 'w') as yaml_contents:
|
with open(yaml_file, 'w') as yaml_contents:
|
||||||
yaml_contents.write(self.cfn_template)
|
yaml_contents.write(self.cfn_template)
|
||||||
logger.info('Wrote %s to %s', self.template, yaml_file)
|
logger.info('Wrote %s to %s', self.template, yaml_file)
|
||||||
|
if len(self.cfn_template) > 51200:
|
||||||
|
logger.warning("Rendered template exceeds maximum allowed size of 51200, actual size: {} !".format(len(self.cfn_template)))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logger.error('No cfn template rendered yet for stack {}.'.format(self.stackname))
|
logger.error('No cfn template rendered yet for stack {}.'.format(self.stackname))
|
||||||
|
Loading…
Reference in New Issue
Block a user