amazon-cloudwatch

Terraform: CloudWatch Event that notifies SNS

独自空忆成欢 提交于 2021-02-08 07:21:12
问题 I'm learning TF and trying to apply an infrastructure that creates: a simple lambda function an SNS topic get that lambda to subscribe the SNS topic a Cloud Watch Event that publishes a message to the topic at some interval a Cloud Watch Log Group to check if the lambda gets notified by the SNS The lambda permission to allow calls from SNS I'm able to apply that successfully. The infrastructure seems perfectly fine (it has the same aspect when I create that myself through the visual aws

Deny all outbound traffic except cloudwatch on AWS

我的梦境 提交于 2021-02-07 10:19:22
问题 I have a server(Java/Tomcat running) which was creating huge outbound traffic. This server can not be accessed from outside world only internal network server can access it. i.e. inbound is allowed only from internal network. To solve huge outbound traffic we have blocked all outbound traffic via aws security group except internal network servers. But now it has also stopped aws custom monitoring scripts to send data to cloudwatch. So what is the ip range that I need to open in outbound rules

Deny all outbound traffic except cloudwatch on AWS

时光毁灭记忆、已成空白 提交于 2021-02-07 10:17:36
问题 I have a server(Java/Tomcat running) which was creating huge outbound traffic. This server can not be accessed from outside world only internal network server can access it. i.e. inbound is allowed only from internal network. To solve huge outbound traffic we have blocked all outbound traffic via aws security group except internal network servers. But now it has also stopped aws custom monitoring scripts to send data to cloudwatch. So what is the ip range that I need to open in outbound rules

How to parse Prometheus data

爱⌒轻易说出口 提交于 2021-02-04 21:43:08
问题 I have been able to obtain the metrices by sending an HTTP GET as follows: # TYPE net_conntrack_dialer_conn_attempted_total untyped net_conntrack_dialer_conn_attempted_total{dialer_name="federate",instance="localhost:9090",job="prometheus"} 1 1608520832877 Now I need to parse this data and obtain control over every piece of data so that I can convert tand format like json. I have been looking into the ebnf package in Go: ebnf package Can somebody point me the right direction to parse the

How to parse Prometheus data

不羁的心 提交于 2021-02-04 21:42:32
问题 I have been able to obtain the metrices by sending an HTTP GET as follows: # TYPE net_conntrack_dialer_conn_attempted_total untyped net_conntrack_dialer_conn_attempted_total{dialer_name="federate",instance="localhost:9090",job="prometheus"} 1 1608520832877 Now I need to parse this data and obtain control over every piece of data so that I can convert tand format like json. I have been looking into the ebnf package in Go: ebnf package Can somebody point me the right direction to parse the

AWS Cloudwatch Math Expressions: removing Insufficient Data: is there a “coalesce” function like SQL?

好久不见. 提交于 2021-01-29 09:39:48
问题 Can I replace a None/Insufficient data point as a value (constant is fine) in a Cloudwatch Math Expression? I am using a math expression of several metrics: if's, arithmetic, etc. The problem is that you are now bound by all of the variables having sufficient data. If one is missing a datapoint, WHAM! Insufficient data for that math expression. Ideally, I'd like to do something like the following based on the standard SQL coalesce function: coalsece(m1, m2, 15) + coalesce(m3, 25) / coalesce

AWS CloudWatch Events trigger SNS on STS role assuming for cross account

我与影子孤独终老i 提交于 2021-01-28 06:18:19
问题 I have a cross-account architecture and I'm setting up a CloudWatch event for the STS role assuming into another account. I have CloudTrail enabled on the account, the logs from CloudTrail are stored in a separate accounts s3 bucket. The SNS feeds into SES to send an email upon assumption. For some reason, this event pattern won't trigger when the role is assumed! Any ideas? { "source": [ "aws.sts" ], "detail-type": [ "AWS API Call via CloudTrail" ], "detail": { "eventSource": ["sts.amazonaws

CloudWatch metric alarm using Terraform

可紊 提交于 2021-01-27 21:59:31
问题 When trying to setup some CloudWatch alarms using Terraform for some reason it doesn't find the metrics and the alarm remains stuck in insufficient data. Terraform doesn't output any errors and I can find the metrics if I search manually in AWS. What am I missing here? Example a simple healthy host alarm point to a target group: #healthy host alarm resource "aws_cloudwatch_metric_alarm" "health" { alarm_name = "${var.tag_app}_healthy_host" comparison_operator = "LessThanThreshold" evaluation

Kubernetes AWS Cloudwatch adapter not fetching custom metric value for EKS HPA autoscaling

你。 提交于 2021-01-27 14:22:58
问题 I'm trying to enable AWS EKS autoscaling based on a custom Cloudwatch metric via the Kubernetes Cloudwatch adapter. I have pushed custom metrics to AWS Cloudwatch, and validated they appear in Cloudwatch console as well as are retrievable using the boto3 client get_metric_data. This is the code I use to publish my custom metric to Cloudwatch: import boto3 from datetime import datetime client = boto3.client('cloudwatch') cloudwatch_response = client.put_metric_data( Namespace='TestMetricNS',

How to get metrics data from aws cloudwatch to csv

大兔子大兔子 提交于 2021-01-21 04:39:04
问题 i have been working on project, and i want to export metrics data from cloudwatch like CPU Utilization and Network Out data, is there any way to get that data? and convert it to csv? 回答1: Export CloudWatch Metrics You can't do it directly but following is the step by step instructions: Pre Reqs AWS CLI (Command Line Interface) from here jq is a lightweight and flexible command-line JSON processor from here How to export Use the following CLI: aws cloudwatch get-metric-statistics --namespace