nl_tokens: Upload a CloudFormation response for a Custom Resource
pl_tokens: function ( event , context , responseStatus , physicalResourceId , responseData , reason ) { return new Promise ( ( resolve , reject ) => { const https = require ( 'https' ) ; const { URL } = require ( 'url' ) ; var responseBody = JSON . stringify ( { Status : responseStatus , Reason : reason , PhysicalResourceId : physicalResourceId || context . logStreamName , StackId : event . StackId , RequestId : event . RequestId , LogicalResourceId : event . LogicalResourceId , Data : responseData } ) ; const parsedUrl = new URL ( event . ResponseURL || defaultResponseURL ) ; const options = { hostname : parsedUrl . hostname , port : 443 , path : parsedUrl . pathname + parsedUrl . search , method : 'PUT' , headers : { 'Content-Type' : '' , 'Content-Length' : responseBody . <mask> } } ; https . request ( options ) . on ( 'error' , reject ) . on ( 'response' , res => { res . resume ( ) ; if ( res . statusCode >= 400 ) { reject ( new Error ( ` ${ res . statusCode } ${ res . statusMessage } ` ) ) ; } else { resolve ( ) ; } } ) . end ( responseBody , 'utf8' ) ; } ) ; }