Heya, following all the example terraform config, on first terraform plan I get the following errors:
Error: Reference to undeclared resource
on main.tf line 192, in resource "aws_ecs_service" "staging":
192: cluster = aws_ecs_cluster.staging.id
A managed resource "aws_ecs_cluster" "staging" has not been declared in the
root module.
Error: Reference to undeclared input variable
on main.tf line 231, in resource "null_resource" "push":
231: command = "${coalesce("push.sh", "${path.module}/push.sh")} ${var.source_path} ${aws_ecr_repository.repo.repository_url} ${var.tag}"
An input variable with the name "source_path" has not been declared. This
variable can be declared with a variable "source_path" {} block.
Error: Reference to undeclared input variable
on main.tf line 231, in resource "null_resource" "push":
231: command = "${coalesce("push.sh", "${path.module}/push.sh")} ${var.source_path} ${aws_ecr_repository.repo.repository_url} ${var.tag}"
An input variable with the name "tag" has not been declared. This variable can
be declared with a variable "tag" {} block.
The tag one is simple, I can just remove the tag or add a tag variable, but what about the other issues?
Heya, following all the example terraform config, on first
terraform planI get the following errors:The tag one is simple, I can just remove the tag or add a tag variable, but what about the other issues?
Fixed my issues, was missing these variables:
And was also missing the ECS cluster definition: