-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add Proxy settings to AWS Common #26832
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
@kaiyan-sheng any thoughts? |
@legoguy1000 Thanks for the contribution! @P1llus This is definitely useful addition! I will assign this PR to myself and take care of the review and backports. |
Cool. At first I tried to use the httpcommon package to not duplicate work, but the TLS settings weren't needed and there was an incompatibility from it not having a Roundtrip method. |
Pinging @elastic/integrations (Team:Integrations) |
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's beneficial to merge function EnrichAWSConfigWithEndpoint
and EnrichAWSConfigWithProxy
together?
I had thought about that originally and I wasn't sure if I was implementing this in the best way to begin with so I wanted to reduce the modifications of existing code and just add new. It shouldn't be an issue to combine the functions and just add another parameter to the function to pass the proxy config. I'll do whatever you guys think is best. func EnrichAWSConfigWithEndpoint(endpoint string, serviceName string, regionName string, proxyUrl *url.URL, awsConfig awssdk.Config) awssdk.Config {
if endpoint != "" {
if regionName == "" {
awsConfig.EndpointResolver = awssdk.ResolveWithEndpointURL("https://" + serviceName + "." + endpoint)
} else {
awsConfig.EndpointResolver = awssdk.ResolveWithEndpointURL("https://" + serviceName + "." + regionName + "." + endpoint)
}
}
if proxyUrl != nil {
httpClient := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyURL(proxyUrl),
},
}
awsConfig.HTTPClient = httpClient
}
return awsConfig
} |
/test |
This pull request is now in conflicts. Could you fix it? 🙏
|
@kaiyan-sheng Did you want me to change the code to the above to combine it with the |
@legoguy1000 Let's merge two into one function :) Thank you!! |
@kaiyan-sheng So I started to consolidate the function with the |
@legoguy1000 Agree, I wonder if we should combine |
/test |
I don't know that i would because the way that function is being used, the |
@kaiyan-sheng can u take a look and rerun tests? |
/test |
@kaiyan-sheng looks like everything passed. Did you have any other comments/changes you think should be made? |
@legoguy1000 LGTM, thank you again for your contribution!! |
(cherry picked from commit 94af9df)
(cherry picked from commit 94af9df) # Conflicts: # x-pack/filebeat/input/awss3/input.go # x-pack/filebeat/input/awss3/s3_integration_test.go # x-pack/libbeat/docs/aws-credentials-config.asciidoc
7.x backport is done in #27077 |
What does this PR do?
Adds the ability to set a proxy to the AWS SDK config.
Why is it important?
This is useful when the Beats outbound connections need to go through a proxy but don't want it to affect other inputs/outputs. When using the HTTP_PROXY env variable, this also affects the Beats output to Elasticsearch. Having a dedicated setting allows only the AWS requests to be proxied and not affect any other input/output.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs