soto-project /soto

Swift SDK for AWS that works on Linux, macOS and iOS

★ 998⑂ 99👁 14⑃ 523● 261▤ 120
SwiftApache-2.0Created 2017-03-12soto.codes
下载:v7.17.0v7.17.0 ↓7.17.02026-10-01
+0
日增长
-1
周增长
998
stars
99
forks
14
watchers
523
prs
261
issues
120
releases

README

Soto for AWS





Soto is a Swift language SDK for Amazon Web Services (AWS), working on Linux, macOS and iOS. This library provides access to all AWS services. The service APIs it provides are a direct mapping of the REST APIs Amazon publishes for each of its services. Soto is a community supported project and is in no way affiliated with AWS.

Table of Contents
-----------------

- Structure
- Swift Package Manager
- Configuring Credentials
- Using Soto
- Documentation
    - API Reference
    - User guides
- Contributing
- License

 Structure

The library consists of three parts
1. soto-core which does all the core request encoding and signing, response decoding and error handling.
2. The service api files which define the individual AWS services and their commands with their input and output structures.
3. The CodeGenerator which builds the service api files from the JSON model files supplied by Amazon.

 Swift Package Manager

Soto uses the Swift Package Manager to manage its code dependencies. To use Soto in your codebase it is recommended you do the same. Add a dependency to the package in your own Package.swift dependencies.
swift
    dependencies: [
        .package(url: "https://github.com/soto-project/soto.git", from: "7.0.0")
    ],

Then add target dependencies for each of the Soto targets you want to use.
swift
    targets: [
        .target(name: "MyApp", dependencies: [
            .product(name: "SotoS3", package: "soto"),
            .product(name: "SotoSES", package: "soto"),
            .product(name: "SotoIAM", package: "soto")
        ]),
    ]
)

Alternatively if you are using Xcode 11 or later you can use the Swift Package Manager integration and add a dependency to Soto through that.

 Configuring Credentials

Before using the SDK, you will need AWS credentials to sign all your requests. Credentials can be provided to the library in the following ways.
- Environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
- ECS container IAM policy
- EC2 IAM instance profile
- Shared credentials file in your home directory
- Static credentials provided at runtime

You can find out more about credential providers here

 Using Soto

To use Soto you need to create an AWSClient and a service object for the AWS service you want to work with. The AWSClient provides all the communication with AWS and the service object provides the configuration and APIs for communicating with a specific AWS service. More can be found out about AWSClient here and the AWS service objects here.

swift
import SotoS3 //ensure this module is specified as a dependency in your package.swift

let bucket = "my-bucket"

let client = AWSClient(
    credentialProvider: .static(accessKeyId: "Your-Access-Key", secretAccessKey: "Your-Secret-Key"),
    httpClientProvider: .createNew
)
let s3 = S3(client: client, region: .uswest2)

func createBucketPutGetObject() async throws - S3.GetObjectOutput {
    // Create Bucket, Put an Object, Get the Object
    _ = try awai

Top issues

Discussions

Latest release

v7.17.0 7.17.0 2026-10-01
Using Soto-core v7.17.0
SDK files generated by soto-codegenerator v7.10.0

 Minor release changes
- Add RetryPolicy to credential providers that perform AWS operations

Snapshot: 2026-11-27T22:26:53Z · Data license Apache-2.0 · JSON