简体   繁体   中英

Terraform Error: Extraneous label for module when running terraform init

I am getting this error when I run terraform init:

Error: Extraneous label for module

  on rds.tf line 22, in module "rds" "app":
  22: module "rds" "app" {

Only 1 labels (name) are expected for module blocks.

I have a two modules created "rds" and "app" which I am both referencing when creating a db instance:

# PostgreSQL RDS App Instance
module "rds" "app" {

How doI fix this error?

If using TF 0.13, another option would be to use a single module with a count set to 2 and then a count.index to fetch the specific name for that iteration from a predefined list [] variable.

https://blog.ktz.me/terraform-0-13-count-modules/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM