Cast connects to CloudWatch using the
boto3 client. According to their documentation, before you can query with Cast…
You should set up authentication credentials. Credentials for your AWS account can be found in the IAM Console. You can create or use an existing user. Go to manage access keys and generate a new set of keys.
With your AWS Region, access_key_id and secret_access_key you can set up the CloudWatch and CloudWatch Log Insights Configure Dataset Types.
To learn more about the CloudWatch ad-hoc query language you can study the following links.