You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+107Lines changed: 107 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,3 +49,110 @@ See the local.properties definition above to specify this in a config file.
49
49
50
50
##### Testing Locally
51
51
Testing generated services requires `ClientRuntime` of `smithy-swift` and `AWSClientRuntime` Swift packages.
52
+
53
+
## Alpha SDK Testing Instructions
54
+
*Steps*
55
+
56
+
1. We have all of the AWS SDKs available in our alpha release listed under `/release` except AWS Locations (coming soon).
57
+
58
+
We will walk you through how you can use Cognitoidentity as dependency for example in the steps below. To use it, we will create a test project called TestSdk.
59
+
60
+
```bash
61
+
mkdir TestSdk
62
+
cd TestSdk
63
+
swift package init --type executable
64
+
xed .
65
+
```
66
+
67
+
Once Xcode is open, open Package.swift. Update the file to mirror the following. Notice the three following changes:
68
+
69
+
* Platforms is set to `[.macOS(.v10_15), .iOS(.v13)]`,
70
+
* dependencies: - has a .package which references the Cognitoidentity package
71
+
* the first target “TestSDK” has a dependency listed as “Cognitoidentity”
72
+
73
+
```swift
74
+
// swift-tools-version:5.4
75
+
// The swift-tools-version declares the minimum version of Swift required to build this package.
Update the scheme in Xcode to put your AWS credentials in env variables (we don’t have auto credential resolution quite finished yet, only 3/4 done sry)
99
+
100
+
Variable names are:*
101
+
```
102
+
AWS_ACCESS_KEY_ID
103
+
AWS_SECRET_ACCESS_KEY
104
+
```
105
+
(if you need help with getting these values, talk to wooj@ or nickik@
106
+
107
+
Then you can open up main.swift, and instantiate Cognitoidentity as follows:
108
+
109
+
```swift
110
+
importCognitoidentity
111
+
importFoundation
112
+
113
+
//this config file will be moved out of the client,
114
+
// I realize this is a pain right now and we have an open ticket for it.
115
+
let config =try! CognitoidentityClient.CognitoidentityClientConfiguration.default()
116
+
let cognitoIdentityClient =CognitoidentityClient(config: config)
117
+
let cognitoInputCall =CreateIdentityPoolInput(allowClassicFlow: nil,
cognitoIdentityClient.createIdentityPool(input: cognitoInputCall) { (result) in
128
+
switch(result) {
129
+
case .success(let output):
130
+
print("\(output)")
131
+
case .failure(let error):
132
+
print("\(error)")
133
+
}
134
+
}
135
+
```
136
+
137
+
As a result, you should be able to:
138
+
139
+
1. Log into your AWS console, go to us-east-1 (we default region to us-east-1, no region resolver yet)
140
+
2. Click on cognito
141
+
3. click on cognito identity pools
142
+
4. Verify that you see the newly created identity pool name: identityPoolMadeWithSwiftSDK
143
+
144
+
145
+
If you’ve made it this far... Congrats!🎉
146
+
147
+
*What’s next?*
148
+
Try some other calls? Help us better understand what you think the most critical features are next. Run into any bugs? Give us feedback on the call-site interface. etc...
149
+
150
+
## Logging
151
+
The AWS SDK for Swift uses SwiftLog for high performant logging. Many of our calls are issued to the `debug` level of output, which are disabled in the console by default. To see debug output to your console, you can add the following code to your application in a place where you know that the code will be called once and only once:
152
+
```swift
153
+
LoggingSystem.bootstrap { label in
154
+
var handler = StreamLogHandler.standardOutput(label: label)
0 commit comments