Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

stack//web-service crash with big image string when name is not defined #123

Open
wiliamsouza opened this issue Apr 25, 2017 · 0 comments
Open

Comments

@wiliamsouza
Copy link

When the image name is more than 32 characters we get the following error:

2017/04/25 10:40:18 [ERROR] root.accounts.elb: eval: *terraform.EvalValidateResource, err: Warnings: []. Errors: [only alphanumeric characters and hyphens allowed in "name": "554136634080.dkr.ecr.us-east-2.ama
zonaws.com-olist-dex:latest" "name" cannot be longer than 32 characters: "554136634080.dkr.ecr.us-east-2.amazonaws.com-olist-dex:latest"]
2017/04/25 10:40:18 [ERROR] root.accounts.elb: eval: *terraform.EvalSequence, err: Warnings: []. Errors: [only alphanumeric characters and hyphens allowed in "name": "554136634080.dkr.ecr.us-east-2.amazonaws.c
om-olist-dex:latest" "name" cannot be longer than 32 characters: "554136634080.dkr.ecr.us-east-2.amazonaws.com-olist-dex:latest"]

how to reproduce.

module "accounts" {                                                                                                                                                                                              
  source             = "github.com/segmentio/stack//web-service"                                                                                                                                                 
  image              = "554136634080.dkr.ecr.us-east-2.amazonaws.com/olist/dex:latest"                                                                                                                           
  port               = 5556                                                                                                                                                                                      
                                                                                                                                                                                                                 
  environment      = "${module.stack.environment}"                                                                                                                                                               
  cluster          = "${module.stack.cluster}"                                                                                                                                                                   
  iam_role         = "${module.stack.iam_role}"                                                                                                                                                                  
  security_groups  = "${module.stack.external_elb}"                                                                                                                                                              
  subnet_ids       = "${module.stack.external_subnets}"                                                                                                                                                          
  log_bucket       = "${module.stack.log_bucket_id}"                                                                                                                                                             
  internal_zone_id = "${module.stack.zone_id}"                                                                                                                                                                   
  external_zone_id = "${module.domain.zone_id}"                                                                                                                                                                  
                                                                                                                                                                                                                 
  env_vars = <<EOF                                                                                                                                                                                               
[                                                                                                                                                                                                                
  { "name": "AWS_REGION",            "value": "${module.stack.region}"        },                                                                                                                                 
  { "name": "AWS_ACCESS_KEY_ID",     "value": "${module.ses_user.access_key}" },                                                                                                                                 
  { "name": "AWS_SECRET_ACCESS_KEY", "value": "${module.ses_user.secret_key}" }                                                                                                                                  
]                                                                                                                                                                                                                
EOF                                                                                                                                                                                                              
}

Workaround add small name.

module "accounts" {                                                                                                                                                                                              

  name              = "smalname"
  source             = "github.com/segmentio/stack//web-service"                                                                                                                                                 
  image              = "554136634080.dkr.ecr.us-east-2.amazonaws.com/olist/dex:latest"   
...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant