diff --git a/aws_config_test.go b/aws_config_test.go index 6e4527ec..93448311 100644 --- a/aws_config_test.go +++ b/aws_config_test.go @@ -1031,32 +1031,6 @@ aws_secret_access_key = DefaultSharedCredentialsSecretKey aws_access_key_id = DefaultSharedCredentialsAccessKey aws_secret_access_key = DefaultSharedCredentialsSecretKey -[SharedCredentialsProfile] -aws_access_key_id = ProfileSharedCredentialsAccessKey -aws_secret_access_key = ProfileSharedCredentialsSecretKey -`, - }, - { - Config: &Config{ - Profile: "SharedCredentialsProfile", - Region: "us-east-1", - UseLegacyWorkflow: true, - }, - Description: "environment AWS_ACCESS_KEY_ID overrides config Profile in legacy workflow", - EnvironmentVariables: map[string]string{ - "AWS_ACCESS_KEY_ID": servicemocks.MockEnvAccessKey, - "AWS_SECRET_ACCESS_KEY": servicemocks.MockEnvSecretKey, - }, - ExpectedCredentialsValue: mockdata.MockEnvCredentials, - ExpectedRegion: "us-east-1", - MockStsEndpoints: []*servicemocks.MockEndpoint{ - servicemocks.MockStsGetCallerIdentityValidEndpoint, - }, - SharedCredentialsFile: ` -[default] -aws_access_key_id = DefaultSharedCredentialsAccessKey -aws_secret_access_key = DefaultSharedCredentialsSecretKey - [SharedCredentialsProfile] aws_access_key_id = ProfileSharedCredentialsAccessKey aws_secret_access_key = ProfileSharedCredentialsSecretKey diff --git a/credentials.go b/credentials.go index d5da6c35..03e852b9 100644 --- a/credentials.go +++ b/credentials.go @@ -45,17 +45,9 @@ func getCredentialsProvider(ctx context.Context, c *Config) (aws.CredentialsProv } if c.Profile != "" && os.Getenv("AWS_ACCESS_KEY_ID") != "" && os.Getenv("AWS_SECRET_ACCESS_KEY") != "" { - if c.UseLegacyWorkflow { - diags.AddWarning("Configuration conflict overridden", - `A Profile was specified along with the environment variables "AWS_ACCESS_KEY_ID" and "AWS_SECRET_ACCESS_KEY". `+ - `The legacy workflow is enabled, so the Profile will be ignored in favor of the environment variable credentials. `+ - `This behavior may be removed in the future.`) - c.Profile = "" - } else { - diags.AddWarning("Configuration conflict detected", - `A Profile was specified along with the environment variables "AWS_ACCESS_KEY_ID" and "AWS_SECRET_ACCESS_KEY". `+ - `The Profile is now used instead of the environment variable credentials. This may lead to unexpected behavior.`) - } + diags.AddWarning("Configuration conflict detected", + `A Profile was specified along with the environment variables "AWS_ACCESS_KEY_ID" and "AWS_SECRET_ACCESS_KEY". `+ + `The Profile is now used instead of the environment variable credentials. This may lead to unexpected behavior.`) } if profile := c.Profile; profile != "" { diff --git a/internal/config/config.go b/internal/config/config.go index f1cbd858..16416934 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -66,7 +66,6 @@ type Config struct { TokenBucketRateLimiterCapacity int UseDualStackEndpoint bool UseFIPSEndpoint bool - UseLegacyWorkflow bool UserAgent UserAgentProducts }