Skip to content

Commit

Permalink
Adding Launch COnfiguration outputs and improving README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jnonino committed Jul 10, 2019
1 parent 57a9ae5 commit 23791ab
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 3 deletions.
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,57 @@

This Terraform module deploys an AWS EC2 Auto Scaling Group.

[![CircleCI](https://circleci.com/gh/jnonino/terraform-aws-ec2-asg.svg?style=svg)](https://circleci.com/gh/jnonino/terraform-aws-ec2-asg)
[![CircleCI](https://circleci.com/gh/jnonino/terraform-aws-ec2-asg.svg?style=svg)](https://circleci.com/gh/jnonino/terraform-aws-ec2-asg)

## Usage

Check valid versions on:
* Github Releases: <https://github.com/jnonino/terraform-aws-ec2-asg/releases>
* Terraform Module Registry: <https://registry.terraform.io/modules/jnonino/ec2-asg/aws>

module "ec2-asg":
source = "jnonino/ec2-asg/aws"
version = "1.0.0"
name_preffix = var.name_preffix
profile = var.profile
region = var.region
image_id = var.image_id
instance_type = var.instance_type
max_size = var.max_size
min_size = var.min_size
availability_zones = var.availability_zones
}

In the example only required values are show, but you can configure all values for this resources. Check documentation on: <https://registry.terraform.io/modules/jnonino/ec2-asg/aws>

## Output values
* lc_name: The name of the launch configuration.
* lc_id: The ID of the launch configuration.
* asg_id: The autoscaling group id.
* asg_arn: The ARN for this AutoScaling Group.
* asg_availability_zones: The availability zones of the autoscale group.
* asg_min_size: The minimum size of the autoscale group.
* asg_max_size: The maximum size of the autoscale group.
* asg_default_cooldown: Time between a scaling activity and the succeeding scaling activity.
* asg_name: The name of the autoscale group.
* asg_health_check_grace_period: Time after instance comes into service before checking health.
* asg_health_check_type: EC2 or ELB. Controls how health checking is done.
* asg_desired_capacity: The number of Amazon EC2 instances that should be running in the group.
* asg_launch_configuration: The launch configuration of the autoscale group.
* asg_vpc_zone_identifier: (Optional) The VPC zone identifier.
* asg_load_balancers: (Optional) The load balancer names associated with the autoscaling group.
* asg_target_group_arns: (Optional) list of Target Group ARNs that apply to this AutoScaling Group.
* cpu_high_name: The scaling policy's name.
* cpu_high_arn: The ARN assigned by AWS to the scaling policy.
* cpu_high_autoscaling_group_name: The scaling policy's assigned autoscaling group.
* cpu_high_adjustment_type: The scaling policy's adjustment type.
* cpu_high_policy_type: The scaling policy's type.
* cpu_low_name: The scaling policy's name.
* cpu_low_arn: The ARN assigned by AWS to the scaling policy.
* cpu_low_autoscaling_group_name: The scaling policy's assigned autoscaling group.
* cpu_low_adjustment_type: The scaling policy's adjustment type.
* cpu_low_policy_type: The scaling policy's type.
* cpu_high_alarm_id: The ID of the health check.
* cpu_high_alarm_arn: (Optional) list of Target Group ARNs that apply to this AutoScaling Group.
* cpu_low_alarm_id: The ID of the health check.
* cpu_low_alarm_arn: (Optional) list of Target Group ARNs that apply to this AutoScaling Group.
16 changes: 14 additions & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# ---------------------------------------------------------------------------------------------------------------------
# AWS EC2 AUTO SCALING GROUP
# ---------------------------------------------------------------------------------------------------------------------
output "lc_name" {
description = "The name of the launch configuration."
value = aws_launch_configuration.lc.name
}
output "lc_id" {
description = "The ID of the launch configuration."
value = aws_launch_configuration.lc.id
}

# ---------------------------------------------------------------------------------------------------------------------
# AWS EC2 AUTO SCALING GROUP
# ---------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -70,7 +82,7 @@ output "cpu_high_arn" {
value = aws_autoscaling_policy.cpu_high.arn
}
output "cpu_high_autoscaling_group_name" {
description = "The scaling policy's assigned autoscaling group"
description = "The scaling policy's assigned autoscaling group."
value = aws_autoscaling_policy.cpu_high.autoscaling_group_name
}
output "cpu_high_adjustment_type" {
Expand All @@ -90,7 +102,7 @@ output "cpu_low_arn" {
value = aws_autoscaling_policy.cpu_low.arn
}
output "cpu_low_autoscaling_group_name" {
description = "The scaling policy's assigned autoscaling group"
description = "The scaling policy's assigned autoscaling group."
value = aws_autoscaling_policy.cpu_low.autoscaling_group_name
}
output "cpu_low_adjustment_type" {
Expand Down

0 comments on commit 23791ab

Please sign in to comment.