title: The parameter CacheSubnetGroupName must be provided and must not be blank
body: <p>I use the module, <a href="https://github.com/cloudposse/terraform-aws-elasticache-redis" rel="nofollow noreferrer">https://github.com/cloudposse/terraform-aws-elasticache-redis</a> to provision elasticache redis. Below are the errors when I run terraform apply. I have no clue of these errors.</p>
  <p>Terraform version: v0.13.5</p>
  <p>module.redis.aws_elasticache_parameter_group.default[0]: Creating...</p>
  <p>module.redis.aws_elasticache_subnet_group.default[0]: Creating...</p>
  <p>Error: Error creating CacheSubnetGroup: InvalidParameterValue: The parameter CacheSubnetGroupName must be provided and must not be blank.
  status code: 400, request id: a1ab57b1-fa23-491c-aa7b-a2d3804014c9</p>
  <p>Error: Error creating Cache Parameter Group: InvalidParameterValue: The parameter CacheParameterGroupName must be provided and must not be blank.
  status code: 400, request id: 9abc80b6-bd3b-46fd-8b9e-9bf14d1913eb</p>
  <pre><code>redis.tf:
  
  module &quot;redis&quot; {
    source                     = &quot;git::https://github.com/cloudposse/terraform-aws-elasticache-redis.git?ref=tags/0.25.0&quot;
    availability_zones               = var.azs
    vpc_id                           = module.vpc.vpc_id
    allowed_security_groups          = [data.aws_security_group.default.id]
    subnets                          = module.vpc.private_subnets
    cluster_size                     = var.redis_cluster_size #number_cache_clusters
    instance_type                    = var.redis_instance_type
    apply_immediately                = true
    automatic_failover_enabled       = false
    engine_version                   = var.engine_version
    family                           = var.family
    replication_group_id             = var.replication_group_id
    elasticache_subnet_group_name    = var.elasticache_subnet_group_name
    #enabled                          = true
    enabled                          = var.enabled
  
    #at-rest encryption is to increase data security by encrypting on-disk data.
    at_rest_encryption_enabled       = var.at_rest_encryption_enabled
  
    #in-transit encryption protects data when it is moving from one location to another.
    transit_encryption_enabled       = var.transit_encryption_enabled
  
    cloudwatch_metric_alarms_enabled = var.cloudwatch_metric_alarms_enabled
  
    parameter = [
      {
        #Keyspace notifications send events for every operation affecting the Redis data space.
        name  = &quot;notify-keyspace-events&quot;
        value = &quot;lK&quot;
      }
    ]
    context = module.this.context
  }
  
  context.tf:
  module &quot;this&quot; {
    source = &quot;git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.19.2&quot;
  
    enabled             = var.enabled
    namespace           = var.namespace
    environment         = var.environment
    stage               = var.stage
    name                = var.name
    delimiter           = var.delimiter
    attributes          = var.attributes
    tags                = var.tags
    additional_tag_map  = var.additional_tag_map
    label_order         = var.label_order
    regex_replace_chars = var.regex_replace_chars
    id_length_limit     = var.id_length_limit
  
    context = var.context
  }
  
  variable &quot;context&quot; {
    type = object({
      enabled             = bool
      namespace           = string
      environment         = string
      stage               = string
      name                = string
      delimiter           = string
      attributes          = list(string)
      tags                = map(string)
      additional_tag_map  = map(string)
      regex_replace_chars = string
      label_order         = list(string)
      id_length_limit     = number
    })
    default = {
      enabled             = true
      namespace           = null
      environment         = null
      stage               = null
      name                = null
      delimiter           = null
      attributes          = []
      tags                = {}
      additional_tag_map  = {}
      regex_replace_chars = null
      label_order         = []
      id_length_limit     = null
    }
    description = &lt;&lt;-EOT
      Single object for setting entire context at once.
      See description of individual variables for details.
      Leave string and numeric variables as `null` to use default value.
      Individual variable settings (non-null) override settings in context object,
      except for attributes, tags, and additional_tag_map, which are merged.
    EOT
  }
  
  variable &quot;enabled&quot; {
    type        = bool
    default     = true
    description = &quot;Set to false to prevent the module from creating any resources&quot;
  }
  
  variable &quot;namespace&quot; {
    type        = string
    default     = null
    description = &quot;Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp'&quot;
  }
  
  variable &quot;environment&quot; {
    type        = string
    default     = null
    description = &quot;Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT'&quot;
  }
  
  variable &quot;stage&quot; {
    type        = string
    default     = null
    description = &quot;Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release'&quot;
  }
  
  variable &quot;name&quot; {
    type        = string
    default     = null
    description = &quot;Solution name, e.g. 'app' or 'jenkins'&quot;
  }
  
  variable &quot;delimiter&quot; {
    type        = string
    default     = null
    description = &lt;&lt;-EOT
      Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.
      Defaults to `-` (hyphen). Set to `&quot;&quot;` to use no delimiter at all.
    EOT
  }
  
  variable &quot;attributes&quot; {
    type        = list(string)
    default     = []
    description = &quot;Additional attributes (e.g. `1`)&quot;
  }
  
  variable &quot;tags&quot; {
    type        = map(string)
    default     = {}
    description = &quot;Additional tags (e.g. `map('BusinessUnit','XYZ')`&quot;
  }
  
  variable &quot;additional_tag_map&quot; {
    type        = map(string)
    default     = {}
    description = &quot;Additional tags for appending to tags_as_list_of_maps. Not added to `tags`.&quot;
  }
  
  variable &quot;label_order&quot; {
    type        = list(string)
    default     = null
    description = &lt;&lt;-EOT
      The naming order of the id output and Name tag.
      Defaults to [&quot;namespace&quot;, &quot;environment&quot;, &quot;stage&quot;, &quot;name&quot;, &quot;attributes&quot;].
      You can omit any of the 5 elements, but at least one must be present.
    EOT
  }
  
  variable &quot;regex_replace_chars&quot; {
    type        = string
    default     = null
    description = &lt;&lt;-EOT
      Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`.
      If not set, `&quot;/[^a-zA-Z0-9-]/&quot;` is used to remove all characters other than hyphens, letters and digits.
    EOT
  }
  
  variable &quot;id_length_limit&quot; {
    type        = number
    default     = null
    description = &lt;&lt;-EOT
      Limit `id` to this many characters.
      Set to `0` for unlimited length.
      Set to `null` for default, which is `0`.
      Does not affect `id_full`.
    EOT
  }
  </code></pre>