Created
March 10, 2020 15:40
-
-
Save AndrewBestbier/fa9f768afad80b7efcbf69ce9d83a88d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_ecs_task_definition" "my_first_task" { | |
| family = "my-first-task" # Naming our first task | |
| container_definitions = <<DEFINITION | |
| [ | |
| { | |
| "name": "my-first-task", | |
| "image": "${aws_ecr_repository.my_repo.repository_url}", | |
| "essential": true, | |
| "portMappings": [ | |
| { | |
| "containerPort": 3000, | |
| "hostPort": 3000 | |
| } | |
| ], | |
| "memory": 512, | |
| "cpu": 256 | |
| } | |
| ] | |
| DEFINITION | |
| requires_compatibilities = ["FARGATE"] # Stating that we are using ECS Fargate | |
| network_mode = "awsvpc" # Using awsvpc as our network mode as this is required for Fargate | |
| cpu = 256 # Specifying the CPU our container requires | |
| memory = 512 # Specifying the memory our container requires | |
| execution_role_arn = "${data.aws_iam_role.ecs_task_execution_role.arn}" | |
| } | |
| data "aws_iam_role" "ecs_task_execution_role" { | |
| name = "ecsTaskExecutionRole" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment