Skip to content

Latest commit

 

History

History

fargate

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

ECS Clusters w/ Fargate

Configuration in this directory creates:

  • ECS cluster using Fargate (on-demand and spot) capacity providers
  • Example ECS service that utilizes
    • AWS Firelens using FluentBit sidecar container definition
    • Service connect configuration
    • Load balancer target group attachment
    • Security group for access to the example service

Usage

To run this example you need to execute:

$ terraform init
$ terraform plan
$ terraform apply

Note that this example may create resources which will incur monetary charges on your AWS bill. Run terraform destroy when you no longer need these resources.

Requirements

Name Version
terraform >= 1.0
aws >= 4.66.1

Providers

Name Version
aws >= 4.66.1

Modules

Name Source Version
alb terraform-aws-modules/alb/aws ~> 9.0
ecs_cluster ../../modules/cluster n/a
ecs_service ../../modules/service n/a
ecs_task_definition ../../modules/service n/a
vpc terraform-aws-modules/vpc/aws ~> 5.0

Resources

Name Type
aws_service_discovery_http_namespace.this resource
aws_availability_zones.available data source
aws_ssm_parameter.fluentbit data source

Inputs

No inputs.

Outputs

Name Description
cluster_arn ARN that identifies the cluster
cluster_autoscaling_capacity_providers Map of capacity providers created and their attributes
cluster_capacity_providers Map of cluster capacity providers attributes
cluster_id ID that identifies the cluster
cluster_name Name that identifies the cluster
service_autoscaling_policies Map of autoscaling policies and their attributes
service_autoscaling_scheduled_actions Map of autoscaling scheduled actions and their attributes
service_container_definitions Container definitions
service_iam_role_arn Service IAM role ARN
service_iam_role_name Service IAM role name
service_iam_role_unique_id Stable and unique string identifying the service IAM role
service_id ARN that identifies the service
service_name Name of the service
service_security_group_arn Amazon Resource Name (ARN) of the security group
service_security_group_id ID of the security group
service_task_definition_arn Full ARN of the Task Definition (including both family and revision)
service_task_definition_family The unique name of the task definition
service_task_definition_family_revision The family and revision (family:revision) of the task definition
service_task_definition_revision Revision of the task in a particular family
service_task_exec_iam_role_arn Task execution IAM role ARN
service_task_exec_iam_role_name Task execution IAM role name
service_task_exec_iam_role_unique_id Stable and unique string identifying the task execution IAM role
service_task_set_arn The Amazon Resource Name (ARN) that identifies the task set
service_task_set_id The ID of the task set
service_task_set_stability_status The stability status. This indicates whether the task set has reached a steady state
service_task_set_status The status of the task set
service_tasks_iam_role_arn Tasks IAM role ARN
service_tasks_iam_role_name Tasks IAM role name
service_tasks_iam_role_unique_id Stable and unique string identifying the tasks IAM role
task_definition_run_task_command awscli command to run the standalone task

License

Apache-2.0 Licensed. See LICENSE.