Skip to content
Latchkey

Terraform "Conflicting configuration arguments" in CI

The provider marks certain arguments as mutually exclusive (ConflictsWith). Setting both on one resource -- for example inline rules and a standalone rule resource -- violates that constraint.

What this error means

validate/plan fails with "Conflicting configuration arguments", naming the two arguments. It commonly appears when mixing inline and standalone forms, or two ways of specifying the same thing.

terraform
Error: Conflicting configuration arguments

  on main.tf line 14, in resource "aws_instance" "app":
  14:   subnet_id = aws_subnet.app.id

"subnet_id": conflicts with network_interface

Common causes

Two mutually exclusive arguments set

The schema allows only one of the pair (e.g. subnet_id vs a network_interface block), so setting both conflicts.

Inline and standalone forms mixed

Defining inline rules on a resource while also using a standalone rule resource for the same thing triggers the conflict.

How to fix it

Keep one form, remove the other

Choose either the inline argument or the standalone/alternative form and delete the conflicting one.

main.tf
resource "aws_instance" "app" {
  # use subnet_id OR a network_interface block, not both
  subnet_id = aws_subnet.app.id
}

How to prevent it

  • Do not mix inline and standalone forms for the same configuration.
  • Check provider docs for ConflictsWith argument pairs.
  • Run terraform validate in CI to catch conflicts before apply.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →