Advertisement
Guest User

Untitled

a guest
May 19th, 2020
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. _______________main.tf________________
  2.  
  3. module "m1" {
  4. source = "../modules/m1"
  5. }
  6.  
  7. module "m2" {
  8. source = "../modules/m2"
  9. }
  10. ------------------------------------------
  11.  
  12. ------------------m2.tf--------------------
  13. resource "aws_db_subnet_group" "db_subnet_group" {
  14. name_prefix = "xxx-db"
  15. subnet_ids = module.m1.subnetsIds
  16. tags = {
  17. "Name" = "xxx db subnet group"
  18. }
  19. }
  20.  
  21. --------------------------------------------------
  22.  
  23.  
  24. terraform validate
  25.  
  26. Error: Reference to undeclared module
  27.  
  28. on ../modules/m2/m2.tf line 8, in resource "aws_db_subnet_group" "db_subnet_group":
  29. 8: subnet_ids = module.m1.subnetsIds
  30.  
  31. No module call named "m1" is declared in m2.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement