Created
March 1, 2018 04:51
-
-
Save iDVB/d1ff4a3499d5b463ba954feccd90cfec to your computer and use it in GitHub Desktop.
Custom Resource for AWS Transcoder Pipelines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AWS = require('aws-sdk'); | |
var elastictranscoder = new AWS.ElasticTranscoder(); | |
var Create = function(params, reply) { | |
elastictranscoder.createPipeline(params, function(err, data) { | |
if (err) { | |
console.error(err); | |
reply(err); | |
} else { | |
reply(null, data.Pipeline.Id, { "Arn": data.Pipeline.Arn }); | |
} | |
}); | |
}; | |
var Update = function(physicalId, params, oldParams, reply) { | |
params.Id = physicalId; | |
delete params.OutputBucket; | |
elastictranscoder.updatePipeline(params, function(err, data) { | |
if (err) { | |
console.error(err); | |
reply(err); | |
} else { | |
reply(null, data.Pipeline.Id, { "Arn": data.Pipeline.Arn }); | |
} | |
}); | |
}; | |
var Delete = function(physicalId, params, reply) { | |
var p = { | |
Id: physicalId | |
}; | |
elastictranscoder.deletePipeline(p, function(err, data) { | |
if (err) console.error(err) | |
reply(err, physicalId); | |
}); | |
}; | |
exports.Create = Create; | |
exports.Update = Update; | |
exports.Delete = Delete; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment