Skip to content

colmsnowplow/terraform-aws-service-ec2

 
 

Repository files navigation

Release CI License Registry

terraform-aws-service-ec2

A Terraform module which forms the base of all ec2 deployments for Snowplow OS services where we deploy an auto-scaling group of nodes running one or more services. This module serves to reduce the boilerplate code that we incur otherwise to simplify maintenance across all of our OS modules.

Requirements

Name Version
terraform >= 1.0.0
aws >= 3.72.0

Providers

Name Version
aws >= 3.72.0

Modules

Name Source Version
tags snowplow-devops/tags/aws 0.2.0

Resources

Name Type
aws_autoscaling_group.asg resource
aws_autoscaling_policy.scale_down resource
aws_autoscaling_policy.scale_up resource
aws_cloudwatch_metric_alarm.cpu_high resource
aws_cloudwatch_metric_alarm.cpu_low resource
aws_launch_template.lt resource
aws_ami.amazon_linux_2 data source

Inputs

Name Description Type Default Required
iam_instance_profile_name The name of the IAM instance profile to associate with the launch template string n/a yes
instance_type The instance type to use string n/a yes
name A name which will be pre-pended to the resources created string n/a yes
ssh_key_name The name of the SSH key-pair to attach to all EC2 nodes deployed string n/a yes
subnet_ids The list of subnets to deploy Enrich across list(string) n/a yes
user_supplied_script The user-data script extension to execute string n/a yes
amazon_linux_2_ami_id The AMI ID to use which must be based of of Amazon Linux 2; by default the latest community version is used string "" no
associate_public_ip_address Whether to assign a public ip address to this instance bool true no
enable_auto_scaling Whether to enable auto-scaling policies for the service bool true no
health_check_grace_period_sec Time (in seconds) after instance comes into service before checking health number 300 no
health_check_type EC2 or ELB - controls how health checking is done string "EC2" no
instance_refresh_min_healthy_percentage Percentage of ASG that must remain healthy during an instance refresh for the process to continue number 90 no
max_size The maximum number of servers in this server-group number 2 no
metadata_http_put_response_hop_limit The desired HTTP PUT response hop limit for instance metadata requests number 2 no
metadata_http_tokens Whether to enforce IMDSv2 on the metadata service (Options: required, optional) string "required" no
min_size The minimum number of servers in this server-group number 1 no
root_block_device_name The name of the root block device for the AMI being used string "/dev/xvda" no
root_block_device_volume_size_gb The size of the root block device in gb number 10 no
root_block_device_volume_type The type of volume to assign to the root block device string "gp3" no
scale_down_cooldown_sec Time (in seconds) until another scale-down action can occur number 600 no
scale_down_cpu_threshold_percentage The average CPU percentage that we must be below to scale-down number 20 no
scale_down_eval_minutes The number of consecutive minutes that we must be below the threshold to scale-down number 60 no
scale_up_cooldown_sec Time (in seconds) until another scale-up action can occur number 180 no
scale_up_cpu_threshold_percentage The average CPU percentage that must be exceeded to scale-up number 60 no
scale_up_eval_minutes The number of consecutive minutes that the threshold must be breached to scale-up number 5 no
security_groups A list of security groups to associate with the launch template list(string) [] no
tags The tags to append to this resource map(string) {} no
target_group_arns The list of target groups to associate the ASG with list(string) [] no

Outputs

Name Description
asg_id ID of the ASG
asg_name Name of the ASG

Copyright and license

The Terraform AWS Service on EC2 project is Copyright 2023-2023 Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 90.4%
  • Shell 9.6%