-
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 endpoint into AWS config #16263
Add endpoint into AWS config #16263
Conversation
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.
Overall lgtm, left a minor concern
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.
Haven't tested this but it looks good to me!
* Add endpoint into AWS config * add EndpointResolver for aws config * Update endpoints with region name * replace endpoint_region with regions config option * Add endpoint to filebeat s3 input and aws module * Add endpoint to autodiscover aws ec2 and elb providers * update changelog * Add EnrichAWSConfigWithEndpoint function in libbeat/common for both FB and MB
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.
I suggest not to using hardcoded region name here.
@@ -86,7 +87,9 @@ func NewMetricSet(base mb.BaseMetricSet) (*MetricSet, error) { | |||
} | |||
|
|||
// Get IAM account name | |||
svcIam := iam.New(awsConfig) | |||
awsConfig.Region = "us-east-1" |
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.
The hardcoded region here works well in global regions but not for China regions.
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.
Thank you for the input! Sorry unfortunately I'm not able to test it with a China region, what would this be for China regions?
With this use case, we probably should add a separate config parameter called init_region
or something instead of hardcoded this as us-east-1
. Do you mind creating a separate github issue for this? Thanks again!!!
What does this PR do?
This PR is to add support for custom endpoint configuration in the AWS modules for Filebeat and Metricbeat.
AWS Service endpoints: https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
Why is it important?
There are users running in AWS private cloud regions, which require endpoint URL in configuration to access AWS API. The
ap-northeast-3
Region in Japan is not returned by Region enumeration APIs, such asEC2.describeRegions
API. To define endpoints for this Region, custom endpoint needs to be used:So the Amazon EC2 endpoint for this Region would be
ec2.ap-northeast-3.amazonaws.com
.Checklist
How to test this PR locally
Use
endpoint
config with regions to collect metrics. For example, the config below is to only collect EC2 cloudwatch metrics fromus-west-1
region underamazonaws.com
endpoint.Similarly, testing endpoint config parameter with Filebeat s3 input can use config like below:
For testing autodiscovery
aws_ec2
provider, config below can be used:aws_ec2
provider is workingresourcegroupstaggingapi
with endpoint: make sure tags for each service are collected with endpoint config provided.regions
config parameter: make sure if there is noregions
specified, then metrics from all regions should be collected.Related issues
#16245