jweinst1
4/5/2018 - 4:53 PM

proper AWS lambda function that forms response for lambda proxy

proper AWS lambda function that forms response for lambda proxy

import json

import boto3

def lambda_handler(event, context):
    client = boto3.client('glacier')
    vault = event['queryStringParameters']['vaultname']
    vault_des = client.describe_vault(vaultName=vault)
    return {
       "isBase64Encoded": True,
       "statusCode": 200,
       "headers": { "headerName": "headerValue"},
       "body": json.dumps(vault_des)
    }