Home > database >  A resource instance address is required here. The module path must be followed by a resource instanc
A resource instance address is required here. The module path must be followed by a resource instanc

Time:06-02

Changes to a particular module are not being applied. Hence, I wanted to try using terraform apply --replace for a particular module. I tried this:

 terraform apply -replace="module.moduleName"

However, I get an error that:

A resource instance address is required here. The module path must be followed by a resource instance specification.

Now I am not sure what exactly is the instance address in this case. If it's a path, what path should I use? Should I enter the path from the file where i am running this terraform command to the file where the module is declared?

CodePudding user response:

Resource addressing in TF is explain in docs.

Lets say, your module creates an ec2 instance. Then it should be:

terraform apply -replace="module.moduleName.aws_instance.web"
  • Related