AWS CloudWatch: EndpointConnectionError: Could not connect to the endpoint URL

时光毁灭记忆、已成空白 提交于 2019-12-06 03:57:32

问题


I just followed these instructions (Link) to get AWS CloudWatch installed on my EC2 instance.

  1. I updated my repositories: sudo yum update -y
  2. I installed the awslogs package: sudo yum install -y awslogs
  3. I edited the /etc/awslogs/awscli.conf, confirming that my AZ is us-west-2b on the EC2 page
  4. I left the default condiguration of the /etc/awslogs/awslogs.conf file as is, confirming that the default path indeed has logs being written to it
  5. I checked the /var/log/awslogs.log file and it is repeatedly showing the error: EndpointConnectionError: Could not connect to the endpoint URL: "https://logs.us-west-2b.amazonaws.com/"

    • I do not see any newly created log group and log stream in the CloudWatch console as expected. What am I missing here?

Should I be pointing at some other endpoint other than https://logs.us-west-2b.amazonaws.com/ ? If so, where is that configured?

Thanks in advance,

Graham


回答1:


The awscli.conf expects the region and not the AZ.

Specify the region as us-west-2.

Here is the documentation from the reference page

Edit the /etc/awslogs/awscli.conf file and in the [default] section, specify the region where you want to view log data and add your credentials.

region = us-east-1
aws_access_key_id = <YOUR ACCESS KEY>
aws_secret_access_key = <YOUR SECRET KEY>

The error EndpointConnectionError: Could not connect to the endpoint URL: "https://logs.us-west-2b.amazonaws.com/" could be attributed to wrong specification of region.

The correct endpoint for the cloudwatch logs service in US-WEST-2 is logs.us-west-2.amazonaws.com.

Please refer to the following documentation for aws service endpoints http://docs.aws.amazon.com/general/latest/gr/rande.html#cwl_region



来源:https://stackoverflow.com/questions/37493873/aws-cloudwatch-endpointconnectionerror-could-not-connect-to-the-endpoint-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!