Add endpoint into AWS config#16263
Add endpoint into AWS config#16263kaiyan-sheng merged 8 commits intoelastic:masterfrom kaiyan-sheng:add_endpoint_aws
Conversation
ChrsMark
left a comment
There was a problem hiding this comment.
Overall lgtm, left a minor concern
ChrsMark
left a comment
There was a problem hiding this comment.
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
henrysher
left a comment
There was a problem hiding this comment.
I suggest not to using hardcoded region name here.
|
|
||
| // Get IAM account name | ||
| svcIam := iam.New(awsConfig) | ||
| awsConfig.Region = "us-east-1" |
There was a problem hiding this comment.
The hardcoded region here works well in global regions but not for China regions.
There was a problem hiding this comment.
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-3Region in Japan is not returned by Region enumeration APIs, such asEC2.describeRegionsAPI. 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
endpointconfig with regions to collect metrics. For example, the config below is to only collect EC2 cloudwatch metrics fromus-west-1region underamazonaws.comendpoint.Similarly, testing endpoint config parameter with Filebeat s3 input can use config like below:
For testing autodiscovery
aws_ec2provider, config below can be used:aws_ec2provider is workingresourcegroupstaggingapiwith endpoint: make sure tags for each service are collected with endpoint config provided.regionsconfig parameter: make sure if there is noregionsspecified, then metrics from all regions should be collected.Related issues
#16245