Skip to content

Commit

Permalink
Add missing SoS tag
Browse files Browse the repository at this point in the history
  • Loading branch information
shepazon authored and meyertst-aws committed Oct 17, 2024
1 parent 89e2c45 commit c325bad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions swift/example_code/sts/AssumeRole/Sources/entry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,20 +245,23 @@ func getIdentityResolver(accessKey: String?, secretKey: String?,

if accessKey == nil || secretKey == nil {
return nil
}
}

guard let accessKey = accessKey,
let secretKey = secretKey else {
return nil
}

// snippet-start:[swift.sts.AssumeRole.create-static-resolver]
let credentials = AWSCredentialIdentity(
accessKey: accessKey,
secret: secretKey,
sessionToken: sessionToken
)

return try StaticAWSCredentialIdentityResolver(credentials)
let identityResolver = try StaticAWSCredentialIdentityResolver(credentials)
// snippet-end:[swift.sts.AssumeRole.create-static-resolver]
return identityResolver
}

/// The program's asynchronous entry point.
Expand Down

0 comments on commit c325bad

Please sign in to comment.