Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aws): Get region from IMDS when missing for awssmfs, awssmpfs, and blobfs (s3://) #911

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

hairyhenderson
Copy link
Owner

In the original v2 aws-sdk-go, it wasn't necessary to set an AWS region, but with v2, a region is always required (at least, for most APIs). This can either be done with environment variables (AWS_REGION, for example), or by a shared config. On EC2, however, it's customary to fall back to the instance metadata service (IMDS).

This is necessary for hairyhenderson/gomplate#2180, for example.

@hairyhenderson hairyhenderson added the bug Something isn't working label Dec 17, 2024
@hairyhenderson hairyhenderson self-assigned this Dec 17, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: d01b2d1 Previous: 6408c34 Ratio
BenchmarkPathForDirFS 45.47 ns/op 0 B/op 0 allocs/op 46.77 ns/op 0 B/op 0 allocs/op 0.97
BenchmarkPathForDirFS - ns/op 45.47 ns/op 46.77 ns/op 0.97
BenchmarkPathForDirFS - B/op 0 B/op 0 B/op 1
BenchmarkPathForDirFS - allocs/op 0 allocs/op 0 allocs/op 1
BenchmarkSplitRepoPath/0 12.09 ns/op 0 B/op 0 allocs/op 12.09 ns/op 0 B/op 0 allocs/op 1
BenchmarkSplitRepoPath/0 - ns/op 12.09 ns/op 12.09 ns/op 1
BenchmarkSplitRepoPath/0 - B/op 0 B/op 0 B/op 1
BenchmarkSplitRepoPath/0 - allocs/op 0 allocs/op 0 allocs/op 1
BenchmarkSplitRepoPath/1 16.74 ns/op 0 B/op 0 allocs/op 16.87 ns/op 0 B/op 0 allocs/op 0.99
BenchmarkSplitRepoPath/1 - ns/op 16.74 ns/op 16.87 ns/op 0.99
BenchmarkSplitRepoPath/1 - B/op 0 B/op 0 B/op 1
BenchmarkSplitRepoPath/1 - allocs/op 0 allocs/op 0 allocs/op 1
BenchmarkSplitRepoPath/2 40.04 ns/op 4 B/op 1 allocs/op 53.2 ns/op 4 B/op 1 allocs/op 0.75
BenchmarkSplitRepoPath/2 - ns/op 40.04 ns/op 53.2 ns/op 0.75
BenchmarkSplitRepoPath/2 - B/op 4 B/op 4 B/op 1
BenchmarkSplitRepoPath/2 - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkSplitRepoPath/3 40.73 ns/op 8 B/op 1 allocs/op 53.95 ns/op 8 B/op 1 allocs/op 0.75
BenchmarkSplitRepoPath/3 - ns/op 40.73 ns/op 53.95 ns/op 0.75
BenchmarkSplitRepoPath/3 - B/op 8 B/op 8 B/op 1
BenchmarkSplitRepoPath/3 - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkSplitRepoPath/4 38.46 ns/op 8 B/op 1 allocs/op 47.32 ns/op 8 B/op 1 allocs/op 0.81
BenchmarkSplitRepoPath/4 - ns/op 38.46 ns/op 47.32 ns/op 0.81
BenchmarkSplitRepoPath/4 - B/op 8 B/op 8 B/op 1
BenchmarkSplitRepoPath/4 - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkSplitRepoPath/5 44.19 ns/op 4 B/op 1 allocs/op 54.29 ns/op 4 B/op 1 allocs/op 0.81
BenchmarkSplitRepoPath/5 - ns/op 44.19 ns/op 54.29 ns/op 0.81
BenchmarkSplitRepoPath/5 - B/op 4 B/op 4 B/op 1
BenchmarkSplitRepoPath/5 - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkSplitRepoPath/6 16.75 ns/op 0 B/op 0 allocs/op 17.23 ns/op 0 B/op 0 allocs/op 0.97
BenchmarkSplitRepoPath/6 - ns/op 16.75 ns/op 17.23 ns/op 0.97
BenchmarkSplitRepoPath/6 - B/op 0 B/op 0 B/op 1
BenchmarkSplitRepoPath/6 - allocs/op 0 allocs/op 0 allocs/op 1

This comment was automatically generated by workflow using github-action-benchmark.

@hairyhenderson hairyhenderson merged commit 59f0448 into main Dec 17, 2024
19 checks passed
@hairyhenderson hairyhenderson deleted the aws-get-region-from-imds branch December 17, 2024 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant