Skip to content

Terraform AWS module to ingest the Application Autoscaling activities for a ECS cluster to cloudwatch log

License

Notifications You must be signed in to change notification settings

teamclairvoyant/terraform-aws-application-autoscaling-activities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This module creates the resources and automates ingestion of ECS Application Autoscaling events to the cloud watch log.

And creates a CloudWatch log insight query to generate statistics on the scaling events.

Usage

module "application-autoscaling-activities" {
  source       = "terraform-aws-application-autoscaling-activities"
  cluster_arn  = "XXXX"
  cluster_name = "XXXX"
}

Requirements

Name Version
terraform >= 1.2.0, < 1.3.0
aws ~> 4.52.0

Providers

Name Version
aws ~> 4.52.0

Modules

Name Source Version
dynamodb_table terraform-aws-modules/dynamodb-table/aws 3.1.2
lambda-cloudwatch-trigger infrablocks/lambda-cloudwatch-events-trigger/aws 0.3.0
lambda_function terraform-aws-modules/lambda/aws 2.34.1
this cloudposse/label/null 0.24.1

Resources

Name Type
aws_cloudwatch_log_group.app-autoscaling-activity-log-group resource
aws_cloudwatch_query_definition.app-auto-scaling-activities resource
aws_iam_policy_document.applicationAutoScalingActivitiesLambdaPolicy data source

Inputs

Name Description Type Default Required
additional_tag_map Additional tags for appending to tags_as_list_of_maps. Not added to tags. map(string) {} no
attributes Additional attributes (e.g. 1) list(string) [] no
aws_region Provide the aws region string "us-west-2" no
context Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as null to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional_tag_map, which are merged.
any
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {}
}
no
delimiter Delimiter to be used between namespace, environment, stage, name and attributes.
Defaults to - (hyphen). Set to "" to use no delimiter at all.
string null no
ecs_cluster_arn Provide the ECS cluster ARN string n/a yes
enabled Set to false to prevent the module from creating any resources bool null no
environment Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' string null no
id_length_limit Limit id to this many characters (minimum 6).
Set to 0 for unlimited length.
Set to null for default, which is 0.
Does not affect id_full.
number null no
label_key_case The letter case of label keys (tag names) (i.e. name, namespace, environment, stage, attributes) to use in tags.
Possible values: lower, title, upper.
Default value: title.
string null no
label_order The naming order of the id output and Name tag.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 5 elements, but at least one must be present.
list(string) null no
label_value_case The letter case of output label values (also used in tags and id).
Possible values: lower, title, upper and none (no transformation).
Default value: lower.
string null no
name Solution name, e.g. 'app' or 'jenkins' string null no
namespace Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' string null no
regex_replace_chars Regex to replace chars with empty string in namespace, environment, stage and name.
If not set, "/[^a-zA-Z0-9-]/" is used to remove all characters other than hyphens, letters and digits.
string null no
stage Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' string null no
tags Additional tags (e.g. map('BusinessUnit','XYZ') map(string) {} no
trigger_schedule_cron Provide the cron expression for the Event Bridge rule string "cron(0 10 * * ? *)" no

Outputs

Name Description
app-auto-scaling-dynamodb n/a
app-auto-scaling-lambda-function-arn n/a
app-auto-scaling-lambda-trigger-cloudwatch_event_rule_id n/a
app-auto-scaling-log-group-name n/a

About

Terraform AWS module to ingest the Application Autoscaling activities for a ECS cluster to cloudwatch log

Resources

License

Stars

Watchers

Forks

Packages

No packages published