{"id":21670846,"url":"https://github.com/tkuchiki/aws-sdk-go-config","last_synced_at":"2026-04-16T11:01:53.855Z","repository":{"id":57518719,"uuid":"67100758","full_name":"tkuchiki/aws-sdk-go-config","owner":"tkuchiki","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-11T13:26:03.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T07:45:08.407Z","etag":null,"topics":["aws","aws-sdk-go","config","golang","library"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tkuchiki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-01T05:27:40.000Z","updated_at":"2018-06-11T13:26:05.000Z","dependencies_parsed_at":"2022-09-26T18:01:45.503Z","dependency_job_id":null,"html_url":"https://github.com/tkuchiki/aws-sdk-go-config","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tkuchiki/aws-sdk-go-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkuchiki%2Faws-sdk-go-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkuchiki%2Faws-sdk-go-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkuchiki%2Faws-sdk-go-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkuchiki%2Faws-sdk-go-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkuchiki","download_url":"https://codeload.github.com/tkuchiki/aws-sdk-go-config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkuchiki%2Faws-sdk-go-config/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31882886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-sdk-go","config","golang","library"],"created_at":"2024-11-25T12:36:43.484Z","updated_at":"2026-04-16T11:01:53.830Z","avatar_url":"https://github.com/tkuchiki.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-sdk-go-config\n\n---\n\n```go\nimport \"github.com/tkuchiki/aws-sdk-go-config\"\n```\n\n## Usage\n\n```go\nconst (\n\t// DefaultProfile is default profile name\n\tDefaultProfile = \"default\"\n)\n```\n\n#### func  GetProfile\n\n```go\nfunc GetProfile() string\n```\nGetProfile returns the profile\n\n#### func  GetProfiles\n\n```go\nfunc GetProfiles(configFile ...string) []string\n```\nGetProfiles returns the shared config file section names\n\n#### func  GetRegion\n\n```go\nfunc GetRegion(profile string) string\n```\nGetRegion returns the region\n\n#### func  GetRegionFromConfigFile\n\n```go\nfunc GetRegionFromConfigFile(configFile, profile string) (string, error)\n```\nGetRegionFromConfigFile returns the region from the shared config file\n\n#### func  GetRegionFromInstanceIdentityDocument\n\n```go\nfunc GetRegionFromInstanceIdentityDocument() string\n```\nGetRegionFromInstanceIdentityDocument returns the region from the Instance\nMetadata\n\n#### func  GetSharedConfigFile\n\n```go\nfunc GetSharedConfigFile() string\n```\nGetSharedConfigFile returns the path to the shared config file\n\n#### func  GetSharedCredentialsFile\n\n```go\nfunc GetSharedCredentialsFile() string\n```\nGetSharedCredentialsFile returns the path to the shared credentials file\n\n#### func  NewConfig\n\n```go\nfunc NewConfig(opt Option) (*aws.Config, error)\n```\nNewConfig returns the *aws.Config\n\n#### func  NewCredentials\n\n```go\nfunc NewCredentials(opt Option) (*credentials.Credentials, error)\n```\nNewCredentials returns the *credentials.Credentials\n\n#### func  NewSession\n\n```go\nfunc NewSession(arg ...interface{}) (*session.Session, error)\n```\nNewSession returns the *session.Session.\n\nThe argument arg Option or *aws.Config\n\n#### type Option\n\n```go\ntype Option struct {\n\t// AWS Access Key ID\n\tAccessKey string\n\t// AWS Secret Access Key\n\tSecretKey string\n\t// AssumeRole Arn\n\tArn string\n\t// AWS Profile\n\tProfile string\n\t// Path to the shared config file\n\tConfig string\n\t// Path to the shared credentials file\n\tCredentials string\n\t// AWS Session Token\n\tToken string\n\t// AWS Region\n\tRegion string\n    // ExpiryWindow\n    ExpiryWindow time.Duration\n}\n```\n\nOption is AWS Config options\n\n## Examples\n\n```go\npackage main\n\nimport (\n    \"github.com/tkuchiki/aws-sdk-go-config\"\n    \"github.com/aws/aws-sdk-go/aws\"\n    \"github.com/aws/aws-sdk-go/aws/credentials\"\n    \"github.com/aws/aws-sdk-go/aws/session\"\n    \"log\"\n)\n\nfunc main() {\n    var creds *credentials.Credentials\n    var err error\n    creds, err = awsconfig.NewCredentials(awsconfig.Option{})\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    var conf *aws.Config\n    conf, err = awsconfig.NewConfig(awsconfig.Option{})\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    var sess *session.Session\n    sess, err = awsconfig.NewSession()\n    //sess, err = awsconfig.NewSession(awsconfig.Option{})\n    //sess, err = awsconfig.NewSession(conf)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    //fmt.Println(awsconfig.GetProfiles(\"/path/to/.aws/credentials\"))\n    //fmt.Println(awsconfig.GetProfiles())\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkuchiki%2Faws-sdk-go-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkuchiki%2Faws-sdk-go-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkuchiki%2Faws-sdk-go-config/lists"}