All Questions
Tagged with aws-cloudformation amazon-cloudwatch
215
questions
90
votes
7
answers
79k
views
Specify log group for an AWS lambda?
Is there a way to specify the CloudWatch log group that an AWS lambda logs to? It seems to be generated directly from the lambda name; however, it would be especially convenient to, for example, ...
49
votes
9
answers
28k
views
Cloudwatch failedinvocation error no logs available [closed]
I have set up a Cloudwatch rule event where an ECS task definition is started when a previous task definition is completed.
I can see the event triggers the task definition however it fails.
The ...
39
votes
8
answers
24k
views
AWS::Event::Rule FailedInvocation debug info?
I have a AWS::Event::Rule that routes a S3 put event to a ECS task. I can see the rule is being triggered from the metrics, but also see FailedInvocation on every trigger. I suspect that's a ...
23
votes
2
answers
16k
views
Unable to define Math Expression for Cloudwatch Alarm in a Cloudformation Template
Recently AWS announced that Cloudwatch alarms can use Math Expressions on metrics. I decided to create an alarm that compares the SUM of 2 single metrics with a given threshold. This means that ...
22
votes
7
answers
27k
views
Configure SQS Dead letter Queue to raise a cloud watch alarm on receiving a message
I was working with Dead letter Queue in Amazon SQS. I want that whenever a new message is received by the queue it should raise a CloudWatch alarm. The problem is I configured an alarm on the metric: ...
19
votes
1
answer
8k
views
How to set Lambda alarm for specific Lambda using CloudFormation?
This is the structure of CloudFormation Alarm from AWS document.
Type: "AWS::CloudWatch::Alarm"
Properties:
ActionsEnabled: Boolean
AlarmActions:
- String
AlarmDescription: String
...
19
votes
6
answers
32k
views
how to connect a cloudwatch alarm to a lambda function
How do you connect an aws cloud watch alarm to a lambda function invocation?
I am programmatically adding a cloud watch alarm to the ELBs that we create as part of a cloud formation stack via AWS ...
17
votes
3
answers
10k
views
Where to find CloudFormation log stream
I used this CloudFormation template to create a stack: https://fwd.aws/mDMrd
One of the steps failed, and the status reason given is:
Failed to create resource. See the details in CloudWatch Log ...
11
votes
3
answers
8k
views
Enable SNS Delivery Status Logging configuration in cloudformation
I'm trying to set up an SNS topic with AWS CloudFormation.
I'm able to get the topics and its SQS subscriptions up and running, but I couldn't find a way to specify the delivery status logging options ...
10
votes
4
answers
15k
views
Update existing Log Group using CloudFormation
I have a lambda which has a log group, say LG-1, for which retention is set to Never Expire (default). I need to change this Never Expire to 1 month. I am doing this using CloudFormation. As the log ...
9
votes
3
answers
10k
views
Cloudformation Cloudwatch InputTemplate Formatting
I'm attempting to use a cloudformation template to create a cloudwatch event rule that matches a glue event and targets an SNS topic to send a message to, I can create it in the cloudwatch console, ...
9
votes
3
answers
11k
views
How to create cloudwatch event using cloudformation template?
I am using cloudwatch scheduled event to trigger my lambda function after specific time interval. I would like to use cloud-formation template to add this rule in cloudwatch. I have gone through ...
9
votes
2
answers
4k
views
Export existing AWS CloudWatch alarms to CloudFormation template
How to export existing, configured and tested AWS CloudWatch alarms to Cloudformation template?
I know about CloudFormer tool, but it supports limited number of AWS services (Amazon VPC, DynamoDB, ...
8
votes
1
answer
7k
views
CloudWatch Event that targets SQS Queue fails to work
According to this article it's possible to set SQS as target for scheduled CloudWatch event:
https://aws.amazon.com/ru/about-aws/whats-new/2016/03/cloudwatch-events-now-supports-amazon-sqs-queue-...
8
votes
1
answer
2k
views
Is it possible to create a Scheduled Rule from CloudWatch for a Lambda State Function Set
I want to use CloudFormation to create a stack of preexisting Lambda Functions into a State Machine using Step Functions on a schedule (30 mins). I have successfully created the stack for my other ...
8
votes
2
answers
6k
views
CloudWatch Alarm Percentage of errors API Gateway
I'm trying to setup and alarm in Cloudwatch using terraform.
My alarm basically needs to check if there is more than 5% of 5xx errors in the gateway during 2 periods of 1 minute.
I've tried the ...
7
votes
3
answers
5k
views
Auto scaling using cloud formation according to Request count
We are using cloud formation for auto scaling according based upon the load balancer RequestCount metric. Currently we scale up an instance if the request is increased to 1500 for 1 minute (each ...
7
votes
2
answers
13k
views
User is not authorized to perform: SNS:CreateTopic on resource
I wanted to monitor certain parameters (TotalErrorRate and Latency) with CloudWatch and I wanted a "Simple Notification Service" (SNS) to send me an email, when an (cloudWatch) alarm is thrown:
...
6
votes
2
answers
17k
views
How to add custom Metric and Alarm to AWS Lambda function via aws-cdk
I kind of stuck with configuring cdk a common use case: to have an Alarm and Metric for Lambda Function
import lambda = require("@aws-cdk/aws-lambda")
import { Duration } from "@...
6
votes
1
answer
9k
views
How 'Period' in Cloud Watch Alarm really works?
I'm building a cloud watch alarm to send an email when a lambda function is not called in a period of 5 minutes
CloudWatchAlarm:
Type: AWS::CloudWatch::Alarm
Properties:
...
6
votes
1
answer
4k
views
How do I specify another AWS account's Event Bus as a target of an EventBridge rule using CloudFormation or CDK?
How do I specify another AWS account's event bus as the target of a CloudWatch Rule using CloudFormation or CDK?
Here is an example Rule using CDK where I try to send CodeDeploy events to another ...
6
votes
1
answer
5k
views
Why does a CloudWatch request count alarm created via CloudFormation yield "Insufficient Data"?
I am using AWS CloudFormation for my application and am trying to make a request count alarm via a respective template. I can successfully make the request count alarm directly for the Elastic Load ...
6
votes
1
answer
1k
views
How to enable M out of N CloudWatch Alarm with CloudFormation?
Since december 2017 it's possible to have CloudWatch Alarm alarm triggered only if M out of N data points are breaching. When creating alarms with CloudFormation, the CloudWatch::Alarm::...
6
votes
0
answers
2k
views
Retaining LogGroup and reusing it when redeploy the Lambda
I have a CF stack where I create a Lambda and a LogGroup to this lambda. For now, no deletion policy is in place for the LogGroup.
I would like to implement a solution where we keep LogGroup retained ...
5
votes
1
answer
3k
views
How to send Cloudwatch log details via email?
The diagram below is what I am trying to achieve. In brief, to send CloudTrail logs to CloudWatch log group then scan it for certain events and finally send email alerts if there is an concerting ...
5
votes
2
answers
3k
views
How to enable cloudwatch logs and assign custom domain name in cloudformation
I have a cloudformation template to build my api using the API Gateway.
I don't know how to:
Enable cloudwatch logs for the stage in the cloudformation template
Assign the stage to a Custom Domain ...
5
votes
1
answer
4k
views
Add instanceid dimension to cloudwatch metric-filter
I set up a very basic metric filter for a log-stream to count the number of lines matching a certain condition. My usecase is very similiar to the one described at the tutorial for counting apache ...
5
votes
2
answers
3k
views
Cloudformation template to push cloudwatch logs to elasticsearch
I am looking for a Cloudformation template to push cloudwatch logs to elasticsearch in another account. Even to the same account would be ok and I can update that.
Seems like a standard problem but ...
5
votes
1
answer
2k
views
Setting up CloudWatch dimensions for APIGateway methods in CloudFormation
I have an api say apifortest which has at 10 methods under different paths. Those methods are GET, PUT and POST. What I want to do is create a CloudWatch monitor for these.
I was looking at ...
5
votes
2
answers
13k
views
Referencing Secrets Manager secret in cloudFormation template
i have piece of cloudFormation code
"dareMeXDevCloudwatchMissingPayoutsJob": {
"Type": "AWS::Events::Rule",
"DependsOn": [
"xxx"
],
"Properties": {
"...
5
votes
2
answers
3k
views
CloudFormation created Lambda does not create LogStream/ Logs
I have a CloudFormation Template including a lambda function. The relevant parts are
AWSTemplateFormatVersion: 2010-09-09
Parameters:
Environment:
Description: Environment name
Type: String
...
4
votes
1
answer
5k
views
How do I setup an alarm for CloudFront from CloudWatch in a CloudFormation yaml template?
I want to setup an alarm in case an error occurs on CloudFront from CloudWatch.
In the console, I would directly create an alarm that would send me an email in case the TotalErrorRate is larger than ...
4
votes
1
answer
4k
views
How to define a CloudWatch Alarm on the sum of two metrics with CloudFormation?
I need to trigger an alarm when the sum of the same metric (ApproximateNumberOfMessagesVisible) on two different queues exceed the value of 100
In September '17, this answer stated that the only way ...
4
votes
1
answer
6k
views
Inputing parameters into Cloudwatch Event Rule Input parameter in Cloudformation
I'm creating a Cloudwatch Event Rule that is supposed to trigger a lambda if the Step Function enters a failure or time out state. The cloud watch event rule will pass parameters to the lambda which ...
4
votes
3
answers
3k
views
Cloudformation: ECS TaskDefinition CloudWatch logs retention policy
Is it possible to specify a CloudWatch logs retention policy in an ECS Task definition?
Couldn't find any documentation about it.
ServiceTaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
...
4
votes
2
answers
5k
views
How to use Parameters in CloudWatch Dashboard template
I am trying to create a CloudFormation template to create a CloudWatch dashboard. Following is the template code -
Parameters:
MyEnvironment:
Type: String
Default: "do"
...
4
votes
4
answers
3k
views
CloudFormation alarm for multiple Lambdas
I have an app with a bunch of Lambdas. Instead of adding one CloudWatch alarm for each is there a way to combine all of them into one alarm that goes off if any of the Lambdas error out?
So far I ...
4
votes
1
answer
4k
views
How to trigger AWS Events Rule only when a specific file (key) gets written to an S3 Bucket
I am trying to make an AWS Event (in CloudWatch or EventBridge) that triggers the run of an AWS Step Function when a specific file is put into an S3 Bucket.
My event pattern for the Rule is shown ...
4
votes
1
answer
2k
views
Terraform import aws_cloudwatch_log_stream
I need to import an existing aws_cloudwatch_log_stream (or AWS::Logs::LogStream in CloudFormation) into my configuration. However, it appears that Terraform does not support this functionality. ...
4
votes
3
answers
7k
views
AWS CloudWatch Event Rule - Invoke Lambda with Parameter
I am using an AWS CloudWatch Event Rule to invoke a Python Lambda function based on Cron Schedule, which is working fine. Now can I pass a parameter into this Lambda function from CloudWatch Event ...
4
votes
3
answers
4k
views
How to manually trigger a cloudwatch rule with ScheduleExpression(10 days)
I have to setup "AWS::Events::Rule" in cloudwatch with ScheduleExpression(10 days), and write some code to test it, but I can not change the "10 days" to 1 minute or call the lambda function directly. ...
4
votes
1
answer
1k
views
How to pass tags of existing resources to cloud watch alarm in CFT in AWS?
I am trying to add a CloudWatch alarm over multiple instances in my AWS account based on the instance tags.
For example, I have 4 instances running with tags Name=DEV, APP=WebServer.
I am new to AWS ...
3
votes
1
answer
2k
views
How do I create a Lambda that's called on a regular interval by a cloudwatch event with troposphere?
I've created a Lambda function that I want called every 5 mins, or once a day, or whatever. How do I set that up with troposphere?
I can't find an example anywhere.
3
votes
2
answers
4k
views
How to enable request metrics for S3 bucket using Cloudformation or CDK
I am able to enable (request metrics for S3 bucket, apid option) in the AWS console manually by checking the checkbox(https://ibb.co/bWDLcNT). But I am trying to do that via code. I tried finding ...
3
votes
3
answers
5k
views
How to correctly configure Route53 HealthCheck Alarm with CF (in Sydney)
I've configured a Route53 HealthCheck with an associated alarm with CloudFormation, but the resulting healthcheck shows as having No alarms configured, and the alarms in the CloudWatch console remain ...
3
votes
2
answers
8k
views
How do I define an AWS MetricFilter FilterPattern to match a JSON-formatted log event in CloudWatch?
I am trying to define a metric filter, in an AWS CloudFormation template, to match JSON-formatted log events from CloudWatch.
Here is an example of the log event:
{
"httpMethod": "GET",
"...
3
votes
1
answer
2k
views
AWS Cloudformation - Invocation of Lambda by Rule Event failed
I tried to create a template in cloudformation, having a lambda function triggered by one cloudwatch event rule(every 10minutes). In the cloudwatch graph, I can see the invocations but also all ...
3
votes
4
answers
3k
views
Take Scheduled EBS Snapshots using Cloud Watch and Cloud Formation
The task seems to be simple: I want to take scheduled EBS snapshots of my EBS volumes on a daily basis. According to the documentation, CloudWatch seems to be the right place to do that:
http://docs....