Intel® Cloud Optimization Modules for Terraform
© Copyright 2022, Intel Corporation
Amazon ECS Module
In this module we create a ECS cluster utilizing the latest Intel Architecture available for the AWS ECS Service.
Usage
See examples folder for code ./examples/ec2-managed-example/main.tf
This example module will create the following:
- VPC in the desired region with 3 subnets in 3 Availablity zones.
- Cloudwatch Log Group
- Creates 2 EC2 AutoScaling Groups
- EC2 instances per AutoScaling Group (ajust your min/max/desired)
- ECS Cluster with all EC2 instances as Container instances
Instance Types
- General: m6i.large, m6i.xlarge, m6i.2xlarge, m6i.4xlarge, m6i.8xlarge, m6i.12xlarge, m6i.16xlarge, m6i.24xlarge, m6i.32xlarge, m6i.metal, m6in.large, m6in.xlarge, m6in.2xlarge, m6in.4xlarge, m6in.8xlarge, m6in.12xlarge, m6in.16xlarge, m6in.24xlarge, m6in.32xlarge m6in.metal, m6id.large, m6id.xlarge, m6id.2xlarge, m6id.4xlarge, m6id.8xlarge, m6id.12xlarge, m6id.16xlarge, m6id.24xlarge, m6id.32xlarge m6id.metal, m6idn.large, m6idn.xlarge, m6idn.2xlarge, m6idn.4xlarge, m6idn.8xlarge, m6idn.12xlarge, m6idn.16xlarge, m6idn.24xlarge, m6idn.32xlarge m6idn.metal
- Compute Optimized: c6i.large, c6i.xlarge, c6i.2xlarge, c6i.4xlarge, c6i.8xlarge, c6i.12xlarge, c6i.16xlarge, c6i.24xlarge, c6i.32xlarge, c6i.metal, c6in.large, c6in.xlarge, c6in.2xlarge, c6in.4xlarge, c6in.8xlarge, c6in.12xlarge, c6in.16xlarge, c6in.24xlarge, c6in.32xlarge c6in.metal, c6id.large, c6id.xlarge, c6id.2xlarge, c6id.4xlarge, c6id.8xlarge, c6id.12xlarge, c6id.16xlarge, c6id.24xlarge, c6id.32xlarge c6id.metal, hpc6id.32.xlarge
- Memory Optimized: r6i.large, r6i.xlarge, r6i.2xlarge, r6i.4xlarge, r6i.8xlarge, r6i.12xlarge, r6i.16xlarge, r6i.24xlarge, r6i.32xlarge, r6i.metal, r6in.large, r6in.xlarge, r6in.2xlarge, r6in.4xlarge, r6in.8xlarge, r6in.12xlarge, r6in.16xlarge, r6in.24xlarge, r6in.32xlarge, r6in.metal, r6idn.large, r6idn.xlarge, r6idn.2xlarge, r6idn.4xlarge, r6idn.8xlarge, r6idn.12xlarge, r6idn.16xlarge, r6idn.24xlarge, r6idn.32xlarge, r6idn.metal
- HighMem/vCPU Ratio: x2iedn.xlarge, x2iedn.2xlarge, r6i.4xlarge, x2iedn.8xlarge, x2iedn.16xlarge, x2iedn.24xlarge, x2iedn.32xlarge, x2iedn.metal
- Storage Optimized: i4i.large, i4i.xlarge, i4i.2xlarge, i4i.4xlarge, i4i.8xlarge, i4i.16xlarge, i4i.32xlarge, i4i.metal
Choose your region, cluster name, desired instance type in the main.tf
Example of main.tf
locals {
region = "us-east-1"
name = "cluster-prod"
instance_type = "m6i.large"
# See above recommended instance types for Intel Xeon 3rd Generation Scalable processors (code-named Ice Lake)
user_data = <<-EOT
#!/bin/bash
cat <<'EOF' >> /etc/ecs/ecs.config
ECS_CLUSTER=${local.name}
ECS_LOGLEVEL=debug
EOF
EOT
tags = {
Owner = "user@company.com"
Duration = "24"
}
}
Run Terraform
terraform init
terraform plan
terraform apply
Note that this example may create resources. Run terraform destroy
when you don't need these resources anymore.
Considerations
Requirements
No requirements.
Providers
No providers.
Modules
No modules.
Resources
No resources.
Inputs
No inputs.
Outputs
No outputs.