]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / aws / aws-sdk-go / aws / session / env_config.go
index 82e04d76cdeb1b4523e562ec28ce4fde06d9bef2..e3959b959ef936f6b39d2fa5ee3fa31ebe840609 100644 (file)
@@ -4,6 +4,7 @@ import (
        "os"
        "strconv"
 
+       "github.com/aws/aws-sdk-go/aws"
        "github.com/aws/aws-sdk-go/aws/credentials"
        "github.com/aws/aws-sdk-go/aws/defaults"
 )
@@ -79,7 +80,7 @@ type envConfig struct {
        //      AWS_CONFIG_FILE=$HOME/my_shared_config
        SharedConfigFile string
 
-       // Sets the path to a custom Credentials Authroity (CA) Bundle PEM file
+       // Sets the path to a custom Credentials Authority (CA) Bundle PEM file
        // that the SDK will use instead of the system's root CA bundle.
        // Only use this if you want to configure the SDK to use a custom set
        // of CAs.
@@ -101,6 +102,12 @@ type envConfig struct {
        CSMEnabled  bool
        CSMPort     string
        CSMClientID string
+
+       enableEndpointDiscovery string
+       // Enables endpoint discovery via environment variables.
+       //
+       //      AWS_ENABLE_ENDPOINT_DISCOVERY=true
+       EnableEndpointDiscovery *bool
 }
 
 var (
@@ -125,6 +132,10 @@ var (
                "AWS_SESSION_TOKEN",
        }
 
+       enableEndpointDiscoveryEnvKey = []string{
+               "AWS_ENABLE_ENDPOINT_DISCOVERY",
+       }
+
        regionEnvKeys = []string{
                "AWS_REGION",
                "AWS_DEFAULT_REGION", // Only read if AWS_SDK_LOAD_CONFIG is also set
@@ -194,6 +205,12 @@ func envConfigLoad(enableSharedConfig bool) envConfig {
        setFromEnvVal(&cfg.Region, regionKeys)
        setFromEnvVal(&cfg.Profile, profileKeys)
 
+       // endpoint discovery is in reference to it being enabled.
+       setFromEnvVal(&cfg.enableEndpointDiscovery, enableEndpointDiscoveryEnvKey)
+       if len(cfg.enableEndpointDiscovery) > 0 {
+               cfg.EnableEndpointDiscovery = aws.Bool(cfg.enableEndpointDiscovery != "false")
+       }
+
        setFromEnvVal(&cfg.SharedCredentialsFile, sharedCredsFileEnvKey)
        setFromEnvVal(&cfg.SharedConfigFile, sharedConfigFileEnvKey)