Skip to content

Instantly share code, notes, and snippets.

@vizowl
Created July 20, 2017 02:54
Show Gist options
  • Save vizowl/e3ef85d3bab0a3f311e7e068d70a003f to your computer and use it in GitHub Desktop.
Save vizowl/e3ef85d3bab0a3f311e7e068d70a003f to your computer and use it in GitHub Desktop.
List objects in bucket via amazonks
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Lens
import Network.AWS
import Network.AWS.S3
main :: IO ()
main = do
e <- newEnv Discover <&> set envRegion Sydney
ex <- runResourceT . runAWS e $ send $ listObjects $ BucketName "BUCKET_NAME"
print [ (x ^. oKey, x ^. oETag) | x <- ex ^. lorsContents ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment