in AWSConfig/AWS-Config-OPA/lambda_sources/function/opa_lambda.py [0:0]
def get_tempfile(content):
try:
tf = tempfile.NamedTemporaryFile(mode='w+', encoding='utf-8')
tf.write(content)
tf.seek(0)
except Exception as e:
logger.error('Creating tempfile failed with {}'.format(e))
raise
else:
return tf