Does anyone know of a Scala SDK for Amazon Web Services? I am particularly interested in the EMR jobs.
Asked
Active
Viewed 1.7k times
4 Answers
13
Take a look at AWScala (it's a simple wrapper on top of AWS SDK for Java):
https://github.com/seratch/AWScala
[UPDATE from 04/07/2015]: Another very promising library from @dwhjames:
Asynchronous Scala Clients for Amazon Web Services https://dwhjames.github.io/aws-wrap/

alboko
- 488
- 5
- 15
-
this looks impressive. Thanks @Alex – CruncherBigData Dec 27 '13 at 18:19
-
A bit of a drawback is that AWScala draws in all of `aws-java-sdk` (30 MB lib), even if you only need, say, Amazon S3 and `aws-java-sdk-s3` dependency would suffice (2.7 + 2.4 MB with `aws-java-sdk-core`). – Jonik Dec 19 '15 at 19:49
-
2@jonik seems this has been addressed and you can now only add the S3 dependency if that's all you need – Cpt. Senkfuss Jun 04 '18 at 07:58
12
You could use the standard Java SDK directly without any problems from Scala, however I'm not aware of any Scala specific SDKs.

enticedwanderer
- 4,346
- 28
- 24
-
3
-
7@yegor256 It's badly suitable for Scala because it's blocking by default and its `async` set of classes uses ancient and useless Java `Future` that doesn't have completion callback. – expert Jan 07 '16 at 15:54
2
Atlassian's aws-scala is quite good.
p.s. Currently the library has basic support for S3, DynamoDB, CloudFormation and SQS

Neil
- 7,482
- 6
- 50
- 56
-
What makes me uneasy about using this one is that the issue tracker is private. So we cannot see the existing bugs or even file bugs. – Johnny Everson Mar 11 '16 at 15:40
-
1It's a bit more complex than others. Could really use some documentation. – Anton Kuzmin Aug 01 '16 at 05:53
1
You can use just regular AWS Java SDK in scala. For example:
Add the following to build.sbt
if you use SBT:
libraryDependencies += "com.amazonaws" % "aws-java-sdk" % "1.12.1"
then:
package example
import com.amazonaws.regions.Regions;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.AmazonS3Exception;
import com.amazonaws.services.s3.model.Bucket;
// for conversions from java collections to scala collections
// e.g. java.util.List to scala List
import scala.jdk.CollectionConverters._
object Hello extends App {
// create s3 client
val s3:AmazonS3 = AmazonS3ClientBuilder
.standard()
.withRegion(Regions.AP_SOUTHEAST_2).build();
// get bucket list
val buckets:List[Bucket] = s3.listBuckets().asScala.toList
// print bucket names
buckets.foreach(b => println(b.getName()))
}

Marcin
- 215,873
- 14
- 235
- 294