cloudposse / terraform-aws-elastic-beanstalk-environment

Terraform module to provision an AWS Elastic Beanstalk Environment
https://cloudposse.com/accelerate
Apache License 2.0
303 stars 325 forks source link

Missing alb_zone_id #136

Closed cereme closed 2 years ago

cereme commented 4 years ago

I'm getting following error as using eu-north-1 region

Error: Invalid index

  on .terraform/modules/eu-north-1.foo.elastic_beanstalk_environment/outputs.tf line 22, in output "elb_zone_id":
  22:   value       = var.alb_zone_id[var.region]
    |----------------
    | var.alb_zone_id is map of string with 15 elements
    | var.region is "eu-north-1"

The given key does not identify an element in this collection value.

As I taking a look at the code, some regions are missing.

# From: http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region
# Via: https://github.com/hashicorp/terraform/issues/7071
variable "alb_zone_id" {
  type = map(string)

  default = {
    ap-northeast-1 = "Z1R25G3KIG2GBW"
    ap-northeast-2 = "Z3JE5OI70TWKCP"
    ap-south-1     = "Z18NTBI3Y7N9TZ"
    ap-southeast-1 = "Z16FZ9L249IFLT"
    ap-southeast-2 = "Z2PCDNR3VC2G1N"
    ca-central-1   = "ZJFCZL7SSZB5I"
    eu-central-1   = "Z1FRNW7UH4DEZJ"
    eu-west-1      = "Z2NYPWQ7DFZAZH"
    eu-west-2      = "Z1GKAAAUGATPF1"
    sa-east-1      = "Z10X7K2B4QSOFV"
    us-east-1      = "Z117KPS5GTRQ2G"
    us-east-2      = "Z14LCN19Q5QHIC"
    us-west-1      = "Z1LQECGX5PH1X"
    us-west-2      = "Z38NKT9BP95V3O"
    eu-west-3      = "ZCMLWB8V5SYIT"
  }

  description = "ALB zone id"
}

https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment/blob/master/variables.tf#L440

So regions below are missing. Please update them.

Africa (Cape Town) | af-south-1
Asia Pacific (Hong Kong) | ap-east-1
Asia Pacific (Osaka-Local) | ap-northeast-3
Europe (Frankfurt) | eu-central-1
Europe (Milan) | eu-south-1
Europe (Stockholm) | eu-north-1
Middle East (Bahrain) | me-south-1
South America (São Paulo) | sa-east-1
cereme commented 4 years ago

I checked through method from https://github.com/hashicorp/terraform/issues/7071

Region name Region code alb_zone_id
Africa (Cape Town) af-south-1 Z1EI3BVKMKK4AM
Asia Pacific (Hong Kong) ap-east-1 ZPWYUBWRU171A
Europe (Frankfurt) eu-central-1 Z1FRNW7UH4DEZJ
Europe (Milan) eu-south-1 Z10VDYYOA2JFKM
Europe (Stockholm) eu-north-1 Z23GO28BZ5AETM
Middle East (Bahrain) me-south-1 Z2BBTEKR2I36N2
South America (São Paulo) sa-east-1 Z10X7K2B4QSOFV
lbecraft commented 3 years ago

Getting same error as some regions are missing like: us-gov-west-1 us-gov-east-1

cereme commented 3 years ago

Getting same error as some regions are missing like: us-gov-west-1 us-gov-east-1

thanks, I'll update this with the regions

cereme commented 3 years ago

I found the information from https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/using-govcloud-endpoints.html, also added the regions! Plz check commit 7ee2aa3 on PR #137

aknysh commented 2 years ago

resolved in https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment/pull/137