← AWS CoreCONTENT HISTORY

Update to AWS Core

Snapshot Sep 30, 2026 · 22:47 UTC · version 1.0.0

Collection source: not recorded for this historical snapshot.

WHAT CHANGED · RULE-BASED ANALYSIS

First saved snapshot

No earlier snapshot is available to establish a change.

Compare saved observations

Download comparison JSON
Full technical diff · 0 changed fields
Full snapshot data
{
  "name": "aws-sdk-swift-usage",
  "description": "AWS SDK for Swift development patterns. Use when writing Swift code that uses AWS services via aws-sdk-swift package.",
  "included_files": [],
  "skill_md_contents": "---\nname: aws-sdk-swift-usage\ndescription: |\n  AWS SDK for Swift development patterns. Use when writing Swift code that uses AWS services via aws-sdk-swift package.\n---\n\n# AWS SDK for Swift\n\n## Async Code Structure\n\nAll SDK operations are async. Use `@main` entry point:\n\n```swift\n@main\nstruct Main {\n    static func main() async throws {\n        let client = try await S3Client()\n        // ... async operations\n    }\n}\n```\n\n## CRITICAL: Use Struct Config Types\n\nNEVER use `S3ClientConfiguration` or `DynamoDBClientConfiguration` - these are DEPRECATED classes.\n\nALWAYS use the struct-based config types:\n\n- `S3Client.S3ClientConfig` (not S3ClientConfiguration)\n- `DynamoDBClient.DynamoDBClientConfig` (not DynamoDBClientConfiguration)  \n- `STSClient.STSClientConfig` (not STSClientConfiguration)\n\nConfig parameters MUST be in declaration order. Region is ALWAYS required when creating a config. Check the service client source for exact order.\n\n```swift\n// CORRECT - struct config\nlet config = try await S3Client.S3ClientConfig(region: \"us-west-2\")\nlet client = S3Client(config: config)\n\n// WRONG - deprecated class\n// let config = try await S3Client.S3ClientConfiguration(region: \"us-west-2\")\n```\n\n## Client Creation\n\nAll service clients follow the same pattern: `<Service>Client` with `<Service>Client.<Service>ClientConfig`.\n\nModel types (structs/enums used in requests/responses) are namespaced under `<Service>ClientTypes`:\n\n- `S3ClientTypes.Bucket`, `S3ClientTypes.Object`\n- `DynamoDBClientTypes.AttributeValue`\n- `CloudWatchClientTypes.MetricDatum`, `CloudWatchClientTypes.Dimension`\n\n```swift\nimport AWSS3\nimport AWSDynamoDB\n\n// Simple - auto-detects region\nlet s3 = try await S3Client()\nlet dynamo = try await DynamoDBClient()\n\n// With region\nlet s3 = try S3Client(region: \"us-west-2\")\n\n// With config - parameters must be in declaration order\nlet config = try await S3Client.S3ClientConfig(\n    useFIPS: true,\n    awsRetryMode: .adaptive,\n    maxAttempts: 5,\n    region: \"us-west-2\"\n)\nlet client = S3Client(config: config)\n\n// With custom endpoint and credentials\nlet config = try await S3Client.S3ClientConfig(\n    awsCredentialIdentityResolver: resolver,\n    region: \"us-west-2\",\n    endpoint: \"https://s3.custom-endpoint.com\"\n)\n```\n\nCommon config parameters (MUST follow declaration order):\n\n- `awsCredentialIdentityResolver` - Custom credentials\n- `useFIPS` - Enable FIPS endpoints\n- `useDualStack` - Enable dual-stack endpoints\n- `awsRetryMode` - Retry strategy (.adaptive, .standard, .legacy)\n- `maxAttempts` - Max retry attempts\n- `region` - AWS region\n- `httpClientEngine` - Custom HTTP client (requires HttpClientConfiguration parameter):\n\n  ```swift\n  import ClientRuntime\n  let httpConfig = HttpClientConfiguration()\n  let httpClient = URLSessionHTTPClient(httpClientConfiguration: httpConfig)\n  let config = try await S3Client.S3ClientConfig(\n      region: \"us-east-1\",\n      httpClientEngine: httpClient\n  )\n  ```\n\n- `endpoint` - Custom endpoint URL\n\nFor service-specific config options or exact parameter order, check `Sources/Services/AWS<Service>/Sources/AWS<Service>/<Service>Client.swift` in the SDK.\n\n## Credential Resolvers\n\n```swift\nimport AWSSDKIdentity\nimport SmithyIdentity\n\n// Static credentials - pass credential object directly\nlet creds = AWSCredentialIdentity(accessKey: \"AKIA...\", secret: \"...\")\nlet resolver = StaticAWSCredentialIdentityResolver(creds)\n\n// Assume role - REQUIRES underlying resolver\nlet underlying = try DefaultAWSCredentialIdentityResolverChain()\nlet resolver = try STSAssumeRoleAWSCredentialIdentityResolver(\n    awsCredentialIdentityResolver: underlying,\n    roleArn: \"arn:aws:iam::123456789012:role/MyRole\",\n    sessionName: \"session-name\"\n)\n\n// Use in config\nlet config = try await S3Client.S3ClientConfig(\n    awsCredentialIdentityResolver: resolver,\n    region: \"us-west-2\"\n)\n```\n\n## Waiters\n\nImport `SmithyWaitersAPI`. WaiterOptions requires `maxWaitTime` parameter:\n\n```swift\nimport AWSS3\nimport SmithyWaitersAPI\n\nlet client = try await S3Client()\n_ = try await client.waitUntilBucketExists(\n    options: WaiterOptions(maxWaitTime: 120.0),\n    input: HeadBucketInput(bucket: \"my-bucket\")\n)\n```\n\n## Pagination\n\n```swift\nlet input = ListObjectsV2Input(bucket: \"my-bucket\")\nfor try await page in client.listObjectsV2Paginated(input: input) {\n    for object in page.contents ?? [] {\n        print(object.key ?? \"\")\n    }\n}\n```\n\n## Presigned URLs\n\n```swift\nlet url = try await client.presignedURLForGetObject(\n    input: GetObjectInput(bucket: \"my-bucket\", key: \"file.pdf\"),\n    expiration: 3600\n)\n```\n\n## Common Operations\n\n```swift\n// Put object\n_ = try await client.putObject(input: PutObjectInput(\n    body: .data(data),\n    bucket: \"bucket\",\n    key: \"key\"\n))\n\n// Get object\nlet output = try await client.getObject(input: GetObjectInput(bucket: \"bucket\", key: \"key\"))\nlet data = try await output.body?.readData()\n\n// List buckets\nlet response = try await client.listBuckets(input: ListBucketsInput())\nfor bucket in response.buckets ?? [] {\n    print(bucket.name ?? \"\")\n}\n```\n"
}

SHA-256: 6278b17c10459c88b6d2e3d2b0e33fd6155ff2616955bd71c088673e42647fad