{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-go/issues/1258","repository_url":"https://api.github.com/repos/aws/aws-sdk-go","labels_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/1258/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/1258/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/1258/events","html_url":"https://github.com/aws/aws-sdk-go/issues/1258","id":227521204,"number":1258,"title":"aws/session: SDK should be able to load multiple custom shared config files.","user":{"login":"hongchaodeng","id":920884,"avatar_url":"https://avatars2.githubusercontent.com/u/920884?v=3","gravatar_id":"","url":"https://api.github.com/users/hongchaodeng","html_url":"https://github.com/hongchaodeng","followers_url":"https://api.github.com/users/hongchaodeng/followers","following_url":"https://api.github.com/users/hongchaodeng/following{/other_user}","gists_url":"https://api.github.com/users/hongchaodeng/gists{/gist_id}","starred_url":"https://api.github.com/users/hongchaodeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hongchaodeng/subscriptions","organizations_url":"https://api.github.com/users/hongchaodeng/orgs","repos_url":"https://api.github.com/users/hongchaodeng/repos","events_url":"https://api.github.com/users/hongchaodeng/events{/privacy}","received_events_url":"https://api.github.com/users/hongchaodeng/received_events","type":"User","site_admin":false},"labels":[{"id":172085857,"url":"https://api.github.com/repos/aws/aws-sdk-go/labels/Feature%20Request","name":"Feature Request","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-05-09T22:54:24Z","updated_at":"2017-05-11T23:30:54Z","closed_at":null,"body":"### Version of AWS SDK for Go?\r\nv1.8.20\r\n\r\n### Version of Go (`go version`)?\r\ngo 1.8.1\r\n\r\n### Description\r\n\r\n**Feature request**\r\n\r\nAccording to this doc: https://docs.aws.amazon.com/sdk-for-go/api/aws/session/ , currently we could only load credentials/config (for client) from shared ENV. For a single program running only one aws account, this seems fine. But for a program that operates multiple aws accounts, there is no way to create different clients for each accounts.\r\n\r\nFor example, a program which is helping users to manage files on s3. User A specifies bucket \"B1\", credentials \"S1\", config \"C1\"; User B might specifies bucket \"B2\", credentials \"S2\", config \"C2\". While currently it allows loading credentials and config from shared config ENV like `AWS_SHARED_CREDENTIALS_FILE`, `AWS_CONFIG_FILE`, I can't find a way for creating individual clients.\r\n"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-go/issues/comments/300943895","html_url":"https://github.com/aws/aws-sdk-go/issues/1258#issuecomment-300943895","issue_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/1258","id":300943895,"user":{"login":"jasdel","id":961963,"avatar_url":"https://avatars0.githubusercontent.com/u/961963?v=3","gravatar_id":"","url":"https://api.github.com/users/jasdel","html_url":"https://github.com/jasdel","followers_url":"https://api.github.com/users/jasdel/followers","following_url":"https://api.github.com/users/jasdel/following{/other_user}","gists_url":"https://api.github.com/users/jasdel/gists{/gist_id}","starred_url":"https://api.github.com/users/jasdel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasdel/subscriptions","organizations_url":"https://api.github.com/users/jasdel/orgs","repos_url":"https://api.github.com/users/jasdel/repos","events_url":"https://api.github.com/users/jasdel/events{/privacy}","received_events_url":"https://api.github.com/users/jasdel/received_events","type":"User","site_admin":false},"created_at":"2017-05-11T23:30:54Z","updated_at":"2017-05-11T23:30:54Z","body":"@hongchaodeng, We'd be glad to review a PR for this feature. I've not started work on it.\r\n\r\nI think the best way to support this is to update the `session.Option` struct to have an additional optional member which is a list of files the user wants to load the credentials from.\r\n\r\n```go\r\nsess := session.Must(session.NewSessionWithOptions(session.Options{\r\n     // Ordered list of files the SDK will load configuration from\r\n     SharedConfigFiles: []string{file1, file2, file3}, \r\n}))\r\n```\r\n\r\nThis would mean the [`newSession`](https://github.com/aws/aws-sdk-go/blob/master/aws/session/session.go#L309) function would use this list instead of the default if it was set.\r\n\r\nIn doing so the we'd probably also want to export the [`sharedCredentialsFilename` and `sharedConfigFilename`](https://github.com/aws/aws-sdk-go/blob/master/aws/session/env_config.go#L185-L199) functions."}}
{"actor":{"display_login":"jasdel"}}