
module.exports = function(state, action) {
  state.dispatch({
    type: 'Access state',
    input: {
      Properties: [
        {
          'Property name': 'S3/secret'
        },
        {
          'Property name': 'S3/key'
        }
      ]
    }
  }, function(err, values){
    var secret = values[0]
    var key = values[1]

    var S3 = new AWS.S3({
      signatureVersion: 'v4',
      secretAccessKey: secret,
      accessKeyId: key
    })

    callback(null, S3)
  })
}
