Skip to content

Files

Latest commit

67f2ee7 · Oct 11, 2024

History

History

lambda-metric-alarm

Cloudwatch metric alarms for AWS Lambda example

Configuration in this directory creates Cloudwatch metric alarms for AWS Lambda. One metric alarm is based on metric_name defined by AWS Lambda service, another metric alarm is based on metric_query which monitors error rates (number of errors divided by the number of invocations).

Usage

To run this example you need to execute:

$ terraform init
$ terraform plan
$ terraform apply

Note that this example may create resources which cost money. Run terraform destroy when you don't need these resources.

Requirements

Name Version
terraform >= 1.0
aws >= 5.58

Providers

No providers.

Modules

Name Source Version
alarm ../../modules/metric-alarm n/a
alarm_anomaly ../../modules/metric-alarm n/a
alarm_metric_query ../../modules/metric-alarm n/a
all_lambdas_errors_alarm ../../modules/metric-alarm n/a
aws_lambda_function1 ../fixtures/aws_lambda_function n/a
aws_lambda_function2 ../fixtures/aws_lambda_function n/a
aws_sns_topic ../fixtures/aws_sns_topic n/a

Resources

No resources.

Inputs

No inputs.

Outputs

Name Description
cloudwatch_metric_alarm_arn The ARN of the Cloudwatch metric alarm
cloudwatch_metric_alarm_id The ID of the Cloudwatch metric alarm
lambda_function1_arn Lambda function ARN
lambda_function1_name Lambda function name