snowplow-devops / terraform-aws-ec2-instance-type-metrics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Release CI License Registry

terraform-aws-ec2-instance-type-metrics

A Terraform module which takes an EC2 instance type and returns the recommended memory allocation to assign to a process.

Usage

You can use this module to find a safe amount of memory to assign to an application running on an instance. Depending on what other processes you are running on your server you should tweak the percentages and parameters accordingly but the defaults should work for systems where you are only running a single application.

module "instance_type_metrics" {
  source  = "snowplow-devops/ec2-instance-type-metrics/aws"

  instance_type = "t3.small"
}

locals {
  app_memory = "${module.instance_type_metrics.memory_application_mb}m"
}

Requirements

Name Version
terraform >= 1.0.0
aws >= 3.45.0

Providers

Name Version
aws >= 3.45.0

Modules

No modules.

Resources

Name Type
aws_ec2_instance_type.type data source

Inputs

Name Description Type Default Required
instance_type The instance type to use string n/a yes
memory_for_app_pct The percent of the instance memory to allocate to the application number 80 no
memory_for_os_mb The minimum amount of memory that must be available for the base Operating System number 384 no

Outputs

Name Description
memory_application_mb The recommended memory to allocate to an application running on this instance
memory_application_mb_max The maximum memory to allocate to an application running on this instance
memory_mb The amount of memory in mb allocated to this instance
v_cpu_count The number of vCPUs allocated to this instance

Copyright and license

The Terraform AWS EC2 Instance Type Metrics project is Copyright 2022-2022 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

License:Apache License 2.0


Languages

Language:HCL 100.0%