Skip to content

Instantly share code, notes, and snippets.

@AndrewBestbier
Created March 11, 2020 12:19
Show Gist options
  • Select an option

  • Save AndrewBestbier/997194dd657815c2cf4f20987716df4d to your computer and use it in GitHub Desktop.

Select an option

Save AndrewBestbier/997194dd657815c2cf4f20987716df4d to your computer and use it in GitHub Desktop.
resource "aws_ecs_service" "my_first_service" {
name = "my-first-service" # Naming our first service
cluster = "${aws_ecs_cluster.my_cluster.id}" # Referencing our created Cluster
task_definition = "${aws_ecs_task_definition.my_first_task.arn}" # Referencing the task our service will spin up
launch_type = "FARGATE"
desired_count = 3 # Setting the number of containers we want deployed to 3
network_configuration {
subnets = ["${aws_default_subnet.default_subnet_a.id}", "${aws_default_subnet.default_subnet_b.id}", "${aws_default_subnet.default_subnet_c.id}"]
assign_public_ip = true # Providing our containers with public IPs
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment