Package config provides utilities for loading configuration from multiple sources that can be used to configure the SDK's API clients, and utilities.
The config package will load configuration from environment variables, AWS shared configuration file (~/.aws/config), and AWS shared credentials file (~/.aws/credentials).
Use the LoadDefaultConfig to load configuration from all the SDK's supported sources, and resolve credentials using the SDK's default credential chain.
LoadDefaultConfig allows for a variadic list of additional Config sources that can provide one or more configuration values which can be used to programmatically control the resolution of a specific value, or allow for broader range of additional configuration sources not supported by the SDK. A Config source implements one or more provider interfaces defined in this package. Config sources passed in will take precedence over the default environment and shared config sources used by the SDK. If one or more Config sources implement the same provider interface, priority will be handled by the order in which the sources were passed in.
A number of helpers (prefixed by “With“) are provided in this package that implement their respective provider interface. These helpers should be used for overriding configuration programmatically at runtime.
package main import ( "context" "fmt" "log" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/sts" ) func main() { ctx := context.TODO() cfg, err := config.LoadDefaultConfig(ctx) if err != nil { log.Fatal(err) } client := sts.NewFromConfig(cfg) identity, err := client.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{}) if err != nil { log.Fatal(err) } fmt.Printf("Account: %s, Arn: %s", aws.ToString(identity.Account), aws.ToString(identity.Arn)) }
package main import ( "context" "fmt" "log" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/sts" ) func main() { ctx := context.TODO() // Config sources can be passed to LoadDefaultConfig, these sources can implement one or more // provider interfaces. These sources take priority over the standard environment and shared configuration values. cfg, err := config.LoadDefaultConfig(ctx, config.WithRegion("us-west-2"), config.WithSharedConfigProfile("customProfile"), ) if err != nil { log.Fatal(err) } client := sts.NewFromConfig(cfg) identity, err := client.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{}) if err != nil { log.Fatal(err) } fmt.Printf("Account: %s, Arn: %s", aws.ToString(identity.Account), aws.ToString(identity.Arn)) }
const CredentialsSourceName = "EnvConfigCredentials"
CredentialsSourceName provides a name of the provider when config is loaded from environment.
View Sourceconst ( DefaultSharedConfigProfile = `default` )
DefaultSharedConfigFiles is a slice of the default shared config files that the will be used in order to load the SharedConfig.
DefaultSharedCredentialsFiles is a slice of the default shared credentials files that the will be used in order to load the SharedConfig.
func DefaultSharedConfigFilename() string
DefaultSharedConfigFilename returns the SDK's default file path for the shared config file.
Builds the shared config file path based on the OS's platform.
func DefaultSharedCredentialsFilename() string
DefaultSharedCredentialsFilename returns the SDK's default file path for the shared credentials file.
Builds the shared config file path based on the OS's platform.
GetIgnoreConfiguredEndpoints is used in knowing when to disable configured endpoints feature.
LoadDefaultConfig reads the SDK's default external configurations, and populates an AWS Config with the values from the external configurations.
An optional variadic set of additional Config values can be provided as input that will be prepended to the configs slice. Use this to add custom configuration. The custom configurations must satisfy the respective providers for their data or the custom data will be ignored by the resolvers and config loaders.
cfg, err := config.LoadDefaultConfig( context.TODO(), config.WithSharedConfigProfile("test-profile"), ) if err != nil { panic(fmt.Sprintf("failed loading config, %v", err)) }
The default configuration sources are: * Environment Variables * Shared Configuration and Shared Credentials files.
type AssumeRoleTokenProviderNotSetError struct{}
AssumeRoleTokenProviderNotSetError is an error returned when creating a session when the MFAToken option is not set when shared config is configured load assume a role with an MFA token.
Error is the error message
A Config represents a generic configuration value or set of values. This type will be used by the AWSConfigResolvers to extract
General the Config type will use type assertion against the Provider interfaces to extract specific data from the Config.
type CredentialRequiresARNError struct { Type string Profile string }
CredentialRequiresARNError provides the error for shared config credentials that are incorrectly configured in the shared config or credentials file.
Error satisfies the error interface.
DefaultsModeOptions is the set of options that are used to configure
EnvConfig is a collection of environment values the SDK will read setup config from. All environment values are optional. But some values such as credentials require multiple values to be complete or the values will be ignored.
NewEnvConfig retrieves the SDK's environment configuration. See `EnvConfig` for the values that will be retrieved.
GetEC2IMDSClientEnableState implements a EC2IMDSClientEnableState options resolver interface.
GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface.
GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface.
GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option resolver interface.
GetEnableEndpointDiscovery returns resolved value for EnableEndpointDiscovery env variable setting.
GetIgnoreConfiguredEndpoints is used in knowing when to disable configured endpoints feature.
GetRetryMaxAttempts returns the value of AWS_MAX_ATTEMPTS if was specified, and not 0.
GetRetryMode returns the RetryMode of AWS_RETRY_MODE if was specified, and a valid value.
GetS3DisableExpressAuth returns the configured value for [EnvConfig.S3DisableExpressAuth].
GetS3DisableMultiRegionAccessPoints returns whether to disable multi-region access point support for the S3 client.
GetS3UseARNRegion returns whether to allow ARNs to direct the region the S3 client's requests are sent to.
GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use with configured endpoints.
GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be used for requests.
GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be used for requests.
HTTPClient is an HTTP client implementation
IgnoreConfiguredEndpointsProvider is needed to search for all providers that provide a flag to disable configured endpoints.
LoadOptions are discrete set of options that are valid for loading the configuration
GetEC2IMDSClientEnableState implements a EC2IMDSClientEnableState options resolver interface.
GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface.
GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface.
GetEnableEndpointDiscovery returns if the EnableEndpointDiscovery flag is set.
GetRetryMaxAttempts returns the RetryMaxAttempts if specified in the LoadOptions and not 0.
GetRetryMode returns the RetryMode specified in the LoadOptions.
GetS3DisableExpressAuth returns the configured value for [EnvConfig.S3DisableExpressAuth].
GetS3DisableMultiRegionAccessPoints returns whether to disable the S3 multi-region access points feature.
GetS3UseARNRegion returns whether to allow ARNs to direct the region the S3 client's requests are sent to.
GetServiceBaseEndpoint satisfies (internal/configsources).ServiceBaseEndpointProvider.
The sdkID value is unused because LoadOptions only supports setting a GLOBAL endpoint override. In-code, per-service endpoint overrides are performed via functional options in service client space.
GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be used for requests.
GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be used for requests.
LoadOptionsFunc is a type alias for LoadOptions functional option
WithAPIOptions is a helper function to construct functional options that sets APIOptions on LoadOptions. If APIOptions is set to nil, the APIOptions value is ignored. If multiple WithAPIOptions calls are made, the last call overrides the previous call values.
package main import ( "context" "log" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) func main() { // import "github.com/aws/smithy-go/middleware" // import smithyhttp "github.com/aws/smithy-go/transport/http" cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithAPIOptions([]func(*middleware.Stack) error{ smithyhttp.AddHeaderValue("X-Custom-Header", "customHeaderValue"), }), ) if err != nil { log.Fatal(err) } _ = cfg }
WithAccountIDEndpointMode is a helper function to construct functional options that sets AccountIDEndpointMode on config's LoadOptions
WithAfterAttempt adds the AfterAttemptInterceptor to config.
WithAfterDeserialization adds the AfterDeserializationInterceptor to config.
WithAfterExecution adds the AfterExecutionInterceptor to config.
WithAfterSerialization adds the AfterSerializationInterceptor to config.
WithAfterSigning adds the AfterSigningInterceptor to config.
WithAfterTransmit adds the AfterTransmitInterceptor to config.
WithAppID is a helper function to construct functional options that sets AppID on config's LoadOptions.
WithAssumeRoleCredentialOptions is a helper function to construct functional options that sets a function to use stscreds.AssumeRoleOptions on config's LoadOptions. If assume role credentials options is set to nil, the assume role credentials value will be ignored. If multiple WithAssumeRoleCredentialOptions calls are made, the last call overrides the previous call values.
package main import ( "context" "log" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials/stscreds" ) func main() { // WithAssumeRoleCredentialOptions can be used to configure the AssumeRoleOptions for the STS credential provider. // For example the TokenProvider can be populated if assuming a role that requires an MFA token. cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithAssumeRoleCredentialOptions(func(options *stscreds.AssumeRoleOptions) { options.TokenProvider = func() (string, error) { return "theTokenCode", nil } })) if err != nil { log.Fatal(err) } _ = cfg }
WithAuthSchemePreference sets the priority order of auth schemes on config.
Schemes are expressed as names e.g. sigv4a or sigv4.
WithBaseEndpoint is a helper function to construct functional options that sets BaseEndpoint on config's LoadOptions. Empty values have no effect, and subsequent calls to this API override previous ones.
This is an in-code setting, therefore, any value set using this hook takes precedence over and will override ALL environment and shared config directives that set endpoint URLs. Functional options on service clients have higher specificity, and functional options that modify the value of BaseEndpoint on a client will take precedence over this setting.
WithBearerAuthTokenCacheOptions is a helper function to construct functional options that sets a function to modify the TokenCacheOptions the smithy-go auth/bearer#TokenCache will be configured with, if the TokenCache is used by the configuration loader.
If multiple WithBearerAuthTokenCacheOptions calls are made, the last call overrides the previous call values.
WithBearerAuthTokenProvider is a helper function to construct functional options that sets Credential provider value on config's LoadOptions. If credentials provider is set to nil, the credentials provider value will be ignored. If multiple WithBearerAuthTokenProvider calls are made, the last call overrides the previous call values.
WithBeforeAttempt adds the BeforeAttemptInterceptor to config.
WithBeforeDeserialization adds the BeforeDeserializationInterceptor to config.
WithBeforeExecution adds the BeforeExecutionInterceptor to config.
WithBeforeRetryLoop adds the BeforeRetryLoopInterceptor to config.
WithBeforeSerialization adds the BeforeSerializationInterceptor to config.
WithBeforeSigning adds the BeforeSigningInterceptor to config.
WithBeforeTransmit adds the BeforeTransmitInterceptor to config.
WithClientLogMode is a helper function to construct functional options that sets client log mode on LoadOptions. If client log mode is set to nil, the client log mode value will be ignored. If multiple WithClientLogMode calls are made, the last call overrides the previous call values.
WithCredentialsCacheOptions is a helper function to construct functional options that sets a function to modify the aws.CredentialsCacheOptions the aws.CredentialsCache will be configured with, if the CredentialsCache is used by the configuration loader.
If multiple WithCredentialsCacheOptions calls are made, the last call overrides the previous call values.
package main import ( "context" "log" "time" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" ) func main() { cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithCredentialsCacheOptions(func(o *aws.CredentialsCacheOptions) { o.ExpiryWindow = 10 * time.Minute }), ) if err != nil { log.Fatal(err) } _ = cfg }
WithCredentialsProvider is a helper function to construct functional options that sets Credential provider value on config's LoadOptions. If credentials provider is set to nil, the credentials provider value will be ignored. If multiple WithCredentialsProvider calls are made, the last call overrides the previous call values.
package main import ( "context" "fmt" "log" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" ) func main() { cfg, err := config.LoadDefaultConfig(context.TODO(), // Hard coded credentials. config.WithCredentialsProvider(credentials.StaticCredentialsProvider{ Value: aws.Credentials{ AccessKeyID: "AKID", SecretAccessKey: "SECRET", SessionToken: "SESSION", Source: "example hard coded credentials", }, })) if err != nil { log.Fatal(err) } // Credentials retrieve will be called automatically internally to the SDK // service clients created with the cfg value. creds, err := cfg.Credentials.Retrieve(context.TODO()) if err != nil { log.Fatal(err) } fmt.Println("Credentials Source:", creds.Source) // Credentials Source: example hard coded credentials }
WithCustomCABundle is a helper function to construct functional options that sets CustomCABundle on config's LoadOptions. Setting the custom CA Bundle to nil will result in custom CA Bundle value being ignored. If multiple WithCustomCABundle calls are made, the last call overrides the previous call values.
WithDefaultRegion is a helper function to construct functional options that sets a DefaultRegion on config's LoadOptions. Setting the default region to an empty string, will result in the default region value being ignored. If multiple WithDefaultRegion calls are made, the last call overrides the previous call values. Note that both WithRegion and WithEC2IMDSRegion call takes precedence over WithDefaultRegion call when resolving region.
WithDefaultsMode sets the SDK defaults configuration mode to the value provided.
Zero or more functional options can be provided to provide configuration options for performing environment discovery when using aws.DefaultsModeAuto.
WithDisableRequestCompression is a helper function to construct functional options that sets DisableRequestCompression on config's LoadOptions.
WithEC2IMDSClientEnableState is a helper function to construct functional options that sets the EC2IMDSClientEnableState.
WithEC2IMDSEndpoint is a helper function to construct functional options that sets the EC2IMDSEndpoint.
WithEC2IMDSEndpointMode is a helper function to construct functional options that sets the EC2IMDSEndpointMode.
WithEC2IMDSRegion is a helper function to construct functional options that enables resolving EC2IMDS region. The function takes in a UseEC2IMDSRegion functional option, and can be used to set the EC2IMDS client which will be used to resolve EC2IMDSRegion. If no functional option is provided, an EC2IMDS client is built and used by the resolver. If multiple WithEC2IMDSRegion calls are made, the last call overrides the previous call values. Note that the WithRegion calls takes precedence over WithEC2IMDSRegion when resolving region.
package main import ( "context" "log" "github.com/aws/aws-sdk-go-v2/config" ) func main() { cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithEC2IMDSRegion(), ) if err != nil { log.Fatal(err) } _ = cfg }
WithEC2RoleCredentialOptions is a helper function to construct functional options that sets a function to use ec2rolecreds.Options on config's LoadOptions. If EC2 role credential options is set to nil, the EC2 role credential options value will be ignored. If multiple WithEC2RoleCredentialOptions calls are made, the last call overrides the previous call values.
WithEndpointCredentialOptions is a helper function to construct functional options that sets a function to use endpointcreds.Options on config's LoadOptions. If endpoint credential options is set to nil, the endpoint credential options value will be ignored. If multiple WithEndpointCredentialOptions calls are made, the last call overrides the previous call values.
WithEndpointDiscovery is a helper function to construct functional options that can be used to enable endpoint discovery on LoadOptions for supported clients. If multiple WithEndpointDiscovery calls are made, the last call overrides the previous call values.
WithEndpointResolver is a helper function to construct functional options that sets the EndpointResolver on LoadOptions. If the EndpointResolver is set to nil, the EndpointResolver value is ignored. If multiple WithEndpointResolver calls are made, the last call overrides the previous call values.
Deprecated: The global endpoint resolution interface is deprecated. The API for endpoint resolution is now unique to each service and is set via the EndpointResolverV2 field on service client options. Use of WithEndpointResolver or WithEndpointResolverWithOptions will prevent you from using any endpoint-related service features released after the introduction of EndpointResolverV2. You may also encounter broken or unexpected behavior when using the old global interface with services that use many endpoint-related customizations such as S3.
package main import ( "context" "log" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" ) func main() { cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithEndpointResolver(aws.EndpointResolverFunc( func(service, region string) (aws.Endpoint, error) { return aws.Endpoint{URL: "https://mock.amazonaws.com"}, nil })), ) if err != nil { log.Fatal(err) } _ = cfg }
WithEndpointResolverWithOptions is a helper function to construct functional options that sets the EndpointResolverWithOptions on LoadOptions. If the EndpointResolverWithOptions is set to nil, the EndpointResolver value is ignored. If multiple WithEndpointResolver calls are made, the last call overrides the previous call values.
Deprecated: The global endpoint resolution interface is deprecated. See deprecation docs on WithEndpointResolver.
package main import ( "context" "log" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" ) func main() { cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithEndpointResolverWithOptions(aws.EndpointResolverWithOptionsFunc( func(service, region string, options ...interface{}) (aws.Endpoint, error) { return aws.Endpoint{URL: "https://mock.amazonaws.com"}, nil })), ) if err != nil { log.Fatal(err) } _ = cfg }
WithHTTPClient is a helper function to construct functional options that sets HTTPClient on LoadOptions. If HTTPClient is set to nil, the HTTPClient value will be ignored. If multiple WithHTTPClient calls are made, the last call overrides the previous call values.
package main import ( "context" "log" "net/http" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" "github.com/aws/aws-sdk-go-v2/config" ) func main() { cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithHTTPClient(awshttp.NewBuildableClient(). WithTransportOptions(func(tr *http.Transport) { tr.MaxIdleConns = 60 })), ) if err != nil { log.Fatal(err) } _ = cfg }
WithLogConfigurationWarnings is a helper function to construct functional options that can be used to set LogConfigurationWarnings on LoadOptions.
If multiple WithLogConfigurationWarnings calls are made, the last call overrides the previous call values.
WithLogger is a helper function to construct functional options that sets Logger on LoadOptions. If Logger is set to nil, the Logger value will be ignored. If multiple WithLogger calls are made, the last call overrides the previous call values.
WithProcessCredentialOptions is a helper function to construct functional options that sets a function to use processcreds.Options on config's LoadOptions. If process credential options is set to nil, the process credential value will be ignored. If multiple WithProcessCredentialOptions calls are made, the last call overrides the previous call values.
WithRegion is a helper function to construct functional options that sets Region on config's LoadOptions. Setting the region to an empty string, will result in the region value being ignored. If multiple WithRegion calls are made, the last call overrides the previous call values.
package main import ( "context" "log" "github.com/aws/aws-sdk-go-v2/config" ) func main() { cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-west-2")) if err != nil { log.Fatal(err) } _ = cfg }
WithRequestChecksumCalculation is a helper function to construct functional options that sets RequestChecksumCalculation on config's LoadOptions
WithRequestMinCompressSizeBytes is a helper function to construct functional options that sets RequestMinCompressSizeBytes on config's LoadOptions.
WithResponseChecksumValidation is a helper function to construct functional options that sets ResponseChecksumValidation on config's LoadOptions
WithRetryMaxAttempts is a helper function to construct functional options that sets RetryMaxAttempts on LoadOptions. If RetryMaxAttempts is unset, the RetryMaxAttempts value is ignored. If multiple WithRetryMaxAttempts calls are made, the last call overrides the previous call values.
Will be ignored of LoadOptions.Retryer or WithRetryer are used.
WithRetryMode is a helper function to construct functional options that sets RetryMode on LoadOptions. If RetryMode is unset, the RetryMode value is ignored. If multiple WithRetryMode calls are made, the last call overrides the previous call values.
Will be ignored of LoadOptions.Retryer or WithRetryer are used.
WithRetryer is a helper function to construct functional options that sets Retryer on LoadOptions. If Retryer is set to nil, the Retryer value is ignored. If multiple WithRetryer calls are made, the last call overrides the previous call values.
WithS3DisableExpressAuth sets [LoadOptions.S3DisableExpressAuth] to the value provided.
WithS3DisableMultiRegionAccessPoints is a helper function to construct functional options that can be used to set S3DisableMultiRegionAccessPoints on LoadOptions. If multiple WithS3DisableMultiRegionAccessPoints calls are made, the last call overrides the previous call values.
WithS3UseARNRegion is a helper function to construct functional options that can be used to set S3UseARNRegion on LoadOptions. If multiple WithS3UseARNRegion calls are made, the last call overrides the previous call values.
WithSSOProviderOptions is a helper function to construct functional options that sets a function to use ssocreds.Options on config's LoadOptions. If the SSO credential provider options is set to nil, the sso provider options value will be ignored. If multiple WithSSOProviderOptions calls are made, the last call overrides the previous call values.
WithSSOTokenProviderOptions is a helper function to construct functional options that sets a function to modify the SSOtokenProviderOptions the SDK's credentials/ssocreds#SSOProvider will be configured with, if the SSOTokenProvider is used by the configuration loader.
If multiple WithSSOTokenProviderOptions calls are made, the last call overrides the previous call values.
WithServiceOptions is a helper function to construct functional options that sets ServiceOptions on config's LoadOptions.
WithSharedConfigFiles is a helper function to construct functional options that sets slice of SharedConfigFiles on config's LoadOptions. Setting the shared config files to an nil string slice, will result in the shared config files value being ignored. If multiple WithSharedConfigFiles calls are made, the last call overrides the previous call values.
WithSharedConfigProfile is a helper function to construct functional options that sets SharedConfigProfile on config's LoadOptions. Setting the shared config profile to an empty string, will result in the shared config profile value being ignored. If multiple WithSharedConfigProfile calls are made, the last call overrides the previous call values.
package main import ( "context" "fmt" "log" "path/filepath" "github.com/aws/aws-sdk-go-v2/config" ) func main() { cfg, err := config.LoadDefaultConfig(context.TODO(), // Specify the shared configuration profile to load. config.WithSharedConfigProfile("exampleProfile"), // Optionally specify the specific shared configuraiton // files to load the profile from. config.WithSharedConfigFiles([]string{ filepath.Join("testdata", "shared_config"), }), ) if err != nil { log.Fatal(err) } // Region loaded from credentials file. fmt.Println("Region:", cfg.Region) }
Output: Region: us-west-2
WithSharedCredentialsFiles is a helper function to construct functional options that sets slice of SharedCredentialsFiles on config's LoadOptions. Setting the shared credentials files to an nil string slice, will result in the shared credentials files value being ignored. If multiple WithSharedCredentialsFiles calls are made, the last call overrides the previous call values.
WithUseDualStackEndpoint is a helper function to construct functional options that can be used to set UseDualStackEndpoint on LoadOptions.
WithUseFIPSEndpoint is a helper function to construct functional options that can be used to set UseFIPSEndpoint on LoadOptions.
WithWebIdentityRoleCredentialOptions is a helper function to construct functional options that sets a function to use stscreds.WebIdentityRoleOptions on config's LoadOptions. If web identity role credentials options is set to nil, the web identity role credentials value will be ignored. If multiple WithWebIdentityRoleCredentialOptions calls are made, the last call overrides the previous call values.
package main import ( "context" "log" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials/stscreds" ) func main() { cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithWebIdentityRoleCredentialOptions(func(options *stscreds.WebIdentityRoleOptions) { options.RoleSessionName = "customSessionName" })) if err != nil { log.Fatal(err) } _ = cfg }
LoadSharedConfigOptions struct contains optional values that can be used to load the config.
SSOSession provides the shared configuration parameters of the sso-session section.
Services contains values configured in the services section of the AWS configuration file.
SharedConfig represents the configuration fields of the SDK config files.
LoadSharedConfigProfile retrieves the configuration from the list of files using the profile provided. The order the files are listed will determine precedence. Values in subsequent files will overwrite values defined in earlier files.
For example, given two files A and B. Both define credentials. If the order of the files are A then B, B's credential values will be used instead of A's.
If config files are not set, SDK will default to using a file at location `.aws/config` if present. If credentials files are not set, SDK will default to using a file at location `.aws/credentials` if present. No default files are set, if files set to an empty slice.
You can read more about shared config and credentials file location at https://docs.aws.amazon.com/credref/latest/refdocs/file-location.html#file-location
GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface.
GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface.
GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option resolver interface.
GetEnableEndpointDiscovery returns if the enable_endpoint_discovery is set.
GetIgnoreConfiguredEndpoints is used in knowing when to disable configured endpoints feature.
GetRetryMaxAttempts returns the maximum number of attempts an API client created Retryer should attempt an operation call before failing.
GetRetryMode returns the model the API client should create its Retryer in.
GetS3DisableExpressAuth returns the configured value for [SharedConfig.S3DisableExpressAuth].
GetS3DisableMultiRegionAccessPoints returns if the S3 service should disable support for Multi-Region access-points.
GetS3UseARNRegion returns if the S3 service should allow ARNs to direct the region the client's requests are sent to.
GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use with configured endpoints.
GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be used for requests.
GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be used for requests.
SharedConfigAssumeRoleError is an error for the shared config when the profile contains assume role information, but that information is invalid or not complete.
Unwrap returns the underlying error that caused the failure.
type SharedConfigLoadError struct { Filename string Err error }
SharedConfigLoadError is an error for the shared config file failed to load.
Unwrap returns the underlying error that caused the failure.
type SharedConfigProfileNotExistError struct { Filename []string Profile string Err error }
SharedConfigProfileNotExistError is an error for the shared config when the profile was not find in the config file.
Unwrap returns the underlying error that caused the failure.
type UseEC2IMDSRegion struct { Client *imds.Client }
UseEC2IMDSRegion provides a regionProvider that retrieves the region from the EC2 Metadata service.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4