Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

A Hummingbird extension using Soto for AWS.

License

Notifications You must be signed in to change notification settings

BinaryBirds/hummingbird-aws

Repository files navigation

Hummingbird extension with Soto for AWS

A Hummingbird extension using Soto for AWS.

Getting started

Adding the dependency

Add the following entry in your Package.swift to start using HummingbirdAWS:

.package(url: "https://github.com/binarybirds/hummingbird-aws", from: "1.0.0"),

and HummingbirdAWS dependency to your target:

.product(name: "HummingbirdAWS", package: "hummingbird-aws"),    

Usage example

import Hummingbird
import HummingbirdAWS

let app = HBApplication()

// setup default client 
app.services.setUpBasicAWSService(eventLoopGroup: app.eventLoopGroup)

// set custom client
app.services.aws = .init(
    credentialProvider: .static(
        accessKeyId: "foo",
        secretAccessKey: "bar"
    ),
    retryPolicy: .noRetry,
    middlewares: [],
    options: .init(
        requestLogLevel: .critical,
        errorLogLevel: .critical
    ),
    httpClientProvider: .createNewWithEventLoopGroup(app.eventLoopGroup),
    logger: app.logger
)

// get aws client
let client = app.aws
let client = req.aws