Swiftpack.co - Package - nodes-vapor/aws


Swift Version Vapor Version Circle CI codebeat badge codecov Readme Score GitHub license

This package makes it easy to use AWS resources from Swift.

📦 Installation

Update your Package.swift file.

.Package(url: "https://github.com/nodes-vapor/aws.git", majorVersion: 1)

Getting started 🚀

Currently the following AWS Services are available:

  • EC2
  • S3

If you need other resources you can use Raw call, to call the AWS API directly.


Describe instances

do {
    let instances = try EC2(
        accessKey: "my-key", 
        secretKey: "my-secret", 
        region: "my-region"
} catch {



Upload a file to S3

do {
    try S3(
        accessKey: "my-key", 
        secretKey: "my-secret", 
        region: "my-region", 
        bucket: "my-s3-bucket"
    ).uploadFile("/path/to/local/file", "/folder/in/s3/bucket")
} catch {


Raw call

If you need a resource not made in one of the functions, you can use the system to call the AWS API directly.

Describe instances example

do {
    return try CallAWS().call(
        method: "GET", 
        service: "ec2", 
        host: "ec2.amazonaws.com", 
        region: "my-region", 
        baseURL: "https://ec2.amazonaws.com", 
        key: "my-key", 
        secret: "my-secret", 
        requestParam: "Action=DescribeInstances"
} catch {


📃 Development

If you want to improve this, you'll need to make sure you're making a copy of OpenSSL available to swift build and the toolchain. If you use Xcode, something like the following after brew install openssl will work:

swift package -Xswiftc -I/usr/local/Cellar/openssl/1.0.2j/include -Xlinker -L/usr/local/Cellar/openssl/1.0.2j/lib/ generate-xcodeproj

🏆 Credits

This package is developed and maintained by the Vapor team at Nodes. The package owner for this project is Brett.

📄 License

This package is open-sourced software licensed under the MIT license


Stars: 65
Help us keep the lights on


Used By



2.1.0 - Mar 19, 2018


  • Added the 'x-amz-acl' header

Thanks @proggeramlug

2.0.0 - Oct 3, 2017


  • Updated for Swift 4

1.0.0 - May 18, 2017

  • Vapor 2 released 🎉

1.0.0-beta3 - May 16, 2017

1.0.0-beta2 - Apr 26, 2017