A Terraform module which takes an EC2 instance type and returns the recommended memory allocation to assign to a process.
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"
}
Name | Version |
---|---|
terraform | >= 1.0.0 |
aws | >= 3.45.0 |
Name | Version |
---|---|
aws | >= 3.45.0 |
No modules.
Name | Type |
---|---|
aws_ec2_instance_type.type | data source |
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 |
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 |
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.