@@ -124,11 +124,15 @@ class Example {
124124 //======================================================================
125125
126126 // snippet-start:[swift.identity.cognito.resolve]
127+ // Create a Cognito credential resolver that uses the Cognito Identity
128+ // Pool created above.
127129 let cognitoCredentialResolver = try CognitoAWSCredentialIdentityResolver (
128130 identityPoolId: identityPoolID,
129131 identityPoolRegion: region
130132 )
131133
134+ // Create an AWS STS client that uses the new Cognito credential
135+ // resolver to do credential identity resolution.
132136 let cognitoSTSConfig = try await STSClient . STSClientConfiguration (
133137 awsCredentialIdentityResolver: cognitoCredentialResolver,
134138 region: " us-east-1 "
@@ -194,6 +198,7 @@ class Example {
194198 // In this example, we list S3 buckets.
195199 //======================================================================
196200
201+ // snippet-start:[swift.identity.cognito.s3]
197202 let s3Config = try await S3Client . S3ClientConfiguration (
198203 awsCredentialIdentityResolver: cognitoCredentialResolver,
199204 region: region
@@ -203,6 +208,7 @@ class Example {
203208 let listBucketsOutput = try await s3Client. listBuckets (
204209 input: ListBucketsInput ( )
205210 )
211+ // snippet-end:[swift.identity.cognito.s3]
206212 guard let buckets = listBucketsOutput. buckets else {
207213 print ( " No buckets returned by S3! " )
208214 return
0 commit comments