Reputation: 1523
I recently started getting into the devops side of things and am currently working with Terraform and AWS ECS to setup a simple web server host my web applications.
Using my current Terraform config I can see my cluster being created with a service that has my task definition. I can't figure out how to run the tasks required to launch the webserver from Terraform. I can only see the capability to create the task definitions and services, but not run them. I am very new to both these technologies so I fear I might be missing something simple.
The setup I used is from an example I found online that I tried to follow.
TL;DR: I can create services using Terraform but can't seem to figure out how to run them.
Upvotes: 9
Views: 9673
Reputation: 201078
You need define an "aws_ecs_service"
resource in Terraform and in there define how many instances of your task you want running. In the example you link, that is done in the main.tf
file here.
Upvotes: 4
Reputation: 2469
There is no way you can run the task from terraform except running the external script or aws-cli
from the local-exec
provisioner.
Upvotes: 2