Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 848
gigawatts Avatar asked May 27 '16 23:05

gigawatts


People also ask

Could not connect to the endpoint URL secrets manager?

The reason the "Could not connect to the endpoint URL" error occurs is because an incorrect region code is set when running an AWS CLI command. In order to solve the "Could not connect to the endpoint URL" error, set the region to a valid AWS region code, e.g. us-east-1 .

What is my S3 endpoint URL?

An S3 bucket can be accessed through its URL. The URL format of a bucket is either of two options: http://s3.amazonaws.com/[bucket_name]/ http://[bucket_name].s3.amazonaws.com/

How do you check S3 endpoint is working?

Testing the VPC Endpoint for S3 To check that your VPC Endpoint for S3 is working correctly, find the URL of your target bucket in the AWS console and use the hostname there as the target of a traceroute command on one of your virtual machines in your SDDC.


1 Answers

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

like image 138
Shibashis Avatar answered Sep 28 '22 15:09

Shibashis