4 "github.com/hashicorp/terraform/svchost"
7 // StaticCredentialsSource is a credentials source that retrieves credentials
8 // from the provided map. It returns nil if a requested hostname is not
11 // The caller should not modify the given map after passing it to this function.
12 func StaticCredentialsSource(creds map[svchost.Hostname]map[string]interface{}) CredentialsSource {
13 return staticCredentialsSource(creds)
16 type staticCredentialsSource map[svchost.Hostname]map[string]interface{}
18 func (s staticCredentialsSource) ForHost(host svchost.Hostname) (HostCredentials, error) {
23 if m, exists := s[host]; exists {
24 return HostCredentialsFromMap(m), nil