Skip to content

Module to provisioning services and rolling update deployments and autoscaling ecs task with cloudwatch alarms

License

Notifications You must be signed in to change notification settings

hendrixroa/terraform-aws-ecs-non-traffic

Repository files navigation

ECS Non-Traffic

Module to provisioning services and rolling update deployments and autoscaling ecs task with cloudwatch alarms. Some features:

  • Elasticsearch cluster for logs.
  • Autoscaling
  • Terraform: 0.13.+
  • Force deployment

Inputs

Name Description Type
auto_scale_role
IAM Role for autocaling services string
cluster
Cluster used in ecs string
cpu_unit
Number of cpu units for container string
cwl_endpoint
Cloudwatch endpoint logs string
dummy_deps
Dummy dependencies for interpolation step string
environment
Environment variables for ecs task list
lambda_stream_arn
ARN of function lambda to stream logs into elasticsearch string
max_scale
Maximun number of task scaling string
memory
Number of memory for container string
min_scale
Minimun number of task scaling string
name
Name of service string
public_ip
Flag to set auto assign public ip string
roleArn
Role Iam for task def string
roleExecArn
Role Iam for execution string
role_service
Role for execution service string
secrets
Secrets values for ecs task list
security_groups
Security groups allowed list
service_count
Number of desired task string
service_role_codedeploy
Role for ecs codedeploy string
subnets
Private subnets from VPC string
task
ARN of task created string
vpc_id
VPC ID for create target group resources string

Outputs

Name Description
ecs_service_id
ID of service created

How to use

module "your_service_name" {
  source                = "hendrixroa/ecs-non-traffic/aws"
  name                  = "nameService"
  security_groups       = ["security_group_id"]
  subnets               = ["list of subnets"]
  vpc_id                = "vpc_id"
  cluster               = "ecs cluster id"
  role_service          = "role service arn"
  roleExecArn           = "role task execution arn"
  roleArn               = "role task arn"
  service_count         = 1
  disable_log_streaming = true
  dummy_deps            = "any deps that this service should wait for."
  kms_key_id            = "kms key id"
}