Access AWS S3 metadata in APIGW Integration Response Mapping template

25 views Asked by At

Im trying to access one of the values of the s3 object metadata (obj.json) in order to overide the statusCode of the response to the client.

Im trying something like:

#set($incomplete = $input.path('$.integration.response.header.x-amz-meta-incomplete'))
    #set($body = $input.json('$.integration.response'))
    #set($statusCode = 200)
    #if($incomplete == 'true')
     #set($statusCode = 206)
    #end
    {
      "statusCode": $statusCode,
      "body": $util.escapeJavaScript($body.toString())
    }

But it never seems to pass the if statement. The value of the metadata value in the AWS S3 object metadata key (x-amz-meta-incomplete) is defined as true.

Am i missing something?

0

There are 0 answers