No description
Find a file
2025-12-18 09:11:44 -06:00
.gitignore Initial commit 2025-12-17 09:42:08 -06:00
.terraform.lock.hcl add ec2 options (#1) 2025-12-18 08:43:22 -06:00
alb.tf add ec2 options (#1) 2025-12-18 08:43:22 -06:00
asg.tf add ec2 options (#1) 2025-12-18 08:43:22 -06:00
ec2.tf add ec2 options (#1) 2025-12-18 08:43:22 -06:00
ecs.tf Feat/ecs (#2) 2025-12-18 08:44:23 -06:00
LICENSE Initial commit 2025-12-17 09:42:08 -06:00
main.tf add ec2 options (#1) 2025-12-18 08:43:22 -06:00
output.tf readme and outputs 2025-12-18 09:11:44 -06:00
provider.tf add ec2 options (#1) 2025-12-18 08:43:22 -06:00
README.md readme and outputs 2025-12-18 09:11:44 -06:00
schedule.tf readme and outputs 2025-12-18 09:11:44 -06:00
variable.tf readme and outputs 2025-12-18 09:11:44 -06:00

harness-autostopping

this module will create autostopping components for the target resource type, any combination of traffic, schedule, or none

for traffic based, you will pass your alb information

for schedule based, you will pass a list of objects that describe your schedule:

[{
    name = "mySched"
    type = "uptime"
    time_zone = "America/Chicago"
    spec = {
        days = ["MON", "TUE", "WED", "THU", "FRI"]
        start_time = "08:00"
        end_time = "17:00"
    }
}]

the above is a monday through friday 8-5 schedule

asg

autostopping for aws autoscaling groups

required inputs

  • asg_name
  • idle_time_mins
  • harness_cloud_connector_id
  • region

optional inputs

schedules

  • autostopping_schedules: list of uptime schedules repeat windows

traffic

  • vpc_id: vpc id
  • alb_arn: id of the alb to import to harness
  • listener_arn: listener arn
  • tg_arn: target group arn

ec2

autostopping for aws ec2 instances

required inputs

  • ec2_id
  • idle_time_mins
  • harness_cloud_connector_id
  • region

optional inputs

schedules

  • autostopping_schedules: list of uptime schedules repeat windows

traffic

  • vpc_id: vpc id
  • alb_arn: id of the alb to import to harness
  • listener_arn: listener arn
  • tg_arn: target group arn

ecs

autostopping for aws ecs services

required inputs

  • ecs_service_name
  • ecs_cluster_name
  • idle_time_mins
  • harness_cloud_connector_id
  • region

optional inputs

schedules

  • autostopping_schedules: list of uptime schedules repeat windows

traffic

  • vpc_id: vpc id
  • alb_arn: id of the alb to import to harness

module spec

Requirements

Name Version
aws >= 6
harness >= 0.39.1

Providers

Name Version
aws 6.26.0
harness 0.39.4

Modules

No modules.

Resources

Name Type
harness_autostopping_aws_alb.this resource
harness_autostopping_rule_ecs.this resource
harness_autostopping_rule_scale_group.this resource
harness_autostopping_rule_vm.this resource
harness_autostopping_schedule.this resource
aws_autoscaling_group.this data source
aws_ecs_cluster.this data source
aws_ecs_service.this data source
aws_instance.this data source
aws_lb.this data source
aws_lb_listener.this data source
aws_lb_target_group.this data source

Inputs

Name Description Type Default Required
alb_arn id of the alb to import to harness; set to enable alb autostopping string null no
asg_name asg id string null no
autostopping_schedules Optional list of schedule repeat windows. If null, no Harness autostopping schedule will be created.
list(object({
name = string
type = string
time_zone = string
spec = object({
days = list(string)
start_time = string
end_time = string
})
}))
null no
ec2_id ec2 id string null no
ecs_cluster_name ecs cluster name; required if ecs_service_name set string null no
ecs_service_name ecs service name string null no
harness_cloud_connector_id harness cloud connector id string n/a yes
idle_time_mins idle time number n/a yes
listener_arn listener arn; required if alb_arn set, unless using ecs string null no
name name for this alb/rule string n/a yes
region cloud region string n/a yes
tg_arn target group arn; required if alb_arn set, unless using ecs string null no
vpc_id vpc id; required if alb_arn set string null no

Outputs

Name Description
autostopping_rule_id n/a
autostopping_schedule_ids n/a