diff --git a/provisioner/terraform/provision.go b/provisioner/terraform/provision.go index ecc493b991c56..56da18c732815 100644 --- a/provisioner/terraform/provision.go +++ b/provisioner/terraform/provision.go @@ -357,11 +357,10 @@ func parseTerraformPlan(ctx context.Context, terraform *tfexec.Terraform, planfi if resource.Type == "coder_agent" || resource.Type == "coder_agent_instance" { continue } - resourceKey := strings.Join([]string{resource.Type, resource.Name}, ".") resources = append(resources, &proto.Resource{ Name: resource.Name, Type: resource.Type, - Agents: findAgents(resourceDependencies, agents, resourceKey), + Agents: findAgents(resourceDependencies, agents, resource.Address), }) } @@ -498,8 +497,7 @@ func parseTerraformApply(ctx context.Context, terraform *tfexec.Terraform, state if resource.Type == "coder_agent" || resource.Type == "coder_agent_instance" { continue } - resourceKey := strings.Join([]string{resource.Type, resource.Name}, ".") - resourceAgents := findAgents(resourceDependencies, agents, resourceKey) + resourceAgents := findAgents(resourceDependencies, agents, resource.Address) for _, agent := range resourceAgents { // Didn't use instance identity. if agent.GetToken() != "" {