Unable to use terraform-aws-modules/vpc/aws

741 views
Skip to first unread message

Mayank Kumar

unread,
May 28, 2019, 11:19:30 AM5/28/19
to Terraform
Hi,
I am getting below error when using the module in the resource file as:

module "vpc" {
  source = "terraform-aws-modules/vpc/aws"
  name = "Terraform"

  cidr = "10.0.0.0/16"
  azs = "${slice(data.aws_availability_zones.available.names,0,var.subnet_count)}"
  private_subnets = ["10.0.1.0/24", "10.0.3.0/24"]
  public_subnets = ["10.0.0.0/24", "10.0.2.0/24"]

  enable_nat_gateway = true

  create_database_subnet_group = false

  
  tags {
  }
}

When running init in the folder, i am receiving this issue:

C:\Users\terraform\project-03\>terraform init
Initializing modules...
- module.vpc
  Found version 2.1.0 of terraform-aws-modules/vpc/aws on registry.terraform.io
  Getting source "terraform-aws-modules/vpc/aws"

Error downloading modules: Error loading modules: module vpc: Error parsing .terraform\modules\2683148c87fd679d1116df9f
366f3b91\terraform-aws-modules-terraform-aws-vpc-c032c26\main.tf: At 2:23: Unknown token: 2:23 IDENT max

I can see in the module issue is coming at: 

locals {
  max_subnet_length = max(
    length(var.private_subnets),
    length(var.elasticache_subnets),
    length(var.database_subnets),
    length(var.redshift_subnets),
  )

Any pointers for this? 

⁞ Fernando Miguel

unread,
May 28, 2019, 11:40:51 AM5/28/19
to terrafo...@googlegroups.com
you need to pick a version... either to use a compatible with tf 0.11 or 0.12
-- 


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/2d931a05-cce4-4884-8def-142576d40b8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages