- 
                Notifications
    You must be signed in to change notification settings 
- Fork 118
Add AWS SDK and Soto examples #396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            41 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      cb2cdde
              
                fix typos on API GAteway example
              
              
                sebsto bd07401
              
                add aws sdk example
              
              
                sebsto 570b416
              
                adjust for local CI
              
              
                sebsto 5e80824
              
                add soto example
              
              
                sebsto 0398590
              
                Merge branch 'main' into sebsto/awssdk_example
              
              
                sebsto c75c999
              
                update soto example readme
              
              
                sebsto b545738
              
                format
              
              
                sebsto 903c5d3
              
                Merge branch 'main' into sebsto/awssdk_example
              
              
                sebsto 6bf8f0f
              
                swift format
              
              
                sebsto b41810e
              
                Merge branch 'swift-server:main' into sebsto/awssdk_example
              
              
                sebsto 77b0c86
              
                fix uppercase A
              
              
                sebsto 83446a8
              
                remove unnecessary license header file
              
              
                sebsto 1030816
              
                use trailing closure syntax + reuse S3 client
              
              
                sebsto ba1f39d
              
                remove unnecessary license header
              
              
                sebsto 33202cd
              
                remove condition on Linux for platform
              
              
                sebsto 46e5337
              
                swift format
              
              
                sebsto 683cd55
              
                remove unnecessary license header
              
              
                sebsto cc3f3c2
              
                add soto client shutdown
              
              
                sebsto 20f7e51
              
                Merge branch 'main' into sebsto/awssdk_example
              
              
                sebsto 5dc8371
              
                Merge branch 'main' into sebsto/awssdk_example
              
              
                sebsto 0e4fa0c
              
                revert platform dance to not break CI
              
              
                sebsto 39deb51
              
                remove unnecessary init
              
              
                sebsto bc3fe1a
              
                rename directory to SotoS3
              
              
                sebsto 4748146
              
                Merge branch 'main' into sebsto/awssdk_example
              
              
                sebsto 0e9b045
              
                change directory name to focus on use case first, lib second
              
              
                sebsto 9c91745
              
                fix typos in the readme
              
              
                sebsto 28ca63e
              
                Merge branch 'main' into sebsto/awssdk_example
              
              
                sebsto e54297b
              
                Merge branch 'main' into sebsto/awssdk_example
              
              
                sebsto a3b29c6
              
                add new examples to CI
              
              
                sebsto 96efb9a
              
                fix CI for examples
              
              
                sebsto b47d1b8
              
                use amazonlinux docker image instead of ubuntu
              
              
                sebsto 38ab48a
              
                dynamically add runtime dependency based on env var
              
              
                sebsto 4e73292
              
                remove import of Foundation.ProcessInfo
              
              
                sebsto 56b07b5
              
                change log level and add comment in template.yaml
              
              
                sebsto 156c7e7
              
                downgrade actions/checkout to v3 to workaround dependency on mazonLin…
              
              
                sebsto b747e5d
              
                Swift format
              
              
                sebsto 34ec3ed
              
                workaround https://github.com/actions/checkout/issues/1487
              
              
                sebsto d40d324
              
                fix CI
              
              
                sebsto 6998a50
              
                fix ci
              
              
                sebsto c5039ea
              
                fix ci
              
              
                sebsto f5506f5
              
                fix ci
              
              
                sebsto File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| .DS_Store | ||
| .aws-sam/ | ||
| .build | ||
| samtemplate.toml | ||
| */build/* | ||
| /.build | ||
| /Packages | ||
| xcuserdata/ | ||
| DerivedData/ | ||
| .swiftpm/configuration/registries.json | ||
| .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
| .netrc | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| // swift-tools-version: 6.0 | ||
|  | ||
| import PackageDescription | ||
|  | ||
| // needed for CI to test the local version of the library | ||
| import struct Foundation.URL | ||
|  | ||
| #if os(macOS) | ||
| let platforms: [PackageDescription.SupportedPlatform]? = [.macOS(.v15)] | ||
| #else | ||
| let platforms: [PackageDescription.SupportedPlatform]? = nil | ||
| #endif | ||
|  | ||
| let package = Package( | ||
| name: "AWSSDKExample", | ||
| platforms: platforms, | ||
| products: [ | ||
| .executable(name: "AWSSDKExample", targets: ["AWSSDKExample"]) | ||
| ], | ||
| dependencies: [ | ||
| // during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below | ||
| .package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", branch: "main"), | ||
| .package(url: "https://github.com/swift-server/swift-aws-lambda-events", branch: "main"), | ||
| .package(url: "https://github.com/awslabs/aws-sdk-swift", from: "1.0.0"), | ||
| ], | ||
| targets: [ | ||
| .executableTarget( | ||
| name: "AWSSDKExample", | ||
| dependencies: [ | ||
| .product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"), | ||
| .product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"), | ||
| .product(name: "AWSS3", package: "aws-sdk-swift"), | ||
| ] | ||
| ) | ||
| ] | ||
| ) | ||
|  | ||
| if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"], | ||
| localDepsPath != "", | ||
| let v = try? URL(fileURLWithPath: localDepsPath).resourceValues(forKeys: [.isDirectoryKey]), | ||
| v.isDirectory == true | ||
| { | ||
| // when we use the local runtime as deps, let's remove the dependency added above | ||
| let indexToRemove = package.dependencies.firstIndex { dependency in | ||
| if case .sourceControl( | ||
| name: _, | ||
| location: "https://github.com/swift-server/swift-aws-lambda-runtime.git", | ||
| requirement: _ | ||
| ) = dependency.kind { | ||
| return true | ||
| } | ||
| return false | ||
| } | ||
| if let indexToRemove { | ||
| package.dependencies.remove(at: indexToRemove) | ||
| } | ||
|  | ||
| // then we add the dependency on LAMBDA_USE_LOCAL_DEPS' path (typically ../..) | ||
| print("[INFO] Compiling against swift-aws-lambda-runtime located at \(localDepsPath)") | ||
| package.dependencies += [ | ||
| .package(name: "swift-aws-lambda-runtime", path: localDepsPath) | ||
| ] | ||
| } | ||
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.