Adding support for calling AmazonSQSClient. without id/password to support authentication via IAM role.

From EC2 instance with IAM Role, we can now create client like this (create-client).
This commit is contained in:
Kei Tsuji 2013-10-17 13:16:35 +09:00
parent 48c5f17ad5
commit 21ed5eb278

View file

@ -19,6 +19,11 @@
(defn create-client (defn create-client
"Creates a synchronous AmazonSQSClient using the provided account id, secret key, "Creates a synchronous AmazonSQSClient using the provided account id, secret key,
and optional com.amazonaws.ClientConfiguration." and optional com.amazonaws.ClientConfiguration."
([]
(create-client (com.amazonaws.ClientConfiguration.)))
([client-config]
(AmazonSQSClient.
(.withUserAgent client-config "Bandalore - SQS for Clojure")))
([id secret-key] ([id secret-key]
(create-client id secret-key (com.amazonaws.ClientConfiguration.))) (create-client id secret-key (com.amazonaws.ClientConfiguration.)))
([id secret-key client-config] ([id secret-key client-config]
@ -200,4 +205,4 @@
;; void removePermission(RemovePermissionRequest removePermissionRequest) ;; void removePermission(RemovePermissionRequest removePermissionRequest)
; The RemovePermission action revokes any permissions in the queue policy that matches the specified Label parameter. ; The RemovePermission action revokes any permissions in the queue policy that matches the specified Label parameter.
;; void addPermission(AddPermissionRequest addPermissionRequest) ;; void addPermission(AddPermissionRequest addPermissionRequest)
;;The AddPermission action adds a permission to a queue for a specific principal. ;;The AddPermission action adds a permission to a queue for a specific principal.