amazon-cloudwatch

Cron job cloud watch event error: "Event pattern contains invalid value (can only be a nonempty array or nonempty object)

房东的猫 提交于 2021-01-05 07:34:45
问题 I am trying to set a schedule using a corn job expression for a lambda function target. The goal is to run the lambda function every day at 7 am IST. My cron job expression is: 0 7 * * * .... have set the target to be a lambda function. While configuring the event I get the following error: Event pattern contains an invalid value (can only be a nonempty array or nonempty object); All added targets need to be configured correctly for cron job expression I just referred few links online, don't

Creating an CloudWatch Event Rule for failed ECS tasks

限于喜欢 提交于 2021-01-01 08:06:13
问题 I currently have an ECS task that fails from time to time, with different error codes. I would like to create a CloudWatch event rule that is triggered on such failures. I currently have the following cloud watch event rule, which is triggered only on exit code 1. I would like to be notified of all non-zero errors exit code. { "source": [ "aws.ecs" ], "detail-type": [ "ECS Task State Change" ], "detail": { "lastStatus": [ "STOPPED" ], "stoppedReason": [ "Essential container in task exited" ],

Creating an CloudWatch Event Rule for failed ECS tasks

拥有回忆 提交于 2021-01-01 08:03:08
问题 I currently have an ECS task that fails from time to time, with different error codes. I would like to create a CloudWatch event rule that is triggered on such failures. I currently have the following cloud watch event rule, which is triggered only on exit code 1. I would like to be notified of all non-zero errors exit code. { "source": [ "aws.ecs" ], "detail-type": [ "ECS Task State Change" ], "detail": { "lastStatus": [ "STOPPED" ], "stoppedReason": [ "Essential container in task exited" ],

How to dockerize the cloudwatch agent and collectd to collect the metrics?

北慕城南 提交于 2021-01-01 07:13:05
问题 I need to collect the custom metrics from my ECS instances and from the documentation These are steps I need to follow Install aws cloudwatch agent Install collectd daemon Configure cloudwatch agent to get the metrics from collectd daemon It seems I can Dockerize the cloudwatch agent (which seems to be already done, but with lack of documentation) Dockerize collectd daemon Why to dockerize or not use awslogs driver for collecting metrics ? Currently we already have some services running as

How to dockerize the cloudwatch agent and collectd to collect the metrics?

假如想象 提交于 2021-01-01 07:09:12
问题 I need to collect the custom metrics from my ECS instances and from the documentation These are steps I need to follow Install aws cloudwatch agent Install collectd daemon Configure cloudwatch agent to get the metrics from collectd daemon It seems I can Dockerize the cloudwatch agent (which seems to be already done, but with lack of documentation) Dockerize collectd daemon Why to dockerize or not use awslogs driver for collecting metrics ? Currently we already have some services running as

ECS, how to add user-data after creating ecs instance

天涯浪子 提交于 2020-12-15 05:58:54
问题 I can't find a way to specify a user-data after creating ECS instance definition. Document says You can pass this user data into the Amazon EC2 launch wizard in Step 6.g of Launching an Amazon ECS Container Instance. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bootstrap_container_instance.html#multi-part_user_data ECS is launched automatically, how do you specify the user data? I want to send /var/log/syslog to cloudwatch and I need to add user data (https://docs.aws.amazon

How to get the event content in ECS when it is invoked by cloudwatch/eventbridge event?

那年仲夏 提交于 2020-12-12 11:27:05
问题 We can set up event rules to trigger an ECS task, but I don't see if the triggering event is passed to the runing ECS task and in the task how to fetch the content of this event. If a Lambda is triggered, we can get it from the event variable, for example, in Python: def lambda_handler(event, context): ... But in ECS I don't see how I can do things similar. Going to the cloudtrail log bucket doesn't sound to be a good way because it has around 5 mins delay for the new log/event to show up,

How to fix “static methods in interface require -target:jvm-1.8” in Scala application?

限于喜欢 提交于 2020-12-12 05:44:34
问题 I wrote the following code: import software.amazon.awssdk.services.cloudwatchlogs.CloudWatchLogsClient class Test() extends CloudWatchLogsClient { CloudWatchLogsClient.builder().build() def close():Unit = { println("test") } def serviceName(): String = "serviceName" CloudWatchLogsClient.create() } When it comes to compiling , I get the following error: Static methods in interface require -target:jvm-1.8 CloudWatchLogsClient.builder().build() Finally, I used the following dependencies in my

How to fix “static methods in interface require -target:jvm-1.8” in Scala application?

戏子无情 提交于 2020-12-12 05:42:41
问题 I wrote the following code: import software.amazon.awssdk.services.cloudwatchlogs.CloudWatchLogsClient class Test() extends CloudWatchLogsClient { CloudWatchLogsClient.builder().build() def close():Unit = { println("test") } def serviceName(): String = "serviceName" CloudWatchLogsClient.create() } When it comes to compiling , I get the following error: Static methods in interface require -target:jvm-1.8 CloudWatchLogsClient.builder().build() Finally, I used the following dependencies in my

How to fix “static methods in interface require -target:jvm-1.8” in Scala application?

余生长醉 提交于 2020-12-12 05:42:30
问题 I wrote the following code: import software.amazon.awssdk.services.cloudwatchlogs.CloudWatchLogsClient class Test() extends CloudWatchLogsClient { CloudWatchLogsClient.builder().build() def close():Unit = { println("test") } def serviceName(): String = "serviceName" CloudWatchLogsClient.create() } When it comes to compiling , I get the following error: Static methods in interface require -target:jvm-1.8 CloudWatchLogsClient.builder().build() Finally, I used the following dependencies in my