Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Go documentation refers to deprecated calls #1315

Description

@quinn

Here are the deprecation warnings:

aws.EndpointResolverWithOptionsFunc is deprecated: The global endpoint resolution interface is deprecated. See deprecation docs on [EndpointResolver].

aws.Endpoint is deprecated: This structure was used with the global [EndpointResolver] interface, which has been deprecated in favor of service-specific endpoint resolution. See the deprecation docs on that interface for more information.

This is the config I'm using, instead of the deprecated method in your doc:

		cfg, err := config.LoadDefaultConfig(context.Background(),
			config.WithCredentialsProvider(credentials.StaticCredentialsProvider{
				Value: aws.Credentials{
					AccessKeyID:     "N/A",
					SecretAccessKey: "N/A",
				},
			}),
		)
		if err != nil {
			return nil, fmt.Errorf("unable to load SDK config for local endpoint, %v", err)
		}

		svc = s3.NewFromConfig(cfg,
			s3.WithEndpointResolverV2(&S3LocalResolver{hostAndPort: "localhost:4566"}),
			func(o *s3.Options) { o.UsePathStyle = true },
		)

However, a putObject operation does not work with this config:

s3-1  | 2024-06-09T19:08:32.476 ERROR --- [et.reactor-0] l.aws.handlers.logging     : exception during call chain: Unable to parse request (syntax error: line 1, column 0), invalid XML received:
s3-1  | b'hello'
s3-1  | 2024-06-09T19:08:32.478  INFO --- [et.reactor-0] localstack.request.http    : PUT /upload-test => 500
s3-1  | 2024-06-09T19:08:33.995 ERROR --- [et.reactor-0] l.aws.handlers.logging     : exception during call chain: Unable to parse request (syntax error: line 1, column 0), invalid XML received:
s3-1  | b'hello'
s3-1  | 2024-06-09T19:08:33.996  INFO --- [et.reactor-0] localstack.request.http    : PUT /upload-test => 500
s3-1  | 2024-06-09T19:08:37.592 ERROR --- [et.reactor-0] l.aws.handlers.logging     : exception during call chain: Unable to parse request (syntax error: line 1, column 0), invalid XML received:
s3-1  | b'hello'
s3-1  | 2024-06-09T19:08:37.594  INFO --- [et.reactor-0] localstack.request.http    : PUT /upload-test => 500

this works using the aws cli:

aws s3api create-bucket --endpoint-url http://localhost:4566 --bucket test
aws s3 cp --endpoint-url http://localhost:4566 ./test-file s3://test

I'm not sure why the golang sdk is attempting to upload the file "directly" (or something?) whereas aws s3 cp uses the PutObject op.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions