Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added autoscaling group #4

Merged
merged 25 commits into from
Nov 24, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,31 @@ module "ecs_cluster" {
}
}
}

nitrocode marked this conversation as resolved.
Show resolved Hide resolved
data "aws_ssm_parameter" "ami" {
nitrocode marked this conversation as resolved.
Show resolved Hide resolved
name = "/aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id"
nitrocode marked this conversation as resolved.
Show resolved Hide resolved
}

module "autoscale_group" {
source = "cloudposse/ec2-autoscale-group/aws"
version = "0.31.1"

name = "external-capacity-provider"
nitrocode marked this conversation as resolved.
Show resolved Hide resolved
context = module.this.context

image_id = data.aws_ssm_parameter.ami.value
nitrocode marked this conversation as resolved.
Show resolved Hide resolved
instance_type = "t3.medium"
security_group_ids = [module.vpc.vpc_default_security_group_id]
subnet_ids = module.subnets.private_subnet_ids
health_check_type = "EC2"
min_size = 0
max_size = 2
wait_for_capacity_timeout = "5m"
associate_public_ip_address = false
user_data_base64 = ""

# Auto-scaling policies and CloudWatch metric alarms
autoscaling_policies_enabled = true
cpu_utilization_high_threshold_percent = "70"
cpu_utilization_low_threshold_percent = "20"
nitrocode marked this conversation as resolved.
Show resolved Hide resolved
}